in reply to Re^2: uninitialized values
in thread uninitialized values
If you have not looked at it already, you may want to take a look at Net::Ping. that way you avoid a lot of system dependencies. On the down side there are limits to the sort of ping you can perform on Unix, unless you are running as root
Cheers,
R.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: uninitialized values
by gaurav (Sexton) on Aug 20, 2013 at 07:26 UTC | |
Hi R., I got struck now.I have one problem . My code has been working fine untill the host exist,But suppose if I have given some xyz ip which is not in that network, then its not working.So I want it to tell that Ip is unreachable or any other error msg.Give me some hint My code is
I hope you help me out of this.....Thanks | [reply] [d/l] |
by Random_Walk (Prior) on Aug 20, 2013 at 08:30 UTC | |
Can you please add comments to your code with examples of what the ping returns in each case. I think you may be looking for several different failure modes: As different OS/Ping combinations have different results it is hard for us to know what you are looking at in each case. If you add an example of each, in a comment before the related if statement, it will make debugging much easier. Not just for your fellow monks, but also for future maintainers of your code, including your future self. Cheers,
Pereant, qui ante nos nostra dixerunt!
| [reply] [d/l] |
by gaurav (Sexton) on Aug 20, 2013 at 09:18 UTC | |
Ok R. Below,I am trying to modify and add comment in my code
So its working fine Now when I passed an IP which is not present in our company network say
So How can I relay a message by using perl that host is not present in our network? But if it's present in our company's network but system is down.Say,
for this I have to say system is down.Remember here one thing that I am using this perl script on Fedora-14 Redhat Linux System
| [reply] [d/l] [select] |
by Random_Walk (Prior) on Aug 20, 2013 at 09:44 UTC | |