Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 examining the Monastery: (13)
As of 2015-07-29 22:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls