in reply to Re: Capturing brackets within a repeat group
in thread Capturing brackets within a repeat group
That's interesting. I've read that passage many times but never interpreted it that way. The bracketed comment you ommitted from the end of the paragraph:
The numbered variables ($1, $2, $3, etc.) and the related punctuation set ($+, $&, $`, and $') are all dynamically scoped until the end of the enclosing block or until the next successful match, whichever comes first. (See Compound Statements in the perlsyn manpage.)
led me to think that this was only relevent to the scope of the capture buffers external to the statement itself. I read the phrase you highlighted ... or until the next successful match ... to mean a successful match as part of a distinctly seperate m// or s/// (hence the reference to "Compound Statements"), rather than as the next successful match within the same statement.
Oh well. It was a nice idea. Thanks for setting me straight.
Examine what is said, not who speaks.
The 7th Rule of perl club is -- pearl clubs are easily damaged. Use a diamond club instead.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Capturing brackets within a repeat group
by John M. Dlugosz (Monsignor) on Jan 11, 2003 at 06:15 UTC | |
by BrowserUk (Patriarch) on Jan 11, 2003 at 10:19 UTC | |
by John M. Dlugosz (Monsignor) on Jan 11, 2003 at 17:55 UTC |