my $num = 1; print map { $num++, " $_" } @myArray; #### foreach my $i (0..$#chunk) { print TO_WRITE $chunk[$i] unless $i == $number; }