in reply to Re: Re: Re: Re: Re: Ping and Tracert
in thread Ping and Tracert
And here are the results.$ip = 'www.perlmonks.org'; $ping = `ping -c 3 $ip`; @times = $ping =~ /time=(\d+\.\d+)/; @times = sort { $b <=> $a } @times; print "High to low @times ms\n"; print "Highest $times[0] ms\n"; print "Lowest $times[-1] ms\n"; print "This was the reply parsed\n$ping\n";
It's not giving me the right data in the highest, lowest and highest to lowest. Please help.High to low 87.719 ms Highest 87.719 ms Lowest 87.719 ms This was the reply parsed PING www.perlmonks.org (206.170.14.76) from 207.16.70.63 : 56(84) byte +s of data. 64 bytes from yoda.blockstackers.com (206.170.14.76): icmp_seq=0 ttl=2 +38 time=87.719 msec 64 bytes from yoda.blockstackers.com (206.170.14.76): icmp_seq=1 ttl=2 +38 time=81.823 msec 64 bytes from yoda.blockstackers.com (206.170.14.76): icmp_seq=2 ttl=2 +38 time=82.001 msec --- www.perlmonks.org ping statistics --- 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max/mdev = 81.823/83.847/87.719/2.758 ms
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: Re: Re: Ping and Tracert
by tachyon (Chancellor) on Sep 01, 2001 at 00:30 UTC |