Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: pinger - ping a range of hosts

by spaz (Pilgrim)
on Mar 23, 2001 at 23:09 UTC ( [id://66704]=note: print w/replies, xml ) Need Help??


in reply to pinger - ping a range of hosts

I only have 2 comments really :)
  • Your regexp for IP's is flawed, I can enter 999.999.999.999, which obviously isn't a real IP.
    I found something similar to this in the Ram book
    (?:(?:[01]?\d?\d|2[0-4]\d|25[0-5])\.?){4}
    Disclaimer: I realize this may not be the most efficent regex, but it does work, right?
  • If you're on a UNIX machine, you could always use nmap
-- Dave

Replies are listed 'Best First'.
Re: Re: pinger - ping a range of hosts
by idnopheq (Chaplain) on Apr 26, 2001 at 15:31 UTC
    The errata for Perl Cookbook at O'Reilly has a modified ip validation re. It is also in ping for ppt by me.

    m{ ^ ( \d | [01]?\d\d | 2[0-4]\d | 25[0-5] ) \. ( \d | [01]?\d\d | 2[0-4]\d | 25[0-5] ) \. ( \d | [01]?\d\d | 2[0-4]\d | 25[0-5] ) \. ( \d | [01]?\d\d | 2[0-4]\d | 25[0-5] ) $ # from the Perl Cookbook, Reci +pe 6.23, }xo # pages 218-9, as fixed in the + 01/00 reprint

    HTH
    --
    idnopheq
    Apply yourself to new problems without preparation, develop confidence in your ability to to meet situations as they arrise.

      ١.٢.٣.٤ is not a valid IP, it matches the regex though :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://66704]
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 06:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found