Note the 'e' quantifier after the regex -- this tells the engine to evaluate the substitute before the substitution.$s1 =~ s/&TXT_EXTENSION/&MIF_EXTENSION/e;
Update: this code is incorrect, thanks to 3dan for pointing this out.
In reply to Re: use of constants in regex substitutions?
by dmitri
in thread use of constants in regex substitutions?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |