in reply to Dynaloader library path

I believe you have to add to the array after DynaLoader loads but before your module tries to use it. That is, use DynaLoader in your code, extend the array in a BEGIN block, then use the module you want normally.

An easier option is to set the appropriate environment variable, LD_LIBRARY_PATH before launching your process.

Replies are listed 'Best First'.
Re^2: Dynaloader library path
by jimr451 (Novice) on Feb 14, 2006 at 03:11 UTC
    Thanks - I'm getting closer. If I set the LD_LIBRARY_PATH in the shell, things seem to work.

    Problem is running it as a CGI, seems the the Apache environment isn't picking up the setting. I have a .profile and .bashrc setup, but no dice.

    Setting the $ENV hash within the script doesn't seem to do the trick either. Any ideas? I'm about to just post to an .sh script which calls the perl script!

    -Jim
      In Apache, you can use the PassEnv directive to pass along particular environment variables to the httpd server, see http://httpd.apache.org/docs/2.0/mod/mod_env.html#passenv

      This ought to let your CGI scripts see the LD_LIBRARY_PATH env variable. The vairable has to be set in the shell starting the httpd process, so make sure your shell script that starts Apache has the variable set/exported, if it isn't already so.

      -imran

        Well, if I had access to the script that starts Apache (aka root), I'd have just installed the files in the global lib area, and been done with it :)

        Problem is, I don't have root on the machine, it's a hosted account. So I'm looking for a way to get the Path set and exported so the Dynaloader can see it. I was wondering if Apache looks at .profile, .bashrc, before running a CGI that might help me.

        -Jim