Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Match a Range of IP's

by runrig (Abbot)
on Sep 30, 2004 at 18:13 UTC ( #395437=note: print w/replies, xml ) Need Help??


in reply to Match a Range of IP's

If I understand correctly, you just want:
use Socket qw(inet_aton); my $lower = inet_aton("192.168.1.0"); my $upper = inet_aton("192.168.99.255"); while (<DATA>) { chomp; my $ip = inet_aton($_); print "$_\n" if $lower le $ip and $ip le $upper; }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2021-01-19 15:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?