- or download this
sub parse_ipv4 {
local *_ = \(@_ ? $_[0] : $_);
return unpack('N', pack('C4', split(/\./)));
}
- or download this
use Socket ();
...
return unless defined $packed;
return unpack('N', $packed);
}
- or download this
print(parse_ipv4('202.227.44.16'), "\n");
# 3403885584