in reply to Re: Parsing variables from login scripts
in thread Parsing variables from login scripts

Shell-style variable interpolation has been discussed in recent nodes. The one you have above won't work at all like you seem to expect.

PATH = /someplace PATH = $PATH:/somewhere/else
In this case, $env_var{PATH} would equal ":/somewhere/else/someplace".

I'm afraid I can't find the original thread, but a fairly robust regular expression looked something like this:

$value =~ s/$({?)(\w+)(?(1)})/$env_var{$2}/eg;
This would interpolate stuff like $PATH, ${PATH}, etc.