in reply to Little annoying mistakes ... of others
A pretty common logic error is forgetting to explicitly check all expected values against the variable:
use strict; use warnings; my $foo = 'boo'; if ($foo eq 'goo' || 'moo') { print "$foo\n"; }
when this is really desired:
if ($foo eq 'goo' || $foo eq 'moo') {
Obviously, this is not unique to Perl, but I do see it quite often.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Little annoying mistakes ... of others
by jeffa (Bishop) on Dec 07, 2008 at 16:06 UTC | |
by szabgab (Priest) on Dec 28, 2008 at 19:26 UTC | |
by jeffa (Bishop) on Dec 29, 2008 at 14:16 UTC | |
Re^2: Little annoying mistakes ... of others
by szabgab (Priest) on Dec 07, 2008 at 04:39 UTC | |
Re^2: Little annoying mistakes ... of others
by parv (Parson) on Dec 07, 2008 at 11:44 UTC | |
by szabgab (Priest) on Dec 10, 2008 at 07:03 UTC |
In Section
Meditations