Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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.

Replies are listed 'Best First'.
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?
[Eily]: started*
[ambrus]: LanX: native speakers are close, but they aren't on the top. there are a _few_ foreigners who have such a thick accent that it takes more time to get used to it and understand the words behind than even the worst native speaker accents.
[ambrus]: but yes, typically native English speakers, who think that English is still their exclusive property, are the worst.
[LanX]: Eily: do you live in an English speaking country?
[LanX]: I think foreigners tend to simplify their phrases, whereby often native speakers don't know how to adapt
[Eily]: nope, France
[LanX]: That's pretty true for every language
[LanX]: so don't worry, anyway most spoken language in the world is broken English
LanX (especially in the streets of Singapore)
[Eily]: yes I know, native English speakers are actually a minority among English speakers :)

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (12)
As of 2017-03-27 16:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (320 votes). Check out past polls.