do not stop the program from running ... fork bomb still happensTrue!
After futher consideration, I came up with many more habits, but few that are akin to the OP. I don't even like it (0 == $foo) myself; I use it in C, but am glad to not need it in Perl.
More of my habits:
Hence I see early that each row is an arrayref (not the expected scalar), even though I only asked for one field in the select. 1 minute of checking my assumptions saved 15 minutes of later debugging.# I want to write this: my @rows = @{ $dbh->selectall_arrayref($sql) }; # Instead, I always write this, and remove the dump # after verifying the data and its format: my $rows_aref = $dbh->selectall_arrayref($sql) or die; print Dumper $rows_aref; my @rows = @{$rows_aref};
In reply to Re^3: What habits do you have to avoid introducing bugs?
by Util
in thread What habits do you have to avoid introducing bugs?
by superfrink
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |