<br><br><div><span class="gmail_quote">On 2/17/07, <b class="gmail_sendername">David Alban</b> &lt;<a href="mailto:extasia@extasia.org">extasia@extasia.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
FYI, this didn&#39;t work:<br><br>&nbsp;&nbsp;perl Makefile.PL PREFIX=/usr/local/FOO<br><br>That is, using PREFIX=/usr/local/FOO didn&#39;t cause a cpan module to be<br>installed in the /usr/local/FOO tree such that I could include it
<br>with:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;use lib &quot;/usr/local/FOO/lib/perl&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp;use Some::Module;</blockquote><div><br>You don&#39;t need to include it as  &quot;/usr/local/FOO/lib/perl&quot;.&nbsp; If you use PREFIX just use that same value for &#39;use lib&#39;, ie:
<br><br>&nbsp; $ perl Makefile.PL PREFIX /usr/local/FOO<br>&nbsp; ...&nbsp;<br>&nbsp; $ cat yourprog.pl<br>&nbsp; #!/usr/bin/perl -w<br><br>&nbsp; use lib qw(/usr/local/FOO);<br>&nbsp; ...<br><br>&#39;lib&#39; knows how to find your modules.<br><br>Garth<br>
&nbsp; </div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">But this does work (/usr/local/FOO/lib/perl is a symlink to perl5):<br><br>&nbsp;&nbsp;perl 
Makefile.PL LIB=/usr/local/FOO/perl5<br><br>It caused, for example, Crypt::PasswdMD5 to be installed as:<br><br>&nbsp;&nbsp;/usr/local/FOO/lib/perl5/Crypt/PasswdMD5.pm<br><br>Which is the same location I&#39;m putting home grown modules.
<br><br>So now I have a single:<br><br>&nbsp;&nbsp;use lib &quot;/usr/local/FOO/lib/perl&quot;;<br><br>statement that works both for home grown and installed-from-cpan modules.<br><br>Yay!<br><br>On 1/29/07, David Alban &lt;<a href="mailto:extasia@extasia.org">
extasia@extasia.org</a>&gt; wrote:<br>&gt; (Assume I&#39;m not allowed to update the &quot;live&quot; perl installation, so I&#39;m<br>&gt; installing modules in the /usr/local/FOO tree.)&nbsp;&nbsp;I have:<br>&gt;<br>&gt; $ find /usr/local/FOO/lib/perl5 -type f
<br>&gt; /usr/local/FOO/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/Crypt/PasswdMD5/.packlist<br>&gt; /usr/local/FOO/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/perllocal.pod<br>&gt; /usr/local/FOO/lib/perl5/site_perl/5.8.0/Crypt/PasswdMD5.pm
<br>&gt; /usr/local/FOO/lib/perl5/Log/Transcript.pm<br>&gt;<br>&gt; Crypt::PasswdMD5 is from CPAN.&nbsp;&nbsp;I took Garth&#39;s suggestion and did:<br>&gt;<br>&gt;&nbsp;&nbsp; $ perl Makefile.PL PREFIX=/usr/local/FOO<br>&gt;<br>&gt; and the files were installed as shown above.&nbsp;&nbsp;Log::Transcript is the
<br>&gt; module I wrote.<br>&gt;<br>&gt; Ideally, I&#39;d like to have users be able to include a single &quot;use ...&quot;<br>&gt; statement in the code.[1]&nbsp;&nbsp;I&#39;d like it to be:<br>&gt;<br>&gt;&nbsp;&nbsp; use lib &quot;/usr/local/FOO/lib/perl5&quot;;
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # or /usr/local/FOO/lib/perl if I make the latter a symlink to<br>&gt; the former<br>&gt;<br>&gt; Not two:<br>&gt;<br>&gt;&nbsp;&nbsp; use lib &quot;/usr/local/FOO/lib/perl5&quot;;<br>&gt;&nbsp;&nbsp; use lib &quot;/usr/local/FOO/lib/perl5/site_perl&quot;;
<br>&gt;<br>&gt; Based on Quinn&#39;s suggestion, I thought the former might allow a<br>&gt; program to pick up both Log::Transcript (or, home-grown modules) and<br>&gt; Crypt::PasswdMD5 (or, cpan installed modules).&nbsp;&nbsp;But it doesn&#39;t pick up
<br>&gt; the site_perl tree:<br>&gt;<br>&gt; $ unset PERL5LIB; perl -I/usr/local/FOO/lib/perl5 -MCrypt::PasswdMD5 -e 1<br>&gt; Can&#39;t locate Crypt/PasswdMD5.pm in @INC (@INC contains:<br>&gt; /usr/local/FOO/lib/perl5/5.8.0/i386-linux-thread-multi
<br>&gt; /usr/local/FOO/lib/perl5/5.8.0 /usr/local/FOO/lib/perl5<br>&gt; /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0<br>&gt; /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi<br>&gt; /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl
<br>&gt; /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi<br>&gt; /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl<br>&gt; /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .).<br>&gt; BEGIN failed--compilation aborted.
<br>&gt;<br>&gt; It&#39;s a little clearer here:<br>&gt;<br>&gt; $ unset PERL5LIB; perl -I/usr/local/FOO/lib/perl5 -e &#39;print join &quot;\n&quot;, @INC&#39;<br>&gt; /usr/local/FOO/lib/perl5/5.8.0/i386-linux-thread-multi
<br>&gt; /usr/local/FOO/lib/perl5/5.8.0<br>&gt; /usr/local/FOO/lib/perl5<br>&gt; /usr/lib/perl5/5.8.0/i386-linux-thread-multi<br>&gt; /usr/lib/perl5/5.8.0<br>&gt; /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi<br>
&gt; /usr/lib/perl5/site_perl/5.8.0<br>&gt; /usr/lib/perl5/site_perl<br>&gt; /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi<br>&gt; /usr/lib/perl5/vendor_perl/5.8.0<br>&gt; /usr/lib/perl5/vendor_perl<br>&gt; /usr/lib/perl5/5.8.0/i386-linux-thread-multi
<br>&gt; /usr/lib/perl5/5.8.0<br>&gt;<br>&gt; Am I missing something that I can use to get a single:<br>&gt;<br>&gt;&nbsp;&nbsp; use lib &quot;/usr/local/FOO/lib/perl5&quot;;<br>&gt;<br>&gt; statement to work (i.e., to include the site_perl tree, too)?
<br>&gt;<br>&gt; Thanks,<br>&gt; David<br>&gt;<br>&gt; [1] There&#39;s no hope of getting them to set PERL5LIB in their environment<br>&gt;<br>&gt; On 1/25/07, Quinn Weaver &lt;<a href="mailto:quinn@fairpath.com">quinn@fairpath.com
</a>&gt; wrote:<br>&gt; &gt; Right.&nbsp;&nbsp;And in this case, you&#39;d do<br>&gt; &gt;<br>&gt; &gt; export PERL5LIB=/usr/local/FOO/lib/perl5 # bash syntax<br>&gt; &gt;<br>&gt; &gt; ... then Perl automatically searches under there for site_perl,
<br>&gt; &gt; site_perl/5.8.0, and all those other weirdly named subdirs that<br>&gt; &gt; Perl uses to install things.<br><br>--<br>Live in a world of your own, but always welcome visitors.<br>_______________________________________________
<br>SanFrancisco-pm mailing list<br><a href="mailto:SanFrancisco-pm@pm.org">SanFrancisco-pm@pm.org</a><br><a href="http://mail.pm.org/mailman/listinfo/sanfrancisco-pm">http://mail.pm.org/mailman/listinfo/sanfrancisco-pm</a>
<br></blockquote></div><br>