in reply to Things learned from Perl Monks

I certainly agree with using warnings and strict. Hell, nowadays I sometimes even catch myself using them in one-liners! ;-)

A couple of other things that help both newbies and the experienced to catch more errors, are:

1) Always return filenames and errors and die or warn when system operations fail ,i.e.:
open IN, $in or die "Cannot open $in:$!\n";

2) Always give your variables meaningful names. Always. If you can't, you don't understand the function of the variable well enough to be allowed to use it. This of course, applies equally to subroutines. A variable named $foo or $x in code over 10 lines in length is usually the sign of crap code.

3) Code is for humans to read. The fact that it is read by a machine as well is incidental. Always code with the thought in mind that someone else will maintain your program in the future. How I have cursed people in the past who failed to do this.

Regards,
Helgi Briem