Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a tool to check a Perl script for unnecessary use statements?

Tags:

For Python, there is a script called importchecker which tells you if you have unnecessary import statements.

Is there a similar utility for Perl use (and require) statements?

like image 413
Dennis Williamson Avatar asked Sep 05 '12 17:09

Dennis Williamson


People also ask

How do I run a Perl script in Visual Studio code?

From the VS Marketplace plugin page download the extension with the "Download Extension" link on the right hand side. Open a Perl source file, click "Run -> Start Debugging" or hit F5 and observe there is no error as before. Now explore all VSCocde IDE functions working nicely with Perl!

How do I find the program name in Perl?

The name of the running program can be found in the $0 variable: print $0; man perlvar for other special variables. Sometimes the running program will not be the pl file, but a batch job that loaded and ran the pl file.


1 Answers

Take a look at Devel::TraceUse it might give you a chunk of what you're looking for.

like image 81
Len Jaffe Avatar answered Sep 20 '22 13:09

Len Jaffe