Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Interesting ... note the parens, perl parses it correctly

$ perl -MO=Deparse,-p -le " $a= 1 && 2; print $a; " BEGIN { $/ = "\n"; $\ = "\n"; } ($a = 2); print($a); -e syntax OK $ perl -MO=Deparse,-p -e " $a && $b = 3; " Can't modify logical and (&&) in scalar assignment at -e line 1, near +"3;" -e had compilation errors. (($a && $b) = 3);

But there is no code to execute this :) its default Can't modify %s

2012 /* FALL THROUGH */ 2013 default: 2014 nomod: 2015 if (flags & OP_LVALUE_NO_CROAK) return NULL; 2016 /* grep, foreach, subcalls, refgen */ 2017 if (type == OP_GREPSTART || type == OP_ENTERSUB 2018 || type == OP_REFGEN || type == OP_LEAVESUBLV) 2019 break; 2020 yyerror(Perl_form(aTHX_ "Can't modify %s in %s", 2021 (o->op_type == OP_NULL && (o->op_flags & OPf +_SPECIAL) 2022 ? "do block" 2023 : (o->op_type == OP_ENTERSUB 2024 ? "non-lvalue subroutine call" 2025 : OP_DESC(o))), 2026 type ? PL_op_desc[type] : "local"));

In reply to Re^2: Why Perl boolean expression sometimes treated as lvalue? by Anonymous Monk
in thread Why Perl boolean expression sometimes treated as lvalue? by vsespb

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (11)
    As of 2018-06-22 12:09 GMT
    Find Nodes?
      Voting Booth?
      Should cpanminus be part of the standard Perl release?

      Results (124 votes). Check out past polls.