sub _num2ip{ my $num = shift; return join(".", unpack("CCCC", pack("N", $num))); } sub _ip2num{ my $ip = shift; unpack "N", pack("CCCC", split /\./, $ip); }