my @nums= ( 0 .. 10 ); my @odds= map { $_ % 2 ? $_ : () } @nums; print "@odds"; __END__ 1 3 5 7 9