Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: A more concise way to map the contents of an array.

by muba (Priest)
on Dec 30, 2012 at 13:23 UTC ( #1010919=note: print w/replies, xml ) Need Help??


in reply to Re: A more concise way to map the contents of an array.
in thread A more concise way to map the contents of an array.

I don't think it gets much more concise than that. However, yet another way to achieve the same would be

@cell_contents = map { $_ and 1 or 0 } @$array_ref[3..10]

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2017-10-19 05:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (251 votes). Check out past polls.

    Notices?