Dan Fish wrote:
Are ALL pattern matching variables set back to undef once another m// or
s/// expression is encountered, even if it contains no parenthized
expressions?
perldoc perlre
[snip]
The numbered match 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.)
NOTE: failed matches in Perl do not reset the match variables, which
makes easier to write code that tests for a series of more specific
cases and remembers the best match.
So in other words, a successful match of any kind will reset the match
variables.
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>