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
in reply to is the use of map in a void context deprecated ?
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