my $_IP = inet_aton( join '.', map { s/^0([1-9]\d*)$/$1/; $_ } # strip leading zeroes split( /\./, $original_ip) # of each octet );