in reply to DynaLoader and LD_LIBRARY_PATH

The classic way to handle this is to have a script (shell mostly but it could be perl) that first sets the environment correctly and then executes the dependent program:

#!/bin/bash export LD_LIBRARY_PATH=/path/to/foo:$LD_LIBRARY_PATH /path/to/perl/script
-derby

Replies are listed 'Best First'.
Re^2: DynaLoader and LD_LIBRARY_PATH
by CountOrlok (Friar) on Nov 10, 2005 at 17:36 UTC
    I am aware of that solution. The scripts in question have been upgraded to use these modules. The user of the scripts does not want to change his habits when it comes to running the scripts, i.e. run a shell script instead of the perl script directly. To keep it backward compatible, he wants the Perl script to be run directly without any prior modification of the environment.

    -Imran

      So then rename the perl script to script-old, the shell script to the same name as script-old and pass any args along. If your looking for a way to modify your current script to load the proper ld path, you're out of luck

      If you don't like the shell script invocation, you can do as another poster suggested and have your perlscript set-up the environment in a begin block and then re-exec itself

      -derby