Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Get even postion elements in an array

by pKai (Priest)
on Nov 16, 2010 at 16:16 UTC ( #871771=note: print w/ replies, xml ) Need Help??


in reply to Get even postion elements in an array

@output = grep $|--, @input;

using some magic of $| for the flipflop.

But unless you use it for a real oneliner, use some less obscure formulation of the principal shown in previous replies. ;-)


Comment on Re: Get even postion elements in an array
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (11)
As of 2015-07-07 11:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (88 votes), past polls