Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: pinger - ping a range of hosts

by spaz (Pilgrim)
on Mar 23, 2001 at 23:09 UTC ( #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


Comment on Re: pinger - ping a range of hosts
Download Code
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
Node Status?
node history
Node Type: note [id://66704]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2014-09-01 19:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (16 votes), past polls