Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

I don't think you took my point at all.

The OP showed code in which the OP already used pragmas and modules in the main program. What possible value is there to the OP in writing yet another program which will somehow have to do or require or use that main program, just to avoid writing a single use lib '...' statement in the main program which the OP has already written and already demonstrated comfort with and competence in using, well, use?

Worse than that convolution, your suggestion is still misleading. What does "call the original main-program" mean? Use system? (Clearly not, because that won't work, because @INC isn't an environment variable inherited between processes.) Use do or require or use? Again, why—and how do you know what "original main-program" to call? Either you hard code its name, in which case your very short program gets a line longer for no benefit, or you make it parametric somehow by playing with $0 and symlinks (clever but not clear at all), taking input from the command line (I'm shaking my head here), or opening a security hole by taking input from untrusted clients in a CGI situation like the OP has demonstrated.

Now you could have talked about sitecustomize.pl, but in a CPanel environment, does that file even exist? Is it accessible to the OP?

Alternately, you could have given the correct and simple and clear answer: use lib '...'; without messing around with invoking other programs at all.


In reply to Re^4: Perl module installing at server by chromatic
in thread Perl module installing at server by james786

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 having an uproarious good time at the Monastery: (8)
    As of 2014-04-20 14:43 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      April first is:







      Results (485 votes), past polls