Problems? Is your data what you think it is? | |
PerlMonks |
Re: Database problem.by pfaut (Priest) |
on Feb 15, 2003 at 14:55 UTC ( [id://235564]=note: print w/replies, xml ) | Need Help?? |
Since the numbers in the left hand column are unique and are the keys to your searches, you could load the data file into a hash instead of an array. Your answer then comes from a direct hash lookup rather than having to search.
Example usage:
Of course, you should add some code to do something sensible if the requested child is not found. Update: You want the full lineage. You could do something like this.
Which produces:
In Section
Seekers of Perl Wisdom
|
|