#! perl -slw use strict; use Net::Ping; use Time::HiRes; my $host = 'bbc.co.uk'; my $p = Net::Ping->new('tcp'); $p->{portnum} = 80; $p->hires(); my ($ret, $duration, $ip) = $p->ping($host); printf("$ret:$host [ip: $ip] is alive (packet return time: %.2f ms)\n", 1000 * $duration); $p->close(); __END__ D:\Perl\test>245918 About to fork 1:bbc.co.uk [ip: 132.185.132.204] is alive (packet return time: 4907.06 ms) D:\Perl\test>