in reply to net ping question
You probably don't want to use Net::Ping to this as this will use the TCP echo service and all you are doing is changing the port to which it tries to connect to this service. I would suggest if you just want to check whether you have a particular port open on a particular machine you do something like:
use IO::Socket; + my $sock = IO::Socket::INET->new(PeerAddr => 'localhost', PeerPort => 'http(80)', Proto => 'tcp'); + + print $sock ? "alive" : "not alive";
/J\
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: net ping question
by perlknight (Pilgrim) on Apr 15, 2005 at 15:01 UTC |