bool

Warning: Creating default object from empty value in taxonomy_term_page() (line 33 of /var/www/clients/client1/web31/web/modules/taxonomy/taxonomy.pages.inc).

How to use boolean variables (true and false) in Perl

I was quite disappointed when I realized, that boolean variables (true and false) are not allowed in Perl. I figured out a workaround which is quite pretty useful.

use constant {
  false => 0,
  true => 1
};

Use it:

$myVariable = true;

if ( $myVariable == true ) {
  # stuff
}
Syndicate content