in reply to Re^2: non aliased default var $_
in thread non aliased default var $_

is really a good idiom!

For modern perl (5.10+)

Replies are listed 'Best First'.
Re^4: non aliased default var $_
by LanX (Saint) on Mar 10, 2010 at 14:33 UTC
    from perlsub

    The fix is to add local():

    local $_ = 5;

    ...

    As of perl 5.9.1, you can now use a lexical version of $_ by declaring it in a file or in a block with "my".

    Cheers Rolf