Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^?: Think for yourself.

by Aristotle (Chancellor)
on Oct 07, 2003 at 22:59 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-03-29 05:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found