Change

> { my @dictionary = do {
>     open my $D, "</usr/share/dict/words"
>       or die "Couldn't open words file: $!\n";
>     <$D>;
>   };
>
>   shift @dictionary;
>   chomp @dictionary;
>
>   @dictionary{ @dictionary } = ( 0 ) x @dictionary;
> };

to

{ open my $D, "</usr/share/dict/words"
    or die "Couldn't open words file: $!\n";

  %dictionary = map { chomp ; ( $_, 0 ) } grep { ! /^\s*$/ } <$D>;
};
--
Alan

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to