good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: my versus our in nested regexby BrowserUk (Patriarch) |
on Oct 18, 2003 at 17:08 UTC ( [id://300301]=note: print w/replies, xml ) | Need Help?? |
my variables don't come into existance until the end of the statement in which they are declared, which means that when the regex is being compiled, <update> the lexical scalar,<update> $regex doesn't yet exist. Using our bypasses this problem. If you want to avoid using a global, then pre-declare the lexical.
Updated description in the light of liz's observation below. Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham"Think for yourself!" - Abigail Hooray!
In Section
Seekers of Perl Wisdom
|
|