Net::Subnet
Net::Subnet
Par Juerd Waalboer de Amsterdam.pm
Date : samedi 15 octobre 2011 17h10
Durée : 20 minutes
Cible : Intermédiaire
Langue : English
Tags : address bitwise closures ip operators
Writing "(inet_aton($ip) & inet_aton($mask)) eq (inet_aton($subnet) & inet_aton($mask))" is easy enough and doesn't really need a module. But with the introduction of IPv6, it became a little more complex. There are several modules that can do this, but I wanted a pure Perl solution that is also pretty fast. So I wrote Net::Subnet one afternoon, and used it in production the next day.