unbalance (LHS)=RHS [wasRe: SPUG: 0 == undef]

John W. Krahn krahnj at acm.org
Wed Apr 7 16:18:21 CDT 2004


On Wednesday 07 April 2004 13:29, Michael R. Wolf wrote:
>
> As proven by perl -MO=Deparse
> - syntax OK
> my($Test1, $Test2) = 17, '???';
> print "$Test1\n";
> print "$Test2\n";
>
> The 99 is just the RHS of the (sparsely used) binary comma operator,
> which evaluates the left side, then evaluates the right side, and
> yeilds a the RHS.
>
> Therefore, the expression evaluates to 99, which isn't used.

You will notice that in the B::Deparse output that 99 does not appear.  
In scalar context it would return 99, not in list context.


John
-- 
use Perl;
program
fulfillment




More information about the spug-list mailing list