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

Re: [perl #120047] perl should enable "$_" for use before calling subs

Thread Previous | Thread Next
From:
Tom Christiansen
Date:
September 29, 2013 12:09
Subject:
Re: [perl #120047] perl should enable "$_" for use before calling subs
Message ID:
1285.1380456548@chthon
"Leon Timmermans via RT" <perlbug-followup@perl.org> wrote
   on Sun, 29 Sep 2013 04:43:26 PDT: 

> When using $_ in a subroutine and you do not want it to affect or or be
> affected by the calling environment, you should use local on it. Or
> better yet, just use a lexical variable. Not doing so is a bug, your
> bug. Perl is behaving as intended and expected.

> Closing this as not-a-bug

Agreed.

--tom

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