perlquestion
AZed
<p>I'm looking for the equivalent of <code>-Wunused</code> in C — or at least a moderate subset. I'd like to get a warning if a <code>my</code> variable goes out of scope without being used. I dug through [perldoc://warnings], [perldoc://perllexwarn], and [perldoc://perldiag], but didn't see anything appropriate.
<p>There's a [http://search.cpan.org/perldoc?warnings::unused|warnings::unused] module, but the bug log for it notes that it can segfault, which makes me less than enthusiastic about trying it out.
<p>There's also a [http://search.cpan.org/perldoc?Perl::Critic::Policy::Variables::ProhibitUnusedVariables|Perl::Critic] rule, but while I might eventually go that route and integrate it into my test files, that's a lot of work for what I was hoping to be a quick check.
<p>Is there a simple method?