in reply to Network or no network???... That is the question!

Who cares about the network? All you want to know is whether you can reach the machine you're interested in, on the port you want. What better way to test than to see if you can communicate with it?

my $s = IO::Socket::INET->new( PeerHost => '10.0.0.1', PeerPort => 80, # or whatever port you want Timeout => 15, Proto => 'tcp', ); if( $s ) { close $s; # it's ok } else { die $!; # it's not }


print@_{sort keys %_},$/if%_=split//,'= & *a?b:e\f/h^h!j+n,o@o;r$s-t%t#u'