in reply to Re: Last Letters
in thread Last Letters

Even if there are other parens, reversing the string twice is a very weird way to get the data. Just use $ to anchor the match to the end of the string:
($number) = ($string =~ /\( (\d+) \) # number in parentheses [^()]* $/x); # at the end of the string

Replies are listed 'Best First'.
Re: Re: Re: Last Letters
by swiftone (Curate) on Nov 30, 2000 at 00:37 UTC
    Oops, you're right. I tend to overuse reversing ever since I found it to be such a nice solution to the comma-fying a number FAQ.