随笔分类 -  Perl

摘要:1、Perl的4种变量Scalar:$纯变量,标量数组:@Hash:%文件:大写2、Perl变量的组成简单变量以$开头,+字符或者下划线字母,数字,下划线区分大小写 $var $VAR $Var变来那个长度不限$this_is_a_really_long_but_legal_name_that_is_different没有关键字,但是不要和内置变量重复$if可以 $_重复1、整数的表示1212e2(1200) e不分大小写-121_200_0000012 八进制数,值为100x1f 十六进制数,值为31 f不区分大小写#!/usr/bin/perl$int=1_200_000;print &q 阅读全文
posted @ 2013-06-26 00:05 ArcerZhang 阅读(405) 评论(0) 推荐(0) 编辑
摘要:Unix manual pages(online documentation):man perlhttp://www.perl.orghttp://www.perl.comhttp://www.cpan.orghttp://www.activestate.comhttp://www.oreilly.com 阅读全文
posted @ 2013-06-23 14:18 ArcerZhang 阅读(119) 评论(0) 推荐(0) 编辑
摘要:1、连接数据库#!/usr/bin/perluse strict;use DBI;my $tnsname = "DB234";my $username = "SCOTT";my $password = "TIGER";my $dbh = DBI->connect("dbi:Oracle:$tnsname",$username,$password) or die "Cannot connect db : $DBI::errstr\n";print "I have connect t 阅读全文
posted @ 2013-06-23 14:15 ArcerZhang 阅读(1061) 评论(0) 推荐(0) 编辑
摘要:1、安装之前,先检查一下当前系统中Perl的版本[root@arcerzhang ~]# perl -vThis is perl, v5.10.1 (*) built for x86_64-linux-thread-multiCopyright 1987-2009, Larry WallPerl may be copied only under the terms of either the Artistic License or theGNU General Public License, which may be found in the Perl 5 source kit.Complet 阅读全文
posted @ 2013-06-23 13:36 ArcerZhang 阅读(3591) 评论(1) 推荐(1) 编辑
摘要:Here is some pretty good code piece to check it:#!/usr/bin/perluse strict;use ExtUtils::Installed;my $inst=ExtUtils::Installed->new();my @modules = $inst->modules();foreach(@modules){ my $ver = $inst->version($_) || "???"; printf("%-12s -- %s\n",$_,$ver);}exit;View Code 阅读全文
posted @ 2013-06-23 11:30 ArcerZhang 阅读(148) 评论(0) 推荐(0) 编辑
摘要:1、pathon、ruby、perl的使用场景pason,ruby更适合web开发perl适合文本处理2、系统中查看perl版本信息[root@arcerzhang perl]# perl -vThis is perl, v5.10.1 (*) built for x86_64-linux-thread-multiCopyright 1987-2009, Larry WallPerl may be copied only under the terms of either the Artistic License or theGNU General Public License, which 阅读全文
posted @ 2013-03-25 22:25 ArcerZhang 阅读(135) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示