Fsdb::Support::IPv6 - ipv6-parsing helpers
use Fsdb::Support::IPv6;
$ipv6_zeroized = Fsdb::Support::IPv6::ipv6_zeroize('1:0002:3:4::'); # result is 1:2:3:4:0:0:0:0
Normalize an IPv6 address so it has all hextets present, with no leading zeros.
Also treats strings of hex digits without colons as IPv6 prefixes.
$ipv6_fullhex = Fsdb::Support::IPv6::ipv6_full('1:0002:3:4::'); # result is 0001000200030004000000000000000
Rewrite an IPv6 address as a full, 128-bit, base-16 number.
$ipv6_normal = Fsdb::Support::IPv6::ipv6_normalize('1:0002::7:0:00:8'); # result is 1:2::7:0:0:8
Convert an IPv6 address to IETF normal form. The input maybe has some fields 0 or leading zero, or :: in a non-standard place. Normalize it to remove leading zeros and replace the leftmost, longest run of zeros with ::.
$ip_normal = Fsdb::Support::IPv6::ip_fullhex_to_normal('20010db8000300040005000600070008'); # result is 2001:db8:3:4:5:6:7:8 $ip_normal = Fsdb::Support::IPv6::ip_fullhex_to_normal('c0000201'); # result is 192.0.2.1
Internal testing.
To install Fsdb, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Fsdb
CPAN shell
perl -MCPAN -e shell install Fsdb
For more information on module installation, please visit the detailed CPAN module installation guide.