use strict; my $z = 0; for (my $d=1; $d < 10; $d++) { $z++; if ($z==1) { print $headers, "\n"; } else { print $body, "\n"; } }