Re: [SPOILER] Re: New Quiz: "What does this code do?" (1-December-2006)
Ronald J Kimball <[email protected]> Thu, 14 Dec 2006 17:22:07 -0500
| Newsgroups | gmane.comp.lang.perl.qotw.discuss |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Dec 14, 2006 at 02:04:36PM -0800, Ben Prew wrote: > So the thing I don't understand is, if a pattern match is the same > thing as a subroutine call, and it's localizing the match, why do I > see the new value of $1 in the line after it. No one has said that a pattern match is the same thing as a subroutine call. A pattern matches localizes the regex variables in the current scope. It really is just that simple. Ronald