The stupid question is the question not asked | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
You're kind of getting off into the weeds now and there's probably not going to be an off the shelf module to do what you're wanting. The (naïve, obvious) solution would be to round trip things through a shell, but that's going to have security implications.
The safer alternative is going to be walking over your strings and using something like s{\$(?: \{? (\S+) \}? )}{$ENV{$1} // qq{UNDEF:$1}}xge; to expand things yourself. Edit: Obviously that's an imprecise regexp and to be more bulletproof you'd want to use Regexp::Common and be fancier pulling any curly wrapped bit(s) out with something like qr/\$ ($RE{balanced}{-parens=>q{{}}}) / and then working with that instead.
The cake is a lie. In reply to Re: rel2abs of a path with env
by Fletch
|
|