in reply to Digging interpolation deeper

You could use a regexp to parse it, like
s/(\$\w+)\b/$1/gee