As Zaxo said, it was never deprecated. However, for years
there was a band of people that never listened to Larry.
Larry said that Perl was there to serve the programmer, and
the programmer should never be a slave to the language. Yet,
this band of people decided programmers should know the
details of the implementation, and should hence know how
inefficient perl handled map in void context (due to the fact
that map, unlike most other functions, didn't inspect in which
context it was running). And this band of people would throw
dirt at any programmer that used map in void context, scolding
them, as if the Perl programmers were guilty of the perl programmers neglect of making map efficiently. (Use of capital and lower case in the previous sentence is very
significant).
There was another round of mud throwing going on on Usenet
last month. It prompted me to followup with the following
(I've responded to the stone throwing similar for years):
Poor style? Why? Return values of print and assignment are usually not
used either, but noone considers that poor style.
The fact that map builds and discards a list when it's used in void
context is a bug in *perl*. It's not poor style of the Perl programmer;
the fault lies with the perl programmers.
But noone has found it seriously enough to provide a patch. For years,
a whole chorus on people in this newsgroup chant "poor style" whenever
someone uses map in void context. But none of those sheep has ever
bothered sending a patch to p5p.
And that triggered Tassilo v. Parseval to write a patch.
It turned out to be a three line patch. Imagine,
all the energy wasted scolding at innocent programmers,
while the fix was relatively easy!
Don't get intimidated to easily when people are chanting
"bad style". Chargo cult chanting is in the Perl world far
more common than cargo cult programming (although many people will easily chant "cargo cult programming"!). Think
for yourself. And people that chant "bad style", think
for yourself too. Don't mindlessly copy the behaviour of
someone who is "famous". That's how religions start. Think
for yourself.
Abigail
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.