in reply to How to test for the fastest server to download from?
Then some parsing (wonderful regexes) could give you the round trip time and packet lossmy @a=`ping -s 1024 $servertotest -c 10`;
$a[$#a-1]=~/.*?(\d+)%.*/; # Get the Packet loss near the % my $pl=$1; my $rtt=(split'/',(split'=',$a[$#a])[1])[1]; # get the average Round +trip time
|
|---|