in reply to Basic String Substitution

That's a terrible node title. Help will come when it does, and "Help?" says nothing about what you're asking.

my $filename = "/wek/hep/bin/defaults.import"; $filename =~ s/(defaults)(\.import)/$1$ENV{APPL_ENV}$2/;

Note, environment variables are considered tainted data by taint mode, and using raw, unchecked ENV data in a filename can be risky.


Dave

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.