Perl学习环境的搭建
1.目录
1.1 Perl模块安装
安装好了 需要用Perl命令调一下
1.2
使用集成的工具进行开发
国外的优秀软件可以写 perl,python,ruby 等等是集成的工具
调用相关的命令
输出打印的信息
中文的相关设置
C:\Perl64\site\bin;C:\Perl64\bin;C:\app\Administrator\product\11.2.0\dbhome_2\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Oracle\Instant Client\bin
环境相关变量
下面是测试程序
#!/usr/bin/perl -w
use strict;
use warnings;
use DBI;
my $dbname="orcl";
my $user="huangxin";
my $passwd="qq123456";
my $dbh="";
#$dbh = DBI->connect('dbi:Oracle:',q{system/[email protected](DESCRIPTION =
# (ADDRESS = (PROTOCOL = TCP)(HOST = WCNXL186023-5HH)(PORT = 1521))
# (CONNECT_DATA =
# (SERVER = DEDICATED)
# (SERVICE_NAME = orcl.TD.TERADATA.COM)
# )},"");
$dbh=DBI->connect("dbi:Oracle:localhost/orcl",$user,$passwd)
or die "can't connect to database ". DBI->errstr;
#
my $sth=$dbh->prepare("select * from emp");
$sth->execute;
while (my @recs=$sth->fetchrow_array)
{
print $recs[0].":".$recs[1]."\n";
}
$dbh->disconnect;
成功部分的截屏