use DB_File;
use strict;

tie my(%db), "DB_File", "phone_words.db", O_RDWR|O_CREAT, 0666, $DB_HASH;

my @nums  = split "", '22233344455566677778889999';
my @chars = 'A' .. 'Z';
my %lookup = map { shift @chars, shift @nums } 1 .. @chars;

while (<>) {
    chomp;
    my $word = uc $_;
    s/(\w)/$lookup{uc $1}/gos;
    $db{$_} = ($db{$_} || "") . $word;
    warn "$_ $word\n";
}

