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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

doing ping with perl

Status
Not open for further replies.

justme77

Technical User
Feb 4, 2001
19
0
0
SG
hello to all,
I am a beginner in networking and perl. I wonder whether there is any perl module that allows me to ping a server and returns similar information found when i do a ping with DOS.

Thanks for the solution. cheers,
Just Me!!
 
Hi there,

Have a look on CPAN (start at for a module called Net::pING
Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
thanks Mike,
but i am wondering whether there are ways other than using Net::ping, as Net::ping doesn't give me the stuffs like TTL, roundtrip time, etc. cheers,
Just Me!!
 
you can always make system calls, with system() or backtics(`` or qx//). just do something like:[tt]
my $ping = qx(your ping command here);
[/tt]
this opens a pipe to the selected system call, returning the output to the variable $ping. a more sophisticated ping than Net::ping may exist, but i'm not aware of it. hth. "If you think you're too small to make a difference, try spending a night in a closed tent with a mosquito."
 
thanks to stillflame,
this is exactly what i want. I've got it working. cheers,
Just Me!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top