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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.