@output = @input[ grep $_ & 1, 0 .. $#input];
($mod, $val) = (2, 1); @output = @input[ grep $_ % $mod == $val, 0 .. $#input];
In reply to Re^2: Get even postion elements in an array
by happy.barney
in thread Get even postion elements in an array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |