for my $i (0..$#array) { print $array[$i]; print "\n" if $i % 2 == 0; }