Hidden underneath, constants are subs. That means they are not evaluated in quoted context without some intervention. The "@{[]}" and "${\}" tricks are good for that. That applies to the left(regex) argument of s///.
To get the constant to evaluate on the right (string) side, you need to use the /e flag. $s1 =~ s/${\TXT_EXTENSION}/MIF_EXTENSION/e;
After Compline,
Zaxo
In reply to Re: use of constants in regex substitutions?
by Zaxo
in thread use of constants in regex substitutions?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |