my $temp_length = @temp; for my $current_array_index ( 1 .. ($temp_length - 1) ){ print DATAFILEOUT $temp[$current_array_index]; }