Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Net::Ping::External

by myocom (Deacon)
on Mar 11, 2001 at 22:15 UTC ( [id://63635]=note: print w/replies, xml ) Need Help??


in reply to Net::Ping::External

For the Win32 ping, you can add '> nul' (the equivalent of '> /dev/null') to give it the same behavior as the other OS's.

Also, you have it returning 0 if it finds "100% loss", but it will falsely report success if you feed it a host that doesn't exist, since the result of `ping` will be Unknown host foo.bar. (which doesn't contain "100% loss" in it).

Replies are listed 'Best First'.
(tye)Re: Net::Ping::External
by tye (Sage) on Mar 12, 2001 at 03:34 UTC

    BTW, File::Spec knows what "/dev/null" / "nul" is for more operating systems.

            - tye (but my friends call me "Tye")
Re: Re: Net::Ping::External
by Falkkin (Chaplain) on Mar 13, 2001 at 02:34 UTC
    Actually, I need to have Win32 ping behave differently than the other OS's. This is because, unlike everything Unix-like, Win32 returns 0 on successful ping, 0 on failed ping. Hence, I can't analyze the return value from system(), and actually need to parse the output, using backticks.
Re: Re: Net::Ping::External
by Falkkin (Chaplain) on Mar 11, 2001 at 22:18 UTC
    Thank you for the feedback; I've now fixed this in the code above.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://63635]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-03-29 15:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found