Skip Menu |

This queue is for tickets about the Net-Ping CPAN distribution.

Report information
The Basics
Id: 87194
Status: resolved
Priority: 0/
Queue: Net-Ping

People
Owner: Nobody in particular
Requestors: tommy [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Feature request: method chaining off of ::port_number()
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" );
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
We wont do the proposed chaining, we rather support the hash, which is simplier. -- Reini Urban