原文地址: http://blog.csdn.net/johnny710vip/article/details/8905239 这是一篇关于perl脚本测试的总结性文章,其中提到了很多实用的模块,如果文中介绍的不够详细,请到cpan上搜索该模块并查阅其文档. 1基本语法检查 Perl语言的哲学是“There is more than one way to do it”,很多讨厌Perl的人总是拿Perl的这个特性来攻击Perl,而喜欢Perl的人却又极力推崇它.这里不讨论这个特性是好
在perl中,定义一个函数的时候,不需要在圆括号内指定具体的参数,所有的参数都从@_ 这个列表中得到 代码示例: sub test { my ($a, $b) = @_; print qq{$a\t$b\n}; } sub test { my $a = shift; my $b = shift; print qq{$a\t$b\n}; } 这样写当然没有问题,但是有一点不足之处在于,缺少了圆括号内的形参列表,没法直观的一眼看出这个函数需要几个参数 所以perl 中函数定义的时候支持下面这种写法
使用Perl脚本编译Latex 脚本能实现Latex文本的初级编译,并将生成的中间文件移动到同一个目录 调用方法 chmod +x xelatex2pdf.pl xelatex2pdf.pl -n 2 -f test.tex # 将test.tex编译两次 Perl 代码 脚本名:xelatex2pdf.pl #!/usr/bin/perl use strict; use warnings; use File::Path; use File::Copy; use File::Find; use
使用 apt-get 安装软件时,总是出现下面的错误. perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "en_US:", LC_ALL = (unset), LANG = "en_US.UTF-8" are supported and installed on your system. perl: warn