Syntactic Confectionery Delight | |
PerlMonks |
Re^3: tying a hash from a big dictionaryby repellent (Priest) |
on Nov 02, 2011 at 01:24 UTC ( [id://935261]=note: print w/replies, xml ) | Need Help?? |
I find it convenient to have a single transform sub that produces the key-value pair for the object to search+parse a hash-like dict file. Handling/closing of filehandle is really just cake icing. Search::Dict sets the filehandle position to the first line greater than or equal $key. This seems pretty raw to me (read: that I should probably write some wrapper that takes care of the edge cases). The OO stick is not always the first thing I reach for, in case you're wondering.
In Section
Seekers of Perl Wisdom
|
|