Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
It results in "no" when I can ping the local IP via CMD (Windows). Ultimately I want to ping every 5 seconds and add a timeout of 2 seconds (if someone can show me how).#!/usr/bin/perl use warnings; use strict; use Net::Ping; my $target = "10.64.164.56"; my $p = Net::Ping->new(); if ($p->ping($target, 2)) { print "We can ping"; } else { print "no"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Short pinging script isn't working
by jbert (Priest) on Nov 21, 2007 at 16:12 UTC | |
by grinder (Bishop) on Nov 21, 2007 at 19:07 UTC | |
by andyford (Curate) on Nov 21, 2007 at 20:01 UTC | |
Re: Short pinging script isn't working
by andyford (Curate) on Nov 21, 2007 at 17:52 UTC | |
Re: Short pinging script isn't working
by Aim9b (Monk) on Nov 21, 2007 at 19:19 UTC | |
Re: Short pinging script isn't working
by rb1980 (Initiate) on Nov 21, 2007 at 22:03 UTC |