$integer =~ s/(.*)(\.\d\d+)$/$1/; $float = $2; # do stuff $integer .= $float;