Wrong. Perl false is !1. (PL_sv_no in the C source) It's a dualvar with a string value of "" and a numerical value of 0.
See: Re^4: m//g behaves strange... (!1). And this snippet:
$ perl -lwe 'for (qw/undef 0 "" !1 1==2/) { print "\n\$a = eval $_;"; +$a = eval $_; print "$_:\t|$a|", 1+$a; }' $a = eval undef; Use of uninitialized value in concatenation (.) or string at -e line 1 +. Use of uninitialized value in addition (+) at -e line 1. undef: ||1 $a = eval 0; 0: |0|1 $a = eval ""; Argument "" isn't numeric in addition (+) at -e line 1. "": ||1 $a = eval !1; !1: ||1 $a = eval 1==2; 1==2: ||1
In reply to Re: Logical expression evaluation
by benizi
in thread Logical expression evaluation
by nghosh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |