in reply to use of constants in regex substitutions?

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