in reply to C++ style boolean type in Perl?
If you really feel the need for 'true' and 'false', then please make this compromise with me:if (foo()) { foo() returned a true value } if (!bar()) { bar() returned a false value } $DEBUG = 1; if ($DEBUG) { ... }
Please do NOT test for equality with TRUE or equality with FALSE. They are pointless test, and broken in cases of TRUE that aren't '1'.use constant TRUE => 1; use constant FALSE => 0; # ... $DEBUG = TRUE; # ... if ($DEBUG) { ... }
|
|---|