in reply to Efficient programming
Ah, grasshopper, you seek knowledge, but the time is not yet right to reveal this to you. First, you must learn patience!
Meditate upon this now..
Update: I should explain this comment: I believe all programmers seek to write the most optimal code, it is utopia! But it is a quest that takes us our natural lives and enlightenment comes with study and practice. The question being asked, i.e. how to do this in Perl, can be partially answered by learning any computer language (as others have mentioned below about gaining wisdom of algorithms and such). And specific understanding of efficiency in Perl can be gained by studying and utilising Perl itself - there are many such routes, including reading the Camel book, reading much of PerlMonks, and studying the source code of Perl itself!
And so patience is required because the road is long.. take some initial steps and read as much as you can.