open my $out, ">", "D:\\SQL_INHALT.txt" or die $!; while ( my @row = $sth->fetchrow_array ) { print $out join ";", @row; } close $out;