my @data = ('','','','',''); #### open STDOUT, ">>", "$output0" or die "$output0: $!\n"; foreach (@list) { ... print STDOUT, @data; } close STDOUT;