in reply to
Stupid mistakes I repeatedly make
I make way too many typos when writing code, and I'll say that I tend to classify them in the following manner, in no particular order:
Those items completely slip through both use strict; and use warnings;. Take for instance the following:
#@array contains an odd number of values.
my %hash = ( key => @array );
# when you meant to say:
my %hash = ( key => \@array );
my %hash = ( key => [@array] );
This item includes just about any logic error, too.
Those items that generate useful error messages, provided you had both use strict; and use warnings; in place. (too many to list). As things go, I like these, much better than the others.
Those items that generate error messages, even without use strict; or use warnings. Of course, this group should never matter, as there's really no excuse for not using strict and warnings. (when you need to shut a warning off, fine, but just shut off the particular warning you need, in the limited scope that it's needed).
The items that throw errors, but they're either useless errors that you can't easily trace, or they point you to some line number that's functionally useless:Missing right curly or square bracket at line 3281.
Okay, it's not useless, but it's something when the error message tells you something's wrong, but you have to do some real digging 'till you actually find where the problem is, and just what you've managed to do wrong. (this includes any of those error messages where it takes more than 5 minutes to track down just what went wrong).