Help for this page

Select Code to Download


  1. or download this
    my @zeroes = qw( zero 0ButTrue 00 ); 
    
    ...
        print "'$z' ", $z == 0 ? 'is ' : 'is not ', "equal to zero.\n";
        print "'$z' ", $z ? 'is ' : 'is not ', "true.\n\n";
    }
    
  2. or download this
    package C; 
    use overload 'bool' => sub { 0 };
    ...
    
    print "\$c is not equal to zero.\n" unless $c == 0; 
    print "\$c is not true.\n"          unless $c;