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

Good day monks. I have installed mod Syndication::NewsML. When I try to use it I get the following error:
Can't locate NewsML/Node.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at C:/Perl/site/lib/Syndication/NewsML.pm line 9. BEGIN failed--compilation aborted at C:/Perl/site/lib/Syndication/NewsML.pm line 9. Compilation failed in require at C:\projects\sources\reuters\newsmltest.pl line 1. BEGIN failed--compilation aborted at C:\projects\sources\reuters\newsmltest.pl line 1.
And line 9 of NewsML.pm contains the use statement for the offending module. Is there a simple way to fix this problem, like modifying the @INC variable?

thanks...steve

Replies are listed 'Best First'.
Re: Syndication-NewsML module problem
by VSarkiss (Monsignor) on Jun 15, 2005 at 01:41 UTC
      It is an ActiveState distro, and I installed with PPM (actually Komodo Visual Package Manager). This is why I'm confused by the error.

      As indicated by the error message I posted, it's installed in C:/Perl/site/lib/Syndication/. In this directory is NewsML.pm, and then there is a subdir called NewsML that contains all the associated modules, including the one complained-about in the error message.

      The error message also says "(@INC contains: C:/Perl/lib C:/Perl/site/lib .)" I'm not up on all the details of module construction so I don't know if Syndication and Syndication/NewsML have to be in there explicitly or not. I also don't know what that dot in the list means.

        Hm. The problem appears to be in the library itself. It's not including its own prefix for the sub-modules. In other words, it's doing:

        use NewsML::Node; use NewsML::IdNode; use NewsML::AssignmentNode; # and so on
        instead of
        use Syndication::NewsML::Node; use Syndication::NewsML::IdNode; use Syndication::NewsML::AssignmentNode;

        Probably the easiest fix is to add a use lib statement at the top of your program, like so:

        use lib "C:/Perl/site/lib/Syndication"; use Syndication::NewsML;
        And then it'll find the other modules.

        It may be worth filing a bug report via CPAN RT, even though it appears the author hasn't worked on it since 2002.