in reply to Re: Regular expressions and sort
in thread Regular expressions and sort

Thanks, your solution seems better. I will use it :-).
But it still doesn't explain the strange behaviour of m//.

Replies are listed 'Best First'.
Re^3: Regular expressions and sort
by Fletch (Bishop) on Nov 04, 2005 at 14:22 UTC

    No, because perldoc perlre explains that:

    The numbered variables ($1, $2, $3, etc.) and the related punctuation set ($+, $&, $`, $', and $^N) are all dynamically scoped until the end of the enclosing block or until the next successful match, whichever comes first. (See "Compound Statements" in perlsyn.)