Category: InstallNote Keywords: PerlTidy
Perltidy is a tool to indent and reformat perl scripts. It can also write scripts in html format.Homepage:http://perltidy.sourceforge.net
Install
download PerlTidy-20031021,perl Makefile.PL (n)make test (n)make install如果(n)make不成功的话,可以如下:
- 将lib目录中的Perl/Tidy.pm copy to $Perl/site/lib, 将bin目录下的perltidy copy to $Perl/lib. run
$Perl\bin>perl perltidy testfile.pl
- 查看 pm2pl 文件,发现此程序将Tidy.pm与perltidy合并为一个新的 perltidy - Perl 文件
>perl pm2pl testfile.pl
Usage
perltidy -html testfile.pl此命令可生成已着色的HTML文件。
虽然颜色可能不是很让人满意,但可以改其中的CSS style或通过增加-css=mystyle.css选项来添加自己的css.
还有很多不错的选项如-nnn, 查阅perldoc Perl::Tidy获得更多帮助。