ait has asked for the wisdom of the Perl Monks concerning the following question:
Hello my fellow monkymen,
I'm looking for a module that can tell me if an IP is in a range. For example, I have a file with a bunch of IP ranges of spammers in the form:
192.168.1.120-192.168.1.141
I want to know if IP address X is in the range above. I looked at too many modules on the CPAN already and some seem to suck big time, so I am asking for advice on which would be the best module to use for this application IYO.
TIA,
Alejandro Imass
Update 1:
Very decent ones seem to be Net::IP::Match by Marcel Grünauer and Net::IP::Match::Regexp by Chris Dolan but they don't really fit my purpose exactly because they seem to use CIDR only. I'm sure there has to be similar decent modules for ranges in the form above!
Update 2:
Paul Bennett's Net::IPAddress::Util and related modules seem very cool and probably fit my bill. Any other suggestions?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Module for working with IP Addresses and Ranges
by halfcountplus (Hermit) on Oct 22, 2010 at 13:30 UTC | |
by ikegami (Patriarch) on Oct 22, 2010 at 15:25 UTC | |
by DrHyde (Prior) on Oct 25, 2010 at 09:43 UTC | |
by ait (Hermit) on Nov 02, 2010 at 18:05 UTC | |
Re: Module for working with IP Addresses and Ranges
by Kanji (Parson) on Oct 22, 2010 at 13:31 UTC | |
by ait (Hermit) on Oct 22, 2010 at 21:47 UTC | |
Re: Module for working with IP Addresses and Ranges
by DrHyde (Prior) on Oct 25, 2010 at 09:41 UTC |