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

Re: Salvaging lexical $_ from deprecation

Thread Previous | Thread Next
From:
Tom Christiansen
Date:
February 20, 2013 00:30
Subject:
Re: Salvaging lexical $_ from deprecation
Message ID:
7679.1361320225@chthon
Rafael Garcia-Suarez <rgs@consttype.org> wrote
   on Tue, 19 Feb 2013 22:27:00 +0100: 

> But the $<digit> variables are implicitly lexically scoped for a definition
> of scope that includes a last sight of a pattern match. In other contexts
> their behaviour is not guaranteed.

Eh?  No, they aren't.  Like most of the regex variables, the numbered variables
are dynamically scoped to scope enclosing that match.

--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