Help for this page
$bad_words = array('ugly', 'anotherugly'); $good_words = array('ug**','anot******y'); $txt = 'ugly anotherugly'; $txt str_replace($bad_words, $good_words, $txt);
#!/usr/bin/perl use warnings; ... my $txt = "ugly anotherugly"; $txt =~ s/$_/$words{$_}/g foreach %words; print $txt;