$a = 1034341.8766756; my ($l, $r) = split /\./, $a; $a = substr($a, 0, (length $l) + 2);