in reply to (Ovid) Re: Localized Backreferences
in thread Localized Backreferences, If Statements & Blocks
Apparently, the interpreter doesn't treat a regex any differently if it's in an if statement or not -- consistency is good.
In the original post, the regex was in package scope (not in an enclosing block). That means the end of the scope is the end of the file -- or the next successful backreference match which will assign something else to $1. Since the next regex doesn't match, and $1 is used before the end of the file, it still contains the last successful capture.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: (Ovid) Re: Localized Backreferences
by doran (Deacon) on Sep 15, 2000 at 07:38 UTC |