Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Comment on

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

Seven years later I come to this thread and wonder why what you said here got no real attention.

And seven years later, I still agree with (nearly) everything I myself said in this thread.

Pedantry be damned. It's nice enough ammo for meaningless flame wars on sites like this one but when people are actually working together on a common goal and not pulling out their micrometers for a geek pecker measuring contest, I've learned that many of them are too smart to bother being pedantic.

Thank heavens for that.

Anyway, I'm still saying "returns an array" and everything is moving along as smooth as I might hope. Turns out that telling people what I am doing works just fine. (They've already learned what Perl does.)

And here was the crux of it all along. When I return an array (sub foo { @a = qw/2 4 6 8/ }) it simply doesn't behave the same as when I return a list (sub bar { qw/2 4 6 8/ }). Go figure. And with my convenient shorthand, I don't have to explain about this context or that one and get into petty details unless I'm doing something strange. Like using wantarray.

Makes you wonder if Perl was slapped together by a some crazy linguist or something.

"My two cents aren't worth a dime.";

In reply to Re^4: What should be returned in scalar context? (best practice) by sauoq
in thread What should be returned in scalar context? by tilly

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 romping around the Monastery: (4)
    As of 2018-02-25 01:02 GMT
    Find Nodes?
      Voting Booth?
      When it is dark outside I am happiest to see ...

      Results (312 votes). Check out past polls.