Next | Program Repair Shop | 72 |
Testing against 1 is sometimes simply wrong
For example, perlfunc says that -s tests if "File has nonzero size"
die "File is empty" unless -s $file == 1; # WRONG die "File is empty" unless -s $file; # right
It's always silly
if (($foo == 12) == 1) { ... }
continued...
Next | Copyright © 2002 M. J. Dominus |