Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^?: Think for yourself.

by Aristotle (Chancellor)
on Oct 07, 2003 at 22:59 UTC ( #297421=note: print w/replies, xml ) Need Help??

in reply to Re: Think for yourself.
in thread is the use of map in a void context deprecated ?

IMO the winner is
++$_ for @array;
which reads more naturally than either of your propositions. (Although between the two of yours, I'd prefer the map as well.)
But where is this notion coming from? "map" as an operation that maps a function over all the elements of a list doesn't come from Perl (I've been familiar with the operation and the name even before Larry released Perl 1.000), and its name doesn't suggest anything about return values shall be used.
That's you. Most people don't have such a background. For the majority of Perl programmers it is the first list oriented language they have encountered. So maybe it would be more appropriate to say that you already had a preconception that map in void context is fine, which other people don't come with. It certainly explains why you regard map in void context as a completely normal construct and find the opposition to it exasperating.

Makeshifts last the longest.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://297421]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2018-04-20 09:22 GMT
Find Nodes?
    Voting Booth?