Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Why Perl boolean expression sometimes treated as lvalue?

by Anonymous Monk
on Feb 08, 2013 at 13:22 UTC ( #1017815=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -MO=Deparse,-p -le " $a= 1 && 2; print $a; "
    BEGIN { $/ = "\n"; $\ = "\n"; }
    ...
    Can't modify logical and (&&) in scalar assignment at -e line 1, near 
    +"3;"
    -e had compilation errors.
    (($a && $b) = 3);
    
  2. or download this
    
    2012         /* FALL THROUGH */
    ...
    2024                         ? "non-lvalue subroutine call"
    2025                         : OP_DESC(o))),
    2026                      type ? PL_op_desc[type] : "local"));
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1017815]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2014-10-23 21:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (129 votes), past polls