in reply to String Interpolation on single quote string?
Or even the following, if you don't mind breaking some rules:$ENV{VARIABLE} = '/base/path'; $_ = '$ENV{VARIABLE}/my/path'; s/\$ENV\{(\w+?)\}/$ENV{$1}/g; print;
$ENV{VARIABLE} = '/base/path'; $path = 'path'; $_ = '$ENV{VARIABLE}/my/$path'; s/\$(\w+)\{(\w+?)\}/${$1}{$2}/g; s/\$(\w+)/${$1}/g; print;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: String Interpolation on single quote string?
by cjbailey1 (Initiate) on May 19, 2005 at 10:22 UTC |