Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NET::PING

Status
Not open for further replies.

Nova980

Technical User
May 20, 2009
40
US
Hello,

I"m trying to ping a server from another server using code below and I installed the mod but keep getting this error --> Can't locate object method "new" via package "Net::ping" (perhapes you forgot to load "Net::ping"?) at ping.pl line 4.

Mucho Grazzyazz, in advance.


Code:
#!/usr/bin/perl -w

use Net::Ping;

my $ip = '1.1.2.1';
my $p = Net::Ping->new( "icmp", 1, 64 );

if ( $p->ping($ip) ) {
    print "$ip answered\n";
} else {
    print "$ip did not answer\n";
}
 
You code works just fine for me.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top