Skip to main content

Perl version ?

Comments

7 comments

  • peterr
    Altering the "shebang" line made no difference (version number still shown as 5.16.3), yet altering the path in a command showed the system wide version (5.30.0), as follows: [CODE=perl]#!/usr/local/cpanel/3rdparty/bin/perl # Available under BSD License. # See url https://www.cyberciti.biz/faq/how-can-i-find-out-perl-version/ use strict; my $command=` /usr/local/cpanel/3rdparty/perl/530/bin/perl -V`; my $title = "Perl Version"; print "Content-type: text/html\n\n"; print "$title"; print "

    $title

    \n"; print '
    '; print $command; print ''; print "";
    0
  • andrew.n
    cPanel for it's own use different PERL version than the system wide one as you see. It's like OpenSSL library or PHP versions. If you use a very simple script like this: #!/usr/local/cpanel/3rdparty/bin/perl my $perl_cmd = "/usr/local/cpanel/3rdparty/bin/perl --version"; my $perl_str=`$perl_cmd`; print "PERL VERSION = " . $perl_str; then you will see it prints the cPanel version while if you just use "/usr/bin/perl --version" that will print the system wide one.
    0
  • cPRex Jurassic Moderator
    Let me know if the details @andrew.n provided don't clear things up for you!
    0
  • peterr
    cPanel for it's own use different PERL version than the system wide one as you see. It's like OpenSSL library or PHP versions. If you use a very simple script like this: #!/usr/local/cpanel/3rdparty/bin/perl my $perl_cmd = "/usr/local/cpanel/3rdparty/bin/perl --version"; my $perl_str=`$perl_cmd`; print "PERL VERSION = " . $perl_str; then you will see it prints the cPanel version while if you just use "/usr/bin/perl --version" that will print the system wide one.

    Thanks @andrew.n , yes same results as before, but different terminology. If I use [CODE=perl]my $command=` /usr/local/cpanel/3rdparty/bin/perl --version`;
    the resultant display is [quote]This is perl 5, version 30, subversion 0 (v5.30.0) built for x86_64-linux-64int (with 32 registered patches, see perl -V for more detail) Copyright 1987-2020, Larry Wall
    If I use [CODE=perl]my $command= `/usr/bin/perl --version`;
    the resultant display is [quote]This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi (with 44 registered patches, see perl -V for more detail) Copyright 1987-2012, Larry Wall
    Hmm, so you are calling 5.30.0 the CPanel version and 5.16.3 the system wide one. Okay...leading on .. When I use the CPanel 'Install Perl modules' it is installing modules from 5.16.3 . Why I state that is because the modules are being installed in a /home/username path, and one such path I see there is /home/********/perl/usr/lib/perl5/5.16.3, and that is why 5.16.3 shows as the version number from a [quote]/usr/bin/perl --version
    So, ...using your terminology, that is the system wide version, right ? How do I navigate around that to ensure I get the latest/CPanel version ? From the minor research, it seems I would have to use bash/shell and install from CPAN that way ??
    0
  • andrew.n
    that version of perl is only being utilised by cPanel and everything else is using the system wide version. I'm not really sure how good idea is to try to install additional modules/extensions to perl which is provided by cPanel and use that for whatever application you need but to answer your question you can find the modules under /usr/local/cpanel/3rdparty/bin/ folder so for example installing "imagick" can be done with /usr/local/cpanel/3rdparty/bin/pecl install imagick. In case of imagick it's also tricky as it can be installed under different PHP versions. EDIT: yes there is cpan provided under /usr/local/cpanel/3rdparty/perl/530/bin/ so you have to use that to install additional modules under this perl version. Please note that this is not supported by cPanel and not recommended either.
    0
  • peterr
    Please note that this is not supported by cPanel and not recommended either.

    Thanks for the other explanations, as you have highlighted the above I won't proceed with doing that. To take some information back to the hosting company support people, is the resolve for this to simply update the system wide Perl version so that it is the latest version ??. I use the term 'simply' lightly of course, as this is a shared server and potentially impacts other users. But even if other shared users are using Perl, I don't understand why they would want to be on a version that is well near 8 years old. Possibly scripts will break if a newer version is used ?? Thanks for all your help.
    0
  • peterr
    In checking various Perl modules and the versions, came across a nice script at MoDetails v0.2 ; very handy. (although it is old and uses CGI)
    0

Please sign in to leave a comment.