Subject: | close() fails when using "external" protocol |
Date: | Sat, 8 Sep 2007 01:58:00 +0200 |
To: | bug-Net-Ping [...] rt.cpan.org |
From: | Florent Bayle <florent [...] sarcelle.net> |
Message body not shown because it is not plain text.
Distribution name and version : Net-Ping-2.31
Perl version : v5.8.8 built for i486-linux-gnu-thread-multi
Operating System vendor and version : Debian GNU/Linux Sid
Other details : Net::Ping::External is installed.
Hi,
when I try to run close () on a Net::Ping object created with
"external" as protocol, it fails.
Sample code :
#! /usr/bin/perl
use Net::Ping;
my $pobj = Net::Ping->new("external");
$pobj->ping("localhost");
$pobj->close();
Output :
Can't call method "close" on an undefined value at /usr/share/perl/5.8/Net/Ping.pm line 1362.
Patch against the last version (also attached to this mail) :
--- Net/Ping.pm 2007-09-08 01:49:52.000000000 +0200
+++ Net/Ping.pm.new 2007-09-08 01:51:59.000000000 +0200
@@ -1365,7 +1365,7 @@
delete $self->{"syn"};
} elsif ($self->{"proto"} eq "tcp") {
# The connection will already be closed
- } else {
+ } elsif ($self->{"proto"} ne "external") {
$self->{"fh"}->close();
}
}
--
Florent
Message body is not shown because sender requested not to inline it.