While I have no trouble understanding a map in void context, using a map for its side-effects violates my expectations of what map is for.
I think this is the main point where you and I differ. What
makes "map" so holy that it shouldn't be used for side-effects? Who or what started this notion? Not Larry,
otherwise he wouldn't have made $_ an alias for the list
element being processed. Many functions in Perl have side-effects, both user defined and core functions. Why is
it fine to have side-effects in a 'for', but not in a 'map'?
It's not that 'map' is called 'apply_a_function_and_return_a_list_of_calculated_values'.
'map' just means 'map a function over a list' - and I've been familiar with both the name and its function longer
than Perl exists.
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:
Outside of code tags, you may need to use entities for some characters:
- 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
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||