(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
In reply to Re: Non-destructive string substitution
by ysth
in thread Non-destructive string substitution
by Sprad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |