Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: Perl module installing at server

by sundialsvc4 (Abbot)
on Aug 19, 2013 at 18:59 UTC ( #1050068=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Perl module installing at server
in thread Perl module installing at server

Your point is well taken.   What I mean to say is that (especially in a shared-hosting situation) it is often convenient to execute a very-short program whose sole purpose is to execute a use lib statement (to push paths onto @INC), then call the original main-program.   The other way to do it is to somehow ensure a correct value for PERL5LIB but I tend to like this way better.

It has also been a real bone of contention for me that lots of hosting-services pay a great deal attention to PHP but run truly-antique versions of Perl ... and also place sometimes-too-severe resource limit restrictions.   You have to shop carefully.


Comment on Re^3: Perl module installing at server
Re^4: Perl module installing at server
by chromatic (Archbishop) on Aug 19, 2013 at 19:44 UTC

    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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1050068]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (15)
As of 2014-10-23 12:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (125 votes), past polls