http://qs1969.pair.com?node_id=309076


in reply to A (memory) poor man's <strike>hash</strike> lookup table.

For another approach, look at Tie::SubstrHash. You'd have to recast your problem as keys of constant length though. Still, it'd be interesting to see a timing comparison.