Suppose you start with Perl::Critic from the command line:
perlcritic --single-policy=UnusedPrivateSubroutines --verbose 2 ./*.pl
You will get a list of unused routines. To list unused variables:
perlcritic --single-policy=UnusedVariables --verbose 2 /root/*.pl
To audit the entire mason project for unused routines, something like
cat *.pl > all-perl-files.pl
and reusing percritic on all-perl-files.pl can give you an initial list. This is because if the same subroutine name is declared in more than one file and used somewhere in your project, it may be masked from your unused list.
source share