more useful options | |
PerlMonks |
Re: Re: Linked-list Style Data Structureby impossiblerobot (Deacon) |
on Oct 29, 2002 at 18:42 UTC ( [id://208820]=note: print w/replies, xml ) | Need Help?? |
Thanks, Juerd. Unfortunately, the application I am working with already requires knowing both the 'next' and 'previous' views, and I don't have time to completely restructure it at this time. Since this navigation list will be fairly short, and it will only be accessed a few times in each invocation of the script, efficiency probably won't be as much of an issue. However... Modifying my code to use arrays (with constants) was trivial, and it is much faster than using a hash (which will be useful if I need to use this code with longer lists or access it more often). However, iterating over the array each time (even with exiting on a successful match) was slower than building the data structure when accessing it a couple of times. Impossible Robot
In Section
Seekers of Perl Wisdom
|
|