in reply to Forced resolution of environment variables
"$FRED" only gets expanded if it is in Perl code. It sounds like you have that in data. So post-process your data with:
s/\$([A-Z0-9_]+)/$ENV{$1}/g for $myhash{$mykey}, ...;
(which doesn't require "use Env;" which is something that I would never use -- it sounds rather dangerous in some situations, allowing people to throw in variables not in your control and just to save you from typing 'ENV{' and '}'.)
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Forced resolution of environment variables
by Anonymous Monk on Oct 22, 2004 at 16:36 UTC | |
by sgifford (Prior) on Oct 22, 2004 at 18:10 UTC | |
|
Re^2: Forced resolution of environment variables
by Anonymous Monk on Oct 25, 2004 at 14:18 UTC |