将MySQL表转储到Perl文件的最佳方法是什么?
我一直在用:
open( FILE, ">$filename" );
my $sth=$dbh->prepare("select * from table");
$sth->execute();
while ( my $row = $sth->fetchrow_arrayref ) {
print FILE join( "|", @$row ), "\n";
}
Run Code Online (Sandbox Code Playgroud)