in reply to Truncate string without substr or length
$str =~ s/\.\d+$//;
See perlretut for a gentle introduction to regexes.
That removes the last period followed by a number, at the end of the string. If you only want to remove .25, use s/\.25// instead.
|
|---|