Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Perl Programming Language

improper return value from net::ping?


Help!  I have a script that does a pingprobe on a list of servers.  I
works fine with perl v5.6.1, but does not work with 5.8.8.  It looks
like the return value from net::ping has changed.  In 5.6.1 I always
get a return of either 1 or 0.  In 5.8.8 I get a 1 or 0 with a bunch
of other data including the ip being pinged appended, meaning my
return value is alway going to be non-0.  As a result a simple test
like

use Net::Ping;
my $p = Net::Ping->new("icmp");
print $p->ping("somehost");
$p->close();

is never going to work.  Why the change in the return value, and how
do I fix it?

In the latest version of Net::Ping, what the ping() method returns is
context dependent.

     perldoc Net::Ping

Evaluate ping() in scalar context:

     print scalar $p->ping("somehost");

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

On Jun 6, 11:41 am, Gunnar Hjalmarsson <nore@gunnar.cc> wrote:

Thanks Gunnar!  That did the trick!
Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc