Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Comment on

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

Lists cannot be lvalues, though you may have a list of lvalues...

Say again? An lvalue list returns a list of lvalues and enforces list context, just like an rvalue list returns a list of rvalues in list context.

In both of the following snippets, you'll see an list as an lvalue ("M" flag).

>perl -MO=Concise -e"($a,$b)=(4,5)" a <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 1 -e:1) v ->3 9 <2> aassign[t3] vKS ->a - <1> ex-list lKP ->6 <-- RHS list 3 <0> pushmark s ->4 4 <$> const[IV 4] s ->5 5 <$> const[IV 5] s ->6 - <1> ex-list lKPRM* ->9 <-- LHS list w/ "M" 6 <0> pushmark sRM* ->7 - <1> ex-rv2sv sKRM*/1 ->8 7 <#> gvsv[*a] s ->8 - <1> ex-rv2sv sKRM*/1 ->- 8 <#> gvsv[*b] s ->9 -e syntax OK
>perl -MO=Concise -e"1 for ($a,$b)" d <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 1 -e:1) v ->3 3 <;> nextstate(main 1 -e:1) v ->4 c <2> leaveloop vK/2 ->d 8 <{> enteriter(next->9 last->c redo->9) lK/8 ->a - <0> ex-pushmark s ->4 - <1> ex-list lKPM ->7 <-- lvalue list 4 <0> pushmark sM ->5 - <1> ex-rv2sv sKM/1 ->6 5 <#> gvsv[*a] s ->6 - <1> ex-rv2sv sKM/1 ->- 6 <#> gvsv[*b] s ->7 7 <#> gv[*_] s ->8 - <1> null vK/1 ->c b <|> and(other->9) vK/1 ->c a <0> iter s ->b - <@> lineseq vK ->- - <0> ex-const v ->9 9 <0> unstack v ->a -e syntax OK

In reply to Re^3: If you believe in Lists in Scalar Context, Clap your Hands by ikegami
in thread If you believe in Lists in Scalar Context, Clap your Hands by oshalla

Title:
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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others drinking their drinks and smoking their pipes about the Monastery: (8)
    As of 2014-10-01 07:45 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (389 votes), past polls