开发者

Coding in Perl: Finding unused variables

开发者 https://www.devze.com 2023-03-05 06:13 出处:网络
How can I locate unused variables and/or dead code in Perl? This can easily be done in Java with an IDE. Can it be done in Perl?

How can I locate unused variables and/or dead code in Perl? This can easily be done in Java with an IDE. Can it be done in Perl?

This is a single stand-alone script and I will spo开发者_如何学Ct any variables that might be used in one of the requires.


Perl::Critic is a comprehensive package for source-code standards checking. It's capable of finding unused variables and unreachable code among many other things.


See warnings::unused.

This pragmatic module extends lexical warnings to complain about unused variables.

It produces warnings when a my variable or state variable is unused aside from its declaration.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号