Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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.


Comment on Re^?: Think for yourself.
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://297421]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (12)
As of 2014-10-23 12:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (125 votes), past polls