# build_db.pl - used to update the word list database #!/usr/bin/perl use strict; use warnings; use Storable; my (%dict, %seen); open(my $fh, '<', 'all_words.txt') or die $!; while (<$fh>) { tr/\r\n//d; $_ = lc($_); next if /[^a-z]/ || length($_) < 3 || $seen{$_}++; eval join '', 'push @{$dict', (map {"{$_}"} split //, $_), "{words}}, +'$_';"; } store \%dict, 'my_dict.db';