Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Dear Zaxo,
I had my CPAN installation setting following your ingenious solution above.
I never has compilation problem beforehand when running a Perl script (*.pl).

Recently, while trying a CGI script like below (let's call it 'test.cgi'). I had problem compiling it.
#!/usr/bin/perl -w use CGI ':standard'; use Mail::Sendmail;
Although Mail::Sendmail is successfuly installed, my CGI script can't recognize the location. I encounter this strange result.

When I run this:
$ perl -c test.cgi # it gives test.cgi syntax OK
But when I run this with taint:
$ perl -cT test.cgi It gives: Can't locate Mail/Sendmail.pm in @INC (@INC contains: ~/lib/perl5/site +_perl/5.8.5/ /usr/lib/perl5/5.8.5/i386-linux-thread-multi /usr/lib/pe +rl5/5.8.5 /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr +/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/sit +e_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.2/i +386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.1/i386-linux-thre +ad-multi /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/ +lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/per +l5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site +_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl / +usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl +5/vendor_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/vendor_per +l/5.8.3/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.2/i386 +-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-threa +d-multi /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr +/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/li +b/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl/5.8.2 /usr/lib/p +erl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl +5/vendor_perl) at temp.cgi line 4. BEGIN failed--compilation aborted at temp.cgi line 4.
How can I have my cgi script recognize the location of the library? I also tried using "use lib" construct like this:

#!/usr/bin/perl -w use CGI ':standard'; use lib "/lib/perl5/site_perl/5.8.5/"; use lib "/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi"; use Mail::Sendmail;


but also gives the same symptom.
Does it has anything to do to the way I install the module following your approach?

Update:
That may fail to influence a web server's Perl environment. If it does, you can use the SetEnv directive in .htaccess or the server configuration for regular cgi scripts.
Just realized you mentioned about the problem above. But how do you actually "SentEnv directive of server config" in my cgi scripts?

Regards,
Edward

In reply to Re^2: Personal library with CPAN by monkfan
in thread Personal library with CPAN by yoda54

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others taking refuge in the Monastery: (15)
    As of 2014-07-30 14:26 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite superfluous repetitious redundant duplicative phrase is:









      Results (234 votes), past polls