in reply to Decimal Removal

You need to "escape" your decimal and it is probably a good idea to anchor it to the end of the string if possible ("$")
s/\.(\d+)$//;
An unescaped "." is a meta-character not an actual ".".

Replies are listed 'Best First'.
Re^2: Decimal Removal
by flounder99 (Friar) on Jun 19, 2002 at 15:10 UTC
    Also, unless you are going to use the stripped digits there is no reason to capture them with the  ()

    --

    flounder

      The poster implied they were because they were looking to do some rounding, as well they were capturing in the posted example. I was not trying to rewrite the posters code, just correct the things that were causing problems and improve where it didn't change the meaning.

      But yes you are right that if the poster does not intend to use the stripped digits then there is no reason to capture them with the parens.