now what? i tried 'and' instead '&&' and it worked - last wasn't evaluated.
that seems tricky to get right. i still don't understand why 'last' isn't 
always evaluated.

On Thursday, March 14, 2002, at 10:32  AM, bob ackerman wrote:

> confusion i have with comma operator.
> docs seem to indicate it evaluates both sides, but i see examples where 
> it looks like if it evaluates to false on LHS it doesn't evaluate RHS. i 
> see this in examples of writing a case statement.
> $x='b';
> {
> ($x eq 'a') && (print 'a'), last;
> print 'x';
> }
> i see it work sortof sometimes - if $x isn't equal 'a', 'last' isn't 
> evaulated and it prints 'x'.
> shouldn't it also evaluate 'last', whether the LHS of that line is true 
> or not?
> in fact, i just tried it again and this time it didn't work - it 
> evaluated 'last' and didn't print anything.
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to