#!/usr/bin/perl
use warnings;
use strict;
my $hping;
my $hping_compare;
my @hping_array = ();


for (1 .. 5){

        $hping = `sudo hping3 www.microsoft.com -S -p 80 -c 1`;
        push @hping_array,(split'\ ',$hping)[15];
}
$hping_compare = $hping_array[0];

foreach (@hping_array){
if ($_ le $hping_compare){

        print "Appears to be load balancing\n";

}
elsif ($_ ge $hping_compare){

        print "Appears to be load balancing\n";
}
else{
        print "Does not appear to be load balancing\n";
}
}

So now there is my new code. It all runs as expected and the with the 
suggestions of Uri. The problem still remains that I cannot find any 
documentation or search results on how one would compare as I have asked from 
the beginning. I need the ge value to be greater than by 100. If it is not 
greater than by 100, then it is a different value. 

With that in mind. Is it possible to do such a comparison? I need to do such an 
evaluation on the elsif above. in pseudocode it would be:

If (the current array element is 100 or more greater than the base array 
element){

        print " Appears to be load balancing\n"
}



--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to