develooper Front page | perl.perl5.porters | Postings from February 2013

Re: Salvaging lexical $_ from deprecation

Thread Previous | Thread Next
From:
Jan Dubois
Date:
February 20, 2013 07:00
Subject:
Re: Salvaging lexical $_ from deprecation
Message ID:
CAD-TLz_5KMO0XUMX=uNNL6qsy2sMh2FLnwf2NdsvkgeKipJFjg@mail.gmail.com
On Tue, Feb 19, 2013 at 10:42 PM, Rafael Garcia-Suarez
<rgs@consttype.org> wrote:
> What I'm
> certain of, is that having a global $_ introduces action-at-distance
> bugs -- some of which requiring being worked around by such ugly
> constructs as "local *_" or just avoiding $_ entirely.

Note that since 5.14.0 you can always use "local $_".  It is now
special-cased to just assign a new value, and won't carry over any
magic the old value may have attached to it.

Cheers,
-Jan

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About