in reply to s// with e option : evaluate, quote, evaluate
I need to replace this list with a list of "features" of those names, that come as the output of a function
Then you need map, not grep. However, s/// doesn't play well with either unless precautions are taken, so it's simpler to use for here.
my @newlist = @oldlist; s{(\d+-PVC_\d+)}{ function1($1) . '/' . function2($1) }e for @newlist;
You were clobbering @oldlist.
|
|---|