Current results of "dictionary word count" programs...

Alan Young alansyoungiii at gmail.com
Wed Mar 15 11:46:40 MST 2006


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



More information about the PLUG mailing list