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

Re: $1, $2, et al -- docs misleading about scope

Thread Previous | Thread Next
From:
david nicol
Date:
September 4, 2003 02:02
Subject:
Re: $1, $2, et al -- docs misleading about scope
Message ID:
1062666110.1349.195.camel@plaza.davidnicol.com

Japhy wrote, some time ago:
>   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.)

> [...]

> I don't know the best way to properly word this in the docs.  Any
> suggestions?

how about:

-  comes first.  (See "Compound Statements" in perlsyn.)
+  comes first.  (Body blocks of conditional and looping constructs
+  are considered to persist at the same level as the control
+  variables. See "Compound Statements" in perlsyn.)


<vanity>
how many of these do I need to have accepted before I get listed in the
AUTHORS file? </vanity>


-- 
David Nicol / If at first you don't succeed, use a bigger hammer. 
                                        http://gallaghersmash.com


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