dHarry has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

I want to produce a functional calltree of C programs. C::Analyzer seemed just the the right candidate to do that. My script:

use strict; use warnings; use C::Analyzer; my $analyzer = new Analyzer( _inputPath => "C:/Dev-Cpp/drl_ral", _cppPath => "C:/Dev-Cpp/bin", _inputOption => "dir_and_subdir", );

However I run into the following error message:

Can't locate object method "new" via package "Analyzer" (perhaps you forgot to load "Analyzer"?)

I am pretty sure it installs correctly and Analyzer.pm does contain a new method. Any idea why I get the message or better: how to solve it?

Cheers
dHarry

Replies are listed 'Best First'.
Re: C::Analyzer, can't locate object method new
by Crian (Curate) on Nov 11, 2008 at 13:14 UTC
      After reading the documentation I don't think, that the C:: ist your problem, but I have no further idea.

      The documentation might be wrong, though.

        Since the source uses package C::Analyzer, not package Analyzer, that's the way that it must be addressed in code (short of some sort of aliasing operation). Thus, as you say, the documentation is wrong. I have e-mailed the maintainer to let him know.
Re: C::Analyzer, can't locate object method new
by duckyd (Hermit) on Nov 11, 2008 at 16:33 UTC
    If you'd like to alias it, you could use aliased:
    use aliased 'C::Analyzer'; my $analyzer = new Analyzer(.....