in reply to Re: setting perl ENV from file
in thread setting perl ENV from file

Assuming you have gotten $key and $value from the file, you could:
$value =~ s((\$\{(\w+)\}|\$(\w+))) ($ENV{$2} or $ENV{$3} or $1)eg;
This would support an input file with two possible interpolations:
key1=value key2=value$key1 key3=${key1}value
It depends on the order of definition. You could iterate the replacement step across all strings until the keys stop changing, but that may raise new problems.

--
[ e d @ h a l l e y . c c ]