[Perl] Smart::Comments

调试Perl程序时,使用Smart::Comment模块,追踪代码的变量值,非常方便有效。

代码示例:

1 #!/usr/bin/perl
2 
3 use Smart::Comments;
4 # no Smart::Comments;
5 my $var=@ARGV[0]; 6 7 ### $var;

执行代码:

./smartcomment.pl test

执行结果:

### $var: 'test'

使用“no Smart::Comments” 代替 “use Smart::Comments”, 可以关闭注释信息。

 

命令行打开Smart::Comments模块的方法:

perl -MSmart::Comments smartcomment.pl test

 

posted @ 2015-03-02 16:22  启芯-工作室  阅读(457)  评论(0编辑  收藏  举报