more useful options | |
PerlMonks |
Re: Re: use of constants in regex substitutions?by edan (Curate) |
on Sep 23, 2003 at 11:45 UTC ( [id://293464]=note: print w/replies, xml ) | Need Help?? |
That won't work, because the /e modifier only applies to the second part of the substitution (i.e. the 'substitute with...' part). The first part of the regex follows normal string-interpolation rules, and "&sub" is NOT interpolated in a string any more than "sub" is. This regexp looks for the literal text '&TXT_EXTENSION', and substitutes it with '.mif'. See Zazo's reply for a correct answer. --3dan
In Section
Seekers of Perl Wisdom
|
|