Version-agnostic representation of an IP address in Perl