Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

The question now is why cPanel does not allow you to install (some?) modules. Without me ever using cPanel or knowing what's going on in the mind of the hosting service I would guess that the answer is "because you can mess your system very easily". You see Perl is used for some of OS maintenance and if you even upgrade system Perl or a module that system Perl relies on to be on a particular version then some things may break.

But irrespective of me being correct in my guess, I would suggest that you install perlbrew (as root) and from within it your preferred Perl (e.g. the latest). Follow this guide: https://metacpan.org/pod/distribution/App-perlbrew/script/perlbrew#PERLBREW_ROOT on how to install it for many users (they have to modify their bashrc). The problem you will encounter is that your CGI scripts must be told exactly what Perl to use because they may be running under a custom user account (e.g. www). I am sure you will be able to find plenty of info on how to do this.

What is suggested in the above guide is that you create a 'perlbrew' user which has write permissions to perlbrew's home dir. And whenever you want to maintain perlbrew by upgrading perl or installing a module, you must do that as 'perlbrew' user.

So, now you have a Perl installed which is independent from system Perl (but not necessarily different version!). Next step is to install cpanm and use the latter for installing all the packages you need - for me it works nice and never failed me and it is high-level. Here you may want to keep a list of those packages you installed so that when you migrate you re-install all these modules (there are also ways to get the list of currently installed modules with varied mileages).

The alternative is to have and use only 1 perl: system perl. Just beware that the system can do whatever they want with that perl e.g. upgrading it or its packages. The hosting service should have a snapshot feature somewhere by which you save a working state of the system and if you mess up you just load that snapshot and annul all the rogue changes you did. Whatever you do, using cpanm for installing modules saves a lot of hassle (than using the more low-level cpan command).

BEWARE: with the above or just by logging as root using SSH you can mess up the system and then Christmas will really be cancelled. So: prudence, snapshots, backups.

bw, bliako


In reply to Re: CPAN PREFIX or INSTALL_BASE by bliako
in thread CPAN PREFIX or INSTALL_BASE by Bod

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-26 00:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found