Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^7: uninitialized valuesby Random_Walk (Prior) |
on Aug 20, 2013 at 09:44 UTC ( [id://1050168]=note: print w/replies, xml ) | Need Help?? |
You really need to use some helpful names for your variables. I started to work on your code and gave up because while I have a good idea what this means:
it will take me some time to work out what this means:
I would suggest, other than using sane variable names, that you alter your series of if statements to use the if/elsif/else construct. This will give you a way to catch the error conditions from your ping. On a more minor point, it looks like you only allow a restricted range of IP addresses for your $host value. Yet later you capture the IP used by ping. Is there a case where you ask it to ping n.n.n.n and it pings m.m.m.m? If not you can just use the IP you fed into it. Cheers,
Pereant, qui ante nos nostra dixerunt!
In Section
Seekers of Perl Wisdom
|
|