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

I have a once working Perl program which has been moved from an old computer (Windows XP) to a newer one (Vista). The initial attempt at running this script revealed some Perl modules I hadn't installed, as expected. Unfortunately there is one remaining module which Perl cannot locate.

I am running Perl within Eclipse Ganymede with the EPIC plugin installed.

The offending line of code is use HTML::TableExtract;

This is the error I get: "Can't locate HTML::TableExtract.pm in @INC(@INC includes c:/Perl/site/lib c:/Perl/lib.)"

HTML::TableExtract is installed at c:/Perl/site/lib/HTML/TableExtract.pm I have verified that by exploring the file system. The package was installed using ppm. I have verified the installation manually and I have tried reinstalling with ppm.

I am sure this is some dumb error, but I can't find it. Any help would be greatly appreciated. Thanks.

Replies are listed 'Best First'.
Re: Can't locate perl module in @INC
by toolic (Bishop) on Mar 27, 2010 at 21:05 UTC
    It seems like the file is located in the correct directory, and you are including it in your code properly with use. Did you check if you have read permissions on the c:/Perl/site/lib/HTML/ directory and the .pm file?

    Open up the c:/Perl/site/lib/HTML/TableExtract.pm file in an editor to make sure it is not corrupted in any obvious way. Compare it against what you see on CPAN HTML::TableExtract via the "Source" link.

    Do any of these work as expected from your command line:

    perl -MHTML::TableExtract -e 1 perldoc -l HTML::TableExtract perldoc HTML::TableExtract

    Update: I mistakenly had this line:

    perl -l HTML::TableExtract

      I can read HTML::TableExtract.pm in notepad++, and it looks just like the one on the web.

      perl -MHTML::TableExtract -e 1

      returns to command line with no error, no apparent effect

      perl -l HTML::TableExtract

      produces error message: "Can't open perl script HTML::TableExtract: Invalid argument"

      perldoc HTML::TableExtract

      works fine, displays documentation

        I had a typo in my post:
        perl -l HTML::TableExtract
        should have been:
        perldoc -l HTML::TableExtract
        In any case, it appears that the module is installed correctly. I expect the following code in a script to work just fine too (no error). Just put these 3 line in a .pl file, then execute it:
        use strict; use warnings; use HTML::TableExtract;
Re: Can't locate perl module in @INC
by Anonymous Monk on Mar 27, 2010 at 21:11 UTC
    Unlikely story
    $ perl -MHTML::TableExtract -e 1 Can't locate HTML/TableExtract.pm in @INC (@INC contains: C:/perl/5.10 +.1/lib/MSWin32-x86-multi-thread C:/perl/5.10.1/lib C:/perl/site/5.10. +1/lib/MSWin32-x86-multi-thread C:/perl/site/5.10.1/lib .). BEGIN failed--compilation aborted.
      Looks like you would have to specify the path that HTML::Module has been created. For example, if it's installed under C:/Perl64/site/lib/, then you'll have to use following header for it to work. use lib 'C:/Perl64/site/lib/'; use HTML::TableExtract; OR BEGIN {unshift @INC, 'C:/Perl64/site/lib/';} use HTML::TableExtract;