I should have used $2 instead. But I don't think this is a problem. You just have to remember to add 1 to your $n.
Otherwise you could go the $&-way:
s/$profanity/eval '"'.$profane{$&}.'"'/ge;
In reply to Re: Re: Re: Turn Hate Mail to Love Letter: Regex Multi-Word/Phase Replace
by Skeeve
in thread Turn Hate Mail to Love Letter: Regex Multi-Word/Phase Replace
by chunlou
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |