open OUT_A, ">$a_file"; for my $d ( 0 .. $#table_A ) { my $row1 = "@{$table_A[$d]}"; $row1 =~s/\s/\t/g; print "$row1\n"; } close OUT_A ;