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

Hi, I'm trying to upload a few Perl-only modules for use on a server without shell access. I have a subdirectory for the modules called (appropriately) "modules." If I upload them in the format /modules/HTML/Parser.pm and /modules/Text/CSV.pm how would I import them into my script?

Also, it was suggested earlier I use:

use FindBin; use lib "$FindBin::Bin/modules";

for finding the module path but this returns the error

Insecure dependency in require while running with -T switch at admin.p +l line 10. BEGIN failed--compilation aborted at admin.pl line 10.
Any ideas why this is?

Replies are listed 'Best First'.
Re: Uploading Perl modules without shell access
by Abigail-II (Bishop) on Jun 25, 2003 at 11:04 UTC
    You are getting the error because FindBin makes use of $0, which is set by the evil outside world. But you don't trust the evil outside world when you run with -T, so you get the error.

    However, if you put the modules in /modules, you don't need FindBin. Just do a use lib "/modules"; before using any of the other modules.

    Abigail

      Hi, I tried this earlier and it worked 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 :)

        From the error message, it seems like Text::CSV is more than just the file Text/CSV.pm. Did you install all parts?

        Abigail

Re: Uploading Perl modules without shell access
by Anonymous Monk on Jun 25, 2003 at 04:13 UTC

    HTML::Template works fine when I upload it as stated. The problems are with Text::CSV

Re: Uploading Perl modules without shell access
by Anonymous Monk on Jun 25, 2003 at 04:11 UTC

    Here's the error I'm currently receiving:

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

    Any ideas why the 'auto' is in there? Thanks.