Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
No, it returns the value of the last expression, evaluated in the context the function was called in.
I know that, you know that, most of the others know that. Where's the problem?For me, a list(!) of scalars with the comma operator in between is a list. In english. To say that my example sub returns a list (I could even say here *every* sub returns a list) isn't saying anything wrong. If there is no list at all in perl, then it's clear I mean the english wort list. In my example I could also say three scalars.

The point I want to make is whenever someone explains a piece of code with "list in scalar context" then you can be sure somebody who has too much time will correct them. But they didn't have the time to explain the piece of code in the first place. When you're talking about code, do you always use that long definition with the comma operator? If there is no list in perl, do you really *never* use this word when talking about code? Come on. I want to know what's wrong with using that word when explaining others the behavior of a piece of code. Didn't you get my point about code vs. execution?

edit: or maybe your suggestion is, never use the word list, but use comma operator. I'm not sure if it's the right thing to always say "sub x returns the comma operator" when a) a list is a word that everybody understands and b) a list is used as a synonym for comma operator, so it doesn't say anything wrong. Couldn't we just say that? I never see where the explanation "list in scalar context" is saying anything that is not true.


In reply to Re^3: If you believe in Lists in Scalar Context, Clap your Hands by tinita
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 lurking in the Monastery: (8)
    As of 2014-10-22 00:38 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      For retirement, I am banking on:










      Results (112 votes), past polls