Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

mpeters (5802)

  (email not shown publicly)
AOL IM: michael00peters (Add Buddy, Send Message)

Technorati Profile []

Journal of mpeters (5802)

Friday June 13, 2008
01:49 PM


[ #36684 ]
In my last post I talked about a trick with setting LD_LIBRARY_PATH in the same script that needs it. Then I ran into some problems with code being run by a perl -e scenario. My new solution (with some help from rjbs) is actually even simpler than what I'm doing now. The downside is it's not really portable. Should work for most *nixes and I only really need it to work on Linux, so I'm good.

The answer lies in asking /proc what command line options I was invoked with:

$ENV{LID_LIBRARY_PATH} = '/some/computed/path';
exec(split("\0", `cat /proc/$$/cmdline`));

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.