Home: Perl Programming Help: Win32 Programming Help:
Net::Ping error: bad file descriptor



Xcross87
New User

May 5, 2009, 3:11 AM


Views: 5127
Net::Ping error: bad file descriptor

I've got troubles when using this script in Windows:


Code
#!C:/Perl/bin/perl.exe -w 
use Net::Ping;

my $host = shift @ARGV || "72.14.235.104";
my $p = Net::Ping->new("tcp");

if ( $p->ping( $host ) ) {
print "$host is reachable! \n"
}
else {
print $!;
}
$p->close();


And I got the error:

Code
 Bad file descriptor


I can't figure out why it is.
I run this script under Linux, it's fine.