<?xml version="1.0" encoding="windows-1252"?>
<node id="603522" title="linking to .so file in non-standard location" created="2007-03-06 17:26:38" updated="2007-03-06 12:26:38">
<type id="115">
perlquestion</type>
<author id="377463">
mpeters</author>
<data>
<field name="doctext">
&lt;p&gt;I have a script which uses [cpan://Business::OnlinePayment::PayflowPro] which in turn uses a &lt;code&gt;.so&lt;/code&gt; file from PayflowPro. It's easy enough for Dynaloader to link to it if it's in the standard lib location, but I want this project to be self-contained, so I'm not putting it in the standard location.
&lt;/p&gt;

&lt;p&gt;
I can fix this if I set &lt;code&gt;$ENV{LD_LIBRARY_PATH}&lt;/code&gt; in my shell or the process that spawns this script, but I would like to be able to do it from within my script, but it doesn't work like that.
&lt;/p&gt;

&lt;p&gt;
I assume that there's some [cpan://DynaLoader] incantation I can perform that will work, but I can't quite get my finger on it. Any ideas?
&lt;/p&gt;

&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-377463"&gt;
&lt;br&gt;-- &lt;i&gt;More people are killed every year by pigs than by sharks, which shows you how good we are at evaluating risk.&lt;/i&gt; -- Bruce Schneier
&lt;/div&gt;&lt;/div&gt;</field>
</data>
</node>
