in reply to Logical Not not working!!!
Why do you expect zero specifically?
The false value typically returned by Perl is a special value that's "" when treated as a string and 0 when treated as a number.
$ perl -wle'my $x = !1; print "".$x; print 0+$x;' 0 $ perl -wle'my $x = ""; print "".$x; print 0+$x;' Argument "" isn't numeric in addition (+) at -e line 1. 0 $ perl -wle'my $x = 0; print "".$x; print 0+$x;' 0 0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Logical Not not working!!!
by baski (Novice) on Aug 20, 2010 at 21:49 UTC | |
by ikegami (Patriarch) on Aug 20, 2010 at 22:50 UTC |