#!perl use strict; use warnings; my @foo = (0..9); for (reverse(0..$#foo)) { splice @foo, $_, 1 if $_ % 2; } print join ' ', @foo;