.: monkey-mind :.

sheep go to heaven, goats go to hell

Expanding IPv6 addresses using a template

The Net::IP module allows you to render an IPv6 address in either short or long notation. However, sometimes we want to render it in a mixed mode for aesthetic reasons. The "as_string()" method below fixes this.

Download net_ip_as_string.pl

View net_ip_as_string.pl (non-popup).

If you run the net_ip_as_string.pl script you get the following results:

$ perl net_ip_as_string.pl L::L:S
> 1:2:3:4:5:6:7:8
0001:2:3:4:5:6:0007:8