ping

Dirk2 Dirk at finches.com
Sat May 22 08:39:40 CDT 2004


~sdpm~
Perl Mongers,

Why can't we ping from inside a Perl script?  Anything obvious I'm 
missing here?

~: uname -a
Linux localhost.localdomain 2.4.21-15.EL #1 Thu Apr 22 00:26:34 EDT 2004
i686 athlon i386 GNU/Linux

That's Red Hat Enterprise Linux ES (v. 3 for x86)





Here's the script that fails:
________________________________________
#!/usr/bin/perl -w

use Net::Ping;

if ( pingecho("www.yahoo.com", 2) ) {
    print "Yahoo is on the network.\n";
}
________________________________________




But ping on the command line works fine:

~: ping www.yahoo.com
PING www.yahoo.akadns.net (66.94.230.36) 56(84) bytes of data.
64 bytes from p5.www.scd.yahoo.com (66.94.230.36): icmp_seq=0 ttl=49
time=22.1 ms
 
--- www.yahoo.akadns.net ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 22.109/22.109/22.109/0.000 ms, pipe 2


~sdpm~

The posting address is: san-diego-pm-list at hfb.pm.org

List requests should be sent to: majordomo at hfb.pm.org

If you ever want to remove yourself from this mailing list,
you can send mail to <majordomo at happyfunball.pm.org> with the following
command in the body of your email message:

    unsubscribe san-diego-pm-list

If you ever need to get in contact with the owner of the list,
(if you have trouble unsubscribing, or have questions about the
list itself) send email to <owner-san-diego-pm-list at happyfunball.pm.org> .
This is the general rule for most mailing lists when you need
to contact a human.




More information about the San-Diego-pm mailing list