jack298 has asked for the wisdom of the Perl Monks concerning the following question:
Hello! I started to use Perl after a half year and I am trying to ping a website. But it not working. I can't ping it, it prints "Not working". When I try with system() it works, but I want to do it with Net::Ping. I also tried with icmp but it prints error, too: "icmp socket error - Bad file descriptor at line 11 " (line 11 is $p = Net::Ping->new('icmp');) what can I do with it? Am I wrong? Or is it a bug?
Thanks for help! My code is:use Net::Ping; $url = <>; $p = Net::Ping->new(); if ($p->ping($url)) { print "working"; } else {print "not working"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Net::Ping blowed my mind
by rnewsham (Curate) on Jun 13, 2015 at 21:06 UTC | |
by jack298 (Initiate) on Jun 13, 2015 at 21:12 UTC | |
Re: Net::Ping blowed my mind
by trippledubs (Deacon) on Jun 13, 2015 at 21:19 UTC | |
Re: Net::Ping blowed my mind
by Laurent_R (Canon) on Jun 13, 2015 at 21:02 UTC | |
Re: Net::Ping blowed my mind
by Anonymous Monk on Jun 14, 2015 at 06:19 UTC |