in reply to Forced resolution of environment variables

That's because you never pass the string through perl so there's no way it could interpolate it. You'd want to use eval or s///e, but if you don't trust your input you'd want to be careful doing that. You might also check out a module like AppConfig which gives you a config file parser which will do this sort of interpolation to some degree.