Chinaunix首页 | 论坛 | 博客
  • 博客访问: 466677
  • 博文数量: 279
  • 博客积分: 4467
  • 博客等级: 上校
  • 技术积分: 2830
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-03 14:43
文章分类

全部博文(279)

文章存档

2013年(1)

2012年(39)

2011年(35)

2009年(29)

2008年(131)

2007年(44)

分类:

2008-01-22 17:22:50

 DBI, connect(), prepare(), execute(), fetchrow_array()

#!/usr/bin/perl

use strict;

use DBI;



my $dbh = DBI->;connect("dbi:mysql:dbname", 'user','passwd', '')

or die "can't connect!\n";

my $sql = qq/show variables/; 

my $sth = $dbh->;prepare($sql);

$sth->;execute(); 



while(my @array=$sth->;fetchrow_array())

{

printf("%-35s", $_) foreach(@array);

print "\n";

}

$dbh ->; disconnect();

exit 0;

阅读(386) | 评论(0) | 转发(0) |
0

上一篇:Net::Telnet;

下一篇:File::Find, find()

给主人留下些什么吧!~~