Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
But, if I can quote from Donald_Knuth "Premature optimization is the root of all evil." You need to profile the real code to find out where the bottleneck is, As BrowserUK points out the time to read the file swamps any sort of improvement you might make. Using a hash as a default option is still probably the right one, it's simple, understandable and works when your data is strings, or dates or anything else. An array on the other hand can only be used when your data is an integer, and you know that the range of the data is small. So in this very specific case a array will be better but not in the general case. Thanks for the interesting post, but to answer your question -- NO it's not! :) In reply to Re: "Just use a hash": An overworked mantra?
by RichardK
|
|