update: added a /g to the s///my @data = <DATA>; my @swap = qw/nce nse/; my %replace = ( @swap, reverse @swap ); my $search_for = join('|', keys %replace); s/($search_for)/$replace{lc $1}/gi foreach @data; __DATA__ incense license luminance
In reply to Re: Search and replace logic
by cleverett
in thread Search and replace logic
by carric
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |