my %whitelist; @whitelist{@good_words} = (1) x @good_words;
my %whitelist = map { $_ => 1 } @good_words;
Is a better idiom (IMO, of course), because I hate having to use a declaration followed by an initialisation.
In reply to Re^2: Simple regex to remove all but a list of words
by FunkyMonk
in thread Simple regex to remove all but a list of words
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |