Perl连接Mysql

来源:互联网 发布:unity3d webplayer 编辑:程序博客网 时间:2024/06/06 10:38
use DBI;$user="root";$password="";$database="a1121134327";     #数据库my $dbh = DBI->connect("DBI:mysql:$database;host=localhost", $user, $password) or die "无法连接数据库: " . DBI->errstr;$dbh->do("SET NAMES 'gbk'");#执行查询语句$glob="f:\\cardinfo\\*.txt";@files=glob($glob);#返回所有TXT文件foreach  (@files) {print "$_\n";if (-s $_) {/#判断文件存在并且大小不为0}}
原创粉丝点击