in reply to Never guess at code!

The way I think about this is "never fly any higher than you are willing to fall." As you write the code, you should be asking yourself, "how will I know that this line of code is working?" Maybe you should put in a print statement, or maybe you'll check values in a debugger. Another trick is to use assertions, such as:
($loop_count > 0) or die "Loop counter: `$loop_count' value non-positi +ve";<P>

Watching other people code, especially someone who is very good, is educational, and can be fun. I picked up a few good habits by watching a "Perl Death Match," which involves watching people code as they compete.

It should work perfectly the first time! - toma