Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: batch ping problem

by marcink (Monk)
on Jun 13, 2001 at 19:18 UTC ( #88085=note: print w/replies, xml ) Need Help??

in reply to batch ping problem

How about using Net::Ping to do the checking?

As for the 'styllistic' part:
1. small tools like this should not be interactive -- if they get all the needed data from command line (@ARGV) they are easier to reuse in bigger scripts.
2. The /^64 bytes from ([0-9.]):/ will never match -- should be /^64 bytes from ([0-9.])*:/. Even then, finding such a line will mean that host $1 is available.
3. You're making the task more complex than it really is -- why dump all that data in one log file and then try to make sense of it if you could analyze it immediately after running ping?
4. Easier way of getting ping's output: my $t = `ping...`;

Update: See the example on `man Net::Ping` -- it does exactly what you need, you just have to fill in the address array. -mk

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (1)
As of 2023-06-08 03:09 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (29 votes). Check out past polls.