in reply to why doesn't Net::ping work when native ping does?
#!/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 |