if ( $x ) { print 1; } else { print 0; }
What you are really getting is:
if ( $x or print 0 ) { print 1; }
Thus when $x is false, 'print 0' is executed, and then, since the print() returns true, the if-then body is carried out.
In reply to Re: Weird syntax question
by Anonymous Monk
in thread Weird syntax question
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |