$string = join '', 'a'..'z'; @find = 'a'..'g'; @change = 'h'..'m'; foreach $i (0..$#find) { $string =~ s/$find[$i]/$change[$i]/g; }
Update: left off the /g
-QM
--
Quantum Mechanics: The dreams stuff is made of
In reply to Re: Regular Expression Loop Hell
by QM
in thread Regular Expression Loop Hell
by pjnet
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |