Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Get even postion elements in an array

by Anonymous Monk
on Oct 20, 2016 at 01:25 UTC ( [id://1174331]=note: print w/replies, xml ) Need Help??


in reply to Re: Get even postion elements in an array
in thread Get even postion elements in an array

$ perl -e 'my @a=(2, 3, 4, 5, 1, 7); print ("==> ", (map{$_ % 2 ? (): +" $a[$_]"} 0..$#a), "\n");' ==> 2 4 1

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2024-04-16 09:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found