in reply to Perl Analyzer?

Along similar lines to the reply by planetscape, here is a (rather old) tool that might be able to do some of what you want:

Tabulate sub defs, sub calls in Perl code

It just looks for (and lists) the creation of subroutines, and within each one (and in "main") it looks for (and lists) subs that are called.

As for your other goals: You might be able to look at my example, or others suggested above, and work out a way to run diffs in some appropriate manner on pairs of subs, to list pairs that are mostly similar -- but the result has to be presented in some way that makes it easy to scan manually, because manual judgment will be needed here.

As for trying to identify and remove superfluous "use Some::Module" statements, I don't think it's worth the trouble -- these things are relatively harmless. If you have some sort of test harness for a script, such that you are sure every branch in the code is being exercised, you could try commenting out one "use" statement at a time and see which ones (if any) make no difference. But why bother? (If you don't have such a test harness, I would advise against this sort of approach.)

Replies are listed 'Best First'.
Re^2: Perl Analyzer?
by Coldstone (Acolyte) on Aug 15, 2006 at 22:19 UTC
    Awsome, Awsome to the max. This isn't quite what I was looking for but I can do the remaining 20% myself. Thanks!
Re^2: Perl Analyzer?
by Jedaï (Initiate) on Aug 05, 2006 at 15:54 UTC

    Devel::Cover pourrait également être utile, bien qu'il ne s'agisse pas d'un outil d'analyse statique à proprement parler.

    --
    Jedaï
      To translate the above reply in to English, before commenting on it:

      "Devel::Cover could be just as useful, although, strictly speaking, it doesn't serve as a tool for statistical analysis."

      I would say that, nevertheless, Devel::Cover provides a very easy solution to what the OP is asking for, whereas statistical analysis of the coverage would be something else entirely. Also, it is extremely difficult to provide a meaning to the latter, because randomness is not easily or usefully defined for input data, unless it is functionally random, e.g. noise.

      -M

      Free your mind