map{} is a wrong idea if the output isn't being used.
Why? We use functions and operators without using their output all the time (print for instance). What makes map special that's not using its return value is a sin?
I didn't know about that. When did this performance enhancement happen?
6 years ago (5.8.1). After many years of people using the performance penalty of map-in-void-context as an argument not to use map in void context, someone actually produced a one line patch to eliminate that. Didn't stop people from ranting against using map-in-void-context though. Didn't even stop people using the performance argument either.

Besides, wasn't it Larry himself who said that using things in other ways than originally intended isn't bad in itself? That one can enjoy sex, even if you aren't using it to reproduce yourself?


In reply to Re^4: Map Vs Foreach by JavaFan
in thread Map Vs Foreach by perlCrazy

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!
  • 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, details, 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, summary, 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.