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

Hi monks,

Which directory in the server is ideal for placing custom perl modules? In my server, I created a directory named 'modules' just above the username (e.g. /user/home/kiat/modules) and uploaded all the modules there.

Should I upload all modules to cgi-bin (/user/home/kiat/public_html/cgi-bin) instead?

cheers :)

  • Comment on Which dir to upload custom perl modules to?

Replies are listed 'Best First'.
Re: Which dir to upload custom perl modules to?
by jZed (Prior) on Apr 21, 2004 at 01:49 UTC
    It doesn't really matter where you put the modules, as long as your scripts can find them. You probably do not want them in your cgi directory. The scripts in the cgi directory should have this line in them:

    use lib qw(/usr/home/kiat/modules);

      Cool, it's exactly the kind of info I was looking for. Thanks :)
Re: Which dir to upload custom perl modules to?
by ysth (Canon) on Apr 21, 2004 at 02:21 UTC
    It's a really good idea to include $Config::Config{api_versionstring} and $Config::Config{archname} in your module path if you are using any compiled modules, so when you upgrade perl things die nicely rather than segfaulting.