Next Program Repair Shop 72

Boolean Values

     die "File is empty" unless -s $file == 1;    # WRONG
     die "File is empty" unless -s $file;         # right
        if (($foo == 12) == 1) { ... }
        if ((($foo == 12) == 1) == 1) { ... }
        if (((($foo == 12) == 1) == 1) != 0) { ... }


Next Copyright © 2002 M. J. Dominus