good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Re^3: Character class in an arrayby Fastolfe (Vicar) |
on Sep 21, 2002 at 18:23 UTC ( [id://199781]=note: print w/replies, xml ) | Need Help?? |
I was just extending the original poster's qr/// suggestion. If you interpolate a variable in a 'qr' string, it "stays" interpolated and will not change if the value of the original variable changes with it, unless you re-create the string for every iteration.
Obviously, if you're going to want to use qr/// or the /o flag on a regex, you are doing so because you wish Perl to compile the regular expression once (at least within the lexical scope of the qr/// string).
In Section
Seekers of Perl Wisdom
|
|