Re: Pattern matching variables

2005-01-13 Thread Tor Hildrum
On Wed, 12 Jan 2005 17:27:46 -0700, Dan Fish <[EMAIL PROTECTED]> 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? > > For example, I would have expected $1 &am

Re: Pattern matching variables

2005-01-13 Thread John W. Krahn
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

Pattern matching variables

2005-01-13 Thread Dan Fish
Are ALL pattern matching variables set back to undef once another m// or s/// expression is encountered, even if it contains no parenthized expressions? For example, I would have expected $1 & $2 to be valid in BOTH print statements below... #!/usr/bin/perl -w # $string="ABC DEF GH