#method 1: Perl will iterate over the array, so we just #increment the counter at each write $worksheet->write_string($row, $col++, $_) for @Fld; #method 2: If you need a loop (so you can do something #else in the code, too), you can do it like: for my $item (@Fld) { $worksheet->write_string($row, $col++, $item); # do something else here... } #method 3: If you don't mind destroying the @Fld array, #you could also: while (my $item = shift @Fld) { $worksheet->write_string($row, $col++, $item); # do something else here... }