XP is just a number | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi Monks, i'm newly registered but i've been using your site for ages. I write a lot of perl at a very basic level, (I use it for all my "data mining" at work) but i'm trying to improve my knowledge and write more concise, idiomatic code. Anyway, i have an array, passed as reference. I want to make a new array from a slice of the referenced array, which contains only 1s or 0s depending on the value of the referenced array. In other words, i'm doing this:
So if the element of the referenced array, returns as true, i want the new array element to be 1, and 0 if it returns false. Is there a more concise way of doing this? Thanks in advance. In reply to A more concise way to map the contents of an array. by Amblikai
|
|