in reply to Re: Identify Unused and Uninitialised variables.
in thread Identify Unused and Uninitialised variables.

I can not reproduce your perlcritic output. Here is what I get (running on v5.8.8 built for x86_64-linux):
$ cat foo.pl use strict; use warnings; my ($unused, $i, $j); $i = $j; # uninitialized __END__ $ perlcritic -3 foo.pl Code not contained in explicit package at line 1, column 1. Violates +encapsulation. (Severity: 4) Module does not end with "1;" at line 5, column 1. Must end with a re +cognizable true value. (Severity: 4) $ perlcritic -Version 1.080 $

What version of perlcritic do you have? Perhaps mine is too old (1 year old), and I need to upgrade.

Do you have a .perlcritic file? Maybe that has some tool configuration settings that I need to use. Now that you have shown me this cool capability, I really want to use it. Any help would be appreciated.

Replies are listed 'Best First'.
Re^3: Identify Unused and Uninitialised variables. (perlcritic)
by andreas1234567 (Vicar) on Jan 14, 2009 at 19:58 UTC
    I'm using
    $ perlcritic --version 1.090
    Do you see the warning if you use perlcritic -2 instead?

    Update the module, you are most likely 6 months behind. See the Changes file:

    1.088 Released on 2008-07-04

    * Due to the consensus at YAPC::NA 2008, Variables::ProhibitUnusedVariables default severity has been raised to medium/3.

    --
    No matter how great and destructive your problems may seem now, remember, you've probably only seen the tip of them. [1]
      Do you see the warning if you use perlcritic -2 instead?
      No. I tried this with all severity settings (1 .. 5).

      Thanks for giving me something to look for in the Changes file. Chances are this issue will be fixed if I upgrade. It's easy to get out of date with this module: 10 updates in the last year (10!).

        See also Perl-Critic Needs Your Help.
        --
        No matter how great and destructive your problems may seem now, remember, you've probably only seen the tip of them. [1]