2012年4月26日

perl-CGI

摘要: 你会写ASP的话,那就试试Mason。apache编译进mason处理器,也跟IIS + ASP一样,放上去就能运行。最简单的是CGI,放在apache的cgi-bin目录,什么都不用配置就可以运行。第一个CGI脚本:#!/usr/bin/perluse strict;use CGI;my $q=CGI->new;print $q->header;print "Hello world";复制代码上述脚本存成a.pl,放在cgi-bin目录,设置可执行chmod +x a.pl,然后从浏览器访问:http://xx.xx.xx.xx/cgi-bin/a.pl输出H 阅读全文

posted @ 2012-04-26 23:24 perlman 阅读(280) 评论(0) 推荐(0) 编辑

tr

摘要: see codes belowmy $str = 'abc';my $count = ( $str =~ tr/a-z/A-Z/ );print $count, "\n"; # How many chars were traslate: 3print $str, "\n"; # The traslated string: ABC== 阅读全文

posted @ 2012-04-26 10:47 perlman 阅读(200) 评论(0) 推荐(0) 编辑

插入文件到代码中

摘要: iab papp <Esc>:r ~/Perl/test.pl<CR><Up>dd<Esc>进入命令模式:r ~/Perl/test.pl<CR> 插入test.pl中的代码到当前光标处<Up>dd,上移光标并删除一行,前一条命令会产生一个空行 阅读全文

posted @ 2012-04-26 09:47 perlman 阅读(340) 评论(0) 推荐(0) 编辑

导航