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

I'm uploading a few modules into a local module directory for use with a script. I have them in the format ./modules/HTML/Template.pm and ./modules/Text/CSV.pm. It works fine for HTML::Template but not for Text::CSV. Here's the import code:

use lib 'modules'; use HTML::Template; use Text::CSV;

Here's the error:

Can't locate modules/auto/Text/CSV/autosplit.ix in @INC (@INC contains: modules .. (more perl directories)

I don't understand the /auto subdirectory, or why it's unable to find Text::CSV (it is located in modules/Text/CSV). Thanks for your help :)

Replies are listed 'Best First'.
Re: Uploading Text::CSV
by aquarium (Curate) on Jun 26, 2003 at 04:45 UTC
    Text::CSV is using compiled code (XS) as well as the .pm module...therefore straight copy of the .pm file will not fully install the module. you would need to look into the module and see which compiled code it uses and copy that across also, into the right directories. The copying of compiled code will only work if the source and target machines are exactly same architecture..otherwise you'd need to get the source for the module and re-compile on target.

      Thanks, so as a follow-up question: are there any perl-only modules that do roughly the same thing as Text::CSV?

        I modified Text::CSV and it appears to work ok.. just comment out the Exporter/AutoLoader stuff.. I don't believe it actually uses any of it..

        #BEGIN { # use Exporter (); # use AutoLoader qw(AUTOLOAD); use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); $VERSION = '0.01'; # @ISA = qw(Exporter AutoLoader); # @EXPORT = qw(); # @EXPORT_OK = qw(); # %EXPORT_TAGS = qw(); #}

        Update: ok, so it does use it, but it doesn't need it.. see here for a slightly more informed solution/explanation..

        cheers,

        J