Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2016-08-31 23:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (436 votes). Check out past polls.