in reply to Re^2: Logical expression evaluation
in thread Logical expression evaluation
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Logical expression evaluation (dualvar)
by bart (Canon) on Jul 27, 2005 at 21:07 UTC |