Steve Bertrand wrote: > Curt Shaffer wrote: >> #!/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"; >> >> } > > # ignoring the fact that you were advised to use named variables > # instead of $_ where possible, here is one way to do it: > >> elsif ($_ ge $hping_compare){ > > elsif ( ( $_ + 100 ) >= $hping_compare ) {
I think I read what you are trying to do wrong. I'll try again: elsif ( ( $_ - $hping_compare ) >= 100 ) { Steve -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/