Net::IPAddress::UtilVersion-agnostic representation of an IP address | |
Download |
Net::IPAddress::Util Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Paul Bennett
- Publisher web site:
- http://search.cpan.org/~pwbennett/
Net::IPAddress::Util Tags
Net::IPAddress::Util Description
Net::IPAddress::Util is a Perl module to make IP addresses easy to deal with, regardless of whether they're IPv4 or IPv6, and regardless of the source (and destination) of the data being manipulated. The module Net::IPAddress::Util is for working with individual addresses, Net::IPAddress::Util::Range is for working with individual ranges of addresses, and Net::IPAddress::Util::Collection is for working with collections of addresses and/or ranges.SYNOPSIS use Net::IPAddress::Util try => 'GMP,Pari', qw( IP ); my $ipv4 = IP('192.168.0.1'); my $ipv46 = IP('::ffff:192.168.0.1'); my $ipv6 = IP('fe80::1234:5678:90ab'); print "$ipv4\n"; # 192.168.0.1 print "$ipv46\n"; # 192.168.0.1 print "$ipv6\n"; # fe80::1234:5678:90ab print $ipv4->normal_form() . "\n"; # 00000000000000000000ffffc0a80001 print $ipv46->normal_form() . "\n"; # 00000000000000000000ffffc0a80001 print $ipv6->normal_form() . "\n"; # fe8000000000000000001234567890ab for (my $ip = IP('192.168.0.0'); $ip < = IP('192.168.0.255'); $ip++) { # do something with $ip }Product's homepage
Net::IPAddress::Util Related Software