Perl Best Practices
From: Daniel Engel
Date: October 2005
I wish I had read Perl Best Practices by Damian Conway when I first
learned Perl. It is pretty difficult to break old habits, but it it well
worth it if the result is to "produce code that is clear, robust,
efficient, maintainable, and concise".
O'Reilly once again brings us a very useful book, and this one in
particular would make a great addition to any technical collection you
might have. For Perl can be very forgiving when it comes to code
interpretation. It is up to the coder to make sure such code is
maintainable in the best possible way.
Maintainability is the key to healthy software. Most, if not all,
software is bound to have limitations, defects, and other related
issues. There is always room for improvement. Improving any software can
be accomplished much easier if the source code is readable and
That's where Perl Best Practices shines. The author covers some 19
chapters, ranging from Code Layout to Testing and Debugging. He focuses
on the emphasis of mostly "common sense" standards to achieve truly
artful source code. I was very receptive to his Code Layout and Naming
Convention chapters, it clearly makes a big difference in the code
itself. I experimented with minor alterations to his proposed standard,
and I always came back to "fix it" the way he postulates.
Even further than that... the principles in this book could be applied
to pretty much any other programming language. Albeit syntax and
semantic differences would require some adjustments. Nonetheless, the
principles are very portable.
Some parts of the book require you to be experienced with Perl, and
offers just a brief innuendo for the less experienced audience. However,
the book is very thorough and easy to read. Most important concepts and
tidbits are well stressed making skimming through the book a breeze.
Some areas required more attention than others to make an impression.
So, why do I wish I had read this book before? For once, I have a
bucket-full of hardly readable, and unmaintainable Perl scripts
scattered around. The main focus on learning how to program is... well,
programming. There is very little emphasis on how to do it properly.
Pretty code is not high up in the priority list when you have a due date
to have it done by. You must look at it as an investment.
Would I go back and "fix" my old scripts? Unlikely. Will I employ these
Best Practices in future scripts? You bet!
Time-stamp: "2005-10-27 11:04:32 raleigh"