DBM::Deep is an ideal solution for this problem. Building the DBM file might take a little time, but lookups would be pretty quick. And, it's about as simple an implementation as you could want.
my $db = DBM::Deep->new( $filename );
print "$db->{32}\n"; # prints 14456
My criteria for good software:
- Does it work?
- Can someone else come in, make a change, and be reasonably certain no bugs were introduced?