And the output is -my $str = "florence, defense"; $str =~ s/n(c|s)e/$1 eq 'c'?'nse':'nce'/ge; print "$str\n";
which is just as expected.florense, defence
In reply to Re: Search and replace logic
by Roger
in thread Search and replace logic
by carric
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |