note
toolic
A pretty common logic error is forgetting to explicitly check all expected values against the variable:
<c>
use strict;
use warnings;
my $foo = 'boo';
if ($foo eq 'goo' || 'moo') {
print "$foo\n";
}
</c>
<p>when this is really desired:
<c>
if ($foo eq 'goo' || $foo eq 'moo') {
</c>
<p>Obviously, this is not unique to Perl, but I do see it quite often.
728569
728569