On Tue Jul 23 12:27:44 2013, TOMMY wrote:
Show quoted text> I would like to be able to do--
>
> die unless Net::Ping->new( "tcp" )->port_number( 22 )->ping(
> "some_host.com" )
>
> Instead of--
>
> my $p = Net::Ping->new( "tcp" );
> $p->port_number( 22 );
> die unless $p->ping( "some_host.com" );
With v2.49_01 you can do
die unless Net::Ping->new( {proto => "tcp", port => 22} )->ping("some_host.com" );
but it will fail with 0, because ping over tcp does an echo ping,
port 22 will not return an "Connection refused",
which means it is unreachable. The ping logic is reverse here.
The default echo port works fine though.
--
Reini Urban