in reply to Re: Simple regex to remove all but a list of words
in thread Simple regex to remove all but a list of words
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Simple regex to remove all but a list of words
by moritz (Cardinal) on Jun 04, 2008 at 22:16 UTC |