in reply to Simple things should be coded simply (Re: Idiomatic Array Index Search?)
in thread Idiomatic Array Index Search?
So maybe you should return an array, sorted of course.
Then may I propose the most idiomatic would be to use another language, SQL of course? I am thinking of DBD::RAM. You could say something like
print $dbh->selectcol_arrayref(qq [ SELECT phrase FROM my_phrases WHERE id = 1 ORDER BY phrase ])->[0];
Some other neat looking modules may include Search::InvertedIndex, Search::Binary, and Math::IntervalSearch (Search where an element lies in a list of sorted elements).
..to answer japhy and merlyn below, honored to join this thread with you both. To be sure, grep is good. Thank you for your elegant code.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Simple things should be coded simply (Re: Idiomatic Array Index Search?)
by japhy (Canon) on May 28, 2001 at 19:21 UTC |