Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

3rd Party Perl Module Install Location

Discussion in 'General Discussion' started by Frank Jance, Jan 21, 2018.

  1. Frank Jance

    Frank Jance Member

    Joined:
    Jan 13, 2018
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    When installing Perl modules to be used by cPanel's 3rd Party Perl, I use the following command:

    /usr/local/cpanel/3rdparty/perl/524/bin/cpan -i List::Compare

    However, the modules get installed here:

    # perldoc -l List::Compare
    /home/user/perl5/lib/perl5/List/Compare.pm


    Why is that? I get errors when trying to run a script, e.g.:

    Can't locate List/Compare.pm in @INC (you may need to install the List::Compare module) (@INC contains: /home/user/scripts/../perl/Modules /home/user/perl5/lib/perl5 /home/user/perl5/lib/perl5/x86_64-linux-thread-multi /home/user/perl/usr/local/cpanel /home/user/perl/usr/local/cpanel/3rdparty/perl/524/lib64/perl5/cpanel_lib/x86_64-linux-64int /home/user/perl/usr/local/cpanel/3rdparty/perl/524/lib64/perl5/cpanel_lib /home/user/perl/usr/local/cpanel/3rdparty/perl/524/lib64/perl5/5.24.1/x86_64-linux-64int /home/user/perl/usr/local/cpanel/3rdparty/perl/524/lib64/perl5/5.24.1 /home/user/perl/opt/cpanel/perl5/524/site_lib/x86_64-linux-64int /home/user/perl/opt/cpanel/perl5/524/site_lib /usr/local/cpanel /usr/local/cpanel/3rdparty/perl/524/lib64/perl5/cpanel_lib/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/524/lib64/perl5/cpanel_lib /usr/local/cpanel/3rdparty/perl/524/lib64/perl5/5.24.1/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/524/lib64/perl5/5.24.1 /opt/cpanel/perl5/524/site_lib/x86_64-linux-64int /opt/cpanel/perl5/524/site_lib) at /home/user/scripts/files_compare.pl line 23.
    BEGIN failed--compilation aborted at /home/user/scripts/files_compare.pl line 23.


    How can I get the modules to install in a location that the 3rd party Perl knows about?

    Thanks,
    Frank
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,802
    Likes Received:
    1,895
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello Frank,

    The following documents include information about using Perl in the cPanel environment:

    Guide to Perl in cPanel - Perl Environments - Software Development Kit - cPanel Documentation
    Prepare Perl Scripts for Our Internal Perl - cPanel Knowledge Base - cPanel Documentation

    What shebang are you using at the beginning of your Perl script? Additionally, note the following quote from our Documentation:

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Frank Jance

    Frank Jance Member

    Joined:
    Jan 13, 2018
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    This is the shebang I'm using:

    #!/usr/local/cpanel/3rdparty/bin/perl

    The weird thing about what I posted above is that "/home/user/perl5/lib/perl5" shows as being included in @INC in the error message, so why would pushing it onto @INC solve the problem?

    That 2nd link you posted says:

    "Install custom modules for this Perl environment into the /opt/cpanel/perl5/524/site_lib directory."

    Shouldn't that command install modules there on it's own, or do I need to add a path to that directory?

    /usr/local/cpanel/3rdparty/perl/524/bin/cpan -i Module::Name

    I would think that using that command, the modules would automatically be usable by that version of Perl without have to append to @INC.

    Thanks for the help,
    Frank
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,802
    Likes Received:
    1,895
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Could you open a support ticket using the link in my signature so we can take a closer look?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice