[Mimedefang] Stupid question? - subnet

Richard Cooper ric at digital-animations.com
Tue Feb 11 09:22:01 EST 2003


> On Mon, 10 Feb 2003, David F. Skoll wrote:
> 
> > On Mon, 10 Feb 2003, Jim McCullars wrote:
> >
> > >    It's a string comparison, so you may be looking at a 
> fairly complicated
> > > regex to do the test you want (I say "may be" because I 
> don't know how to
> > > decode a CIDR address string to a range of addresses).
> >
> > You might want to look at a Perl module to do CIDR 
> comparisons; I think
> > Net::CIDR::Lite might be just the ticket:
> >
> > http://search.cpan.org/author/DOUGW/Net-CIDR-Lite-0.14/Lite.pm
> >
> > Or perhaps NetAddr::IP is more to your liking:
> >
> > http://search.cpan.org/author/LUISMUNOZ/NetAddr-IP-3.14/IP.pm
> >
> > Or Net::CIDR:
> >
> > http://search.cpan.org/author/MRSAM/Net-CIDR-0.04/CIDR.pm
> >
> > What was that horrible Perl slogan again?  "TIMTOWTDI"?
> >
> 

Thanks for these - I'm having some problems installing Perl modules though so I'm just using Josh's code. I'm getting an error on this line though in the ip2bin sub - 

> 			my $bin = &dec2bin($_);

because there is no dec2bin sub. Is there something I'm missing (or something missing from the code) or is this something I can remove? I hate to admit I can't follow it 100% but I can't :). This is in the sub ip2bin - to get ip to dec it goes ip to bin then bin to dec - is there any reason why it needs a dec to bin sub?

Thanks
Ric

-- 
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom
they are addressed.

If you have received this email in error please notify the
originator of the message. This footer also confirms that this
email message has been scanned for the presence of computer viruses.

Any views expressed in this message are those of the individual
sender, except where the sender specifies and with authority,
states them to be the views of Digital Animations Group.



More information about the MIMEDefang mailing list