in reply to why doesn't Net::ping work when native ping does?

LWP::Simple can serve as an alternative to Net::Ping. For example:
#!/usr/bin/perl -l use strict; use warnings; use LWP::Simple; use Time::HiRes qw(sleep); my $content = head('http://www.perlmonks.com'); foreach (1..20) { if ( $content ) { print "Site is reachable on: ", scalar(localtime()); sleep 0.5; } else { print "Site isn't reachable"; } }

Replies are listed 'Best First'.
Re^2: why doesn't Net::ping work when native ping does?
by afoken (Chancellor) on Jan 29, 2012 at 08:15 UTC
    LWP::Simple can serve as an alternative to Net::Ping.

    What makes you think that every machine runs an HTTP daemon?

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)