in reply to Non-destructive string substitution
(If I ever get my act together, I hope to implement $bar = $foo =~ s/[ei]/x/gr, but that will modify $foo as well as returning it as $bar.)$ perl -we'$foo = "abcdefghij"; ($bar) = grep s/[ei]/x/g, "$foo"; prin +t $bar' abcdxfghxj
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Non-destructive string substitution
by Anonymous Monk on Dec 08, 2017 at 09:09 UTC |