in reply to How to test for the fastest server to download from?

If you want to test the net link (the syntax will differ on Windoze) :
my @a=`ping -s 1024 $servertotest -c 10`;
Then some parsing (wonderful regexes) could give you the round trip time and packet loss
which could be a good way to test connectivity between your script and the 3 servers...

Now you'll probably have to get the servers load too, to make the best choice.

UPDATE :

Here is the parsing code for my box (it's "ping output dependant" ;-)
$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