@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. ;-)
In reply to Re: Get even postion elements in an array
by pKai
in thread Get even postion elements in an array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |