Child pages
  • Prepare Perl Scripts for Our Internal Perl
Skip to end of metadata
Go to start of metadata

Overview

cPanel & WHM includes several Perl environments. The version of cPanel & WHM that you use determines the Perl environments on your server.  

Note:

While cPanel & WHM's installer requires basic Perl, cPanel & WHM does not require the /usr/bin/perl file in order to function. cPanel & WHM's codebase and the /usr/bin/perl file interact minimally.

Perl environments

Select the tab for your version of cPanel & WHM to view the available Perl environments on your server:

 cPanel & WHM versions 56 and later include the following Perl environments:

Perl environmentPerl versionLocationApplications that use this Perl environmentAdditional information
The server's Perl binary
  • Perl 5.8.8 on CentOS, CloudLinux™, and Red Hat® Enterprise Linux (RHEL) 5 (cPanel & WHM version 56 only).
  • Perl 5.10 on CentOS, CloudLinux, and RHEL 6, and Amazon® Linux.
  • Perl 5.16 on CentOS, CloudLinux, and RHEL 7.

/usr/bin/perl

  • Operating system maintenance scripts.

  • Some custom modules.
  • Manage modules for this Perl environment with the cpan command or with WHM's Module Installers interface (WHM >> Home >> Software >> Module Installers).
cPanel-included Perl installationPerl 5.24
  • This environment self-embeds and compiles in the cPanel binary.

  • /usr/local/cpanel/3rdparty/bin/perl

    Note:

    This location is a symlink.

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

    Note:

    @INC walks this directory after it walks all other directories for modules.

  • The cPanel & WHM software.
  • cPanel system maintenance scripts (in the /usr/local/cpanel/scripts directory).
  • CGI scripts.

  • This environment allows you to manage the system's Perl binary independently from cPanel & WHM. Use it when you write Perl scripts for a cPanel & WHM server.
  • For more information about how to modify scripts and modules to use this Perl environment, read our Prepare Perl Scripts for cPanel & WHM's Internal Perl documentation.

 cPanel & WHM version 56 and later includes the following Perl environments:

Perl environmentPerl versionLocationApplications that use this Perl environmentAdditional information
The server's Perl binary
  • Perl 5.8.8 on CentOS, CloudLinux™, and Red Hat® Enterprise Linux (RHEL) 5 (cPanel & WHM version 56 only).
  • Perl 5.10 on CentOS, CloudLinux, and RHEL 6, and Amazon Linux.
  • Perl 5.16 on CentOS, CloudLinux, and RHEL 7.

/usr/bin/perl

  • Operating system maintenance scripts.

  • Some custom modules.
  • Manage modules for this Perl environment with the cpan command or with WHM's Module Installers interface (WHM >> Home >> Software >> Module Installers).
cPanel-included Perl installationPerl 5.22
  • This environment self-embeds and compiles in the cPanel binary.

  • /usr/local/cpanel/3rdparty/bin/perl

    Note:

    This location is a symlink.

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

    Note:

    @INC walks this directory after it walks all other directories for modules.

  • The cPanel & WHM software.
  • cPanel system maintenance scripts (in the /usr/local/cpanel/scripts directory).
  • CGI scripts.

  • This environment allows you to manage the system's Perl binary independently from cPanel & WHM. Use it when you write Perl scripts for a cPanel & WHM server.
  • For more information about how to modify scripts and modules to use this Perl environment, read our Prepare Perl Scripts for cPanel & WHM's Internal Perl documentation.

 cPanel & WHM versions 11.46 through 54 include the following Perl environments:

Perl environmentPerl versionLocationApplications that use this Perl environmentAdditional information
The server's Perl binary
  • Perl 5.8.8 on CentOS, CloudLinux™, and Red Hat® Enterprise Linux (RHEL) 5.
  • Perl 5.10 on CentOS, CloudLinux, and RHEL 6, and Amazon Linux.
  • Perl 5.16 on CentOS, CloudLinux, and RHEL 7.

/usr/bin/perl

  • Operating system maintenance scripts

  • Some custom modules
  • Manage modules for this Perl environment with the cpan command or with WHM's Module Installers interface (WHM >> Home >> Software >> Module Installers).
cPanel-included Perl installationPerl 5.14.4
  • This environment self-embeds and compiles in the cPanel binary.

  • /usr/local/cpanel/3rdparty/bin/perl

    Note:

    This location is a symlink.

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

    Note:

    @INC walks this directory after it walks all other directories for modules.

  • The cPanel & WHM software.
  • cPanel system maintenance scripts (in the /usr/local/cpanel/scripts directory).
  • CGI scripts

  • This environment allows you to manage the system's Perl binary independently from cPanel & WHM. Use it when you write Perl scripts for a cPanel & WHM server.
  • For more information about how to modify scripts and modules to use this Perl environment, read our Prepare Perl Scripts for cPanel & WHM's Internal Perl documentation.

Note:

In cPanel & WHM version 11.46 and later, cPanel's Perl binary and the cPanel-included Perl installation use the same modules and have the same Perl version. 

 

cPanel & WHM version 11.36 through 11.44 includes the following Perl environments:

Perl environmentPerl versionLocationApplications that use this Perl environmentAdditional information
The server's Perl binary
  • Perl 5.8.8 on CentOS, CloudLinux™, and Red Hat® Enterprise Linux (RHEL) 5.
  • Perl 5.10 on CentOS, CloudLinux, and RHEL 6.

/usr/bin/perl

  • Operating system maintenance scripts

  • Some custom modules
  • Manage modules for this Perl environment with the cpan command or with WHM's Module Installers interface (WHM >> Home >> Software >> Module Installers).
cPanel's Perl binaryPerl 5.6.2
  • This environment self-embeds and compiles in the cPanel binary.
  • Place modules for this Perl environment into the /usr/local/cpanel/perl directory.
  • The cPanel & WHM software.
  • Some custom modules

 

cPanel-included Perl installationPerl 5.14.3
  • /usr/local/cpanel/3rdparty/bin/perl

    Note:

    This location is a symlink.

  • Install custom modules for this Perl environment into the /usr/local/cpanel/3rdparty/perl/514/site-lib directory.
  • cPanel system maintenance scripts (in the /usr/local/cpanel/scripts directory).
  • CGI scripts

  • This environment allows you to manage your system's Perl binary independently from cPanel & WHM. Use it when you write Perl scripts for your cPanel & WHM server.
  • For more information about how to modify scripts and modules to use this Perl environment, read our Prepare Perl Scripts for cPanel & WHM's Internal Perl documentation.

 

cPanel & WHM version 11.34 and earlier includes the following Perl environments:

Perl environmentPerl versionLocationApplications that use this Perl environmentAdditional information
The server's Perl binary
  • Perl 5.8.8 on CentOS, CloudLinux™, and Red Hat® Enterprise Linux (RHEL) 5.
  • Perl 5.10 on CentOS, CloudLinux, and RHEL 6.

/usr/bin/perl

  • Operating system maintenance scripts
  • cPanel system maintenance scripts (in the /usr/local/cpanel/scripts directory).
  • CGI scripts

  • Manage modules for this Perl environment with the cpan command or with WHM's Module Installers interface (WHM >> Home >> Software >> Module Installers).
  • cPanel & WHM excludes this environment in YUM updates.
cPanel's Perl binaryPerl 5.6.2
  • This environment self-embeds and compiles in the cPanel binary.
  • Place modules for this Perl environment into the /usr/local/cpanel/perl directory.
  • The cPanel & WHM software.
  • Custom modules

 

Custom modules in cPanel & WHM

We regularly update cPanel & WHM's internal Perl. However, these updates may impact your custom Perl modules.

cPanel & WHM version 62 and later

Warning:

Our upgrades to Perl may break custom code and modules that you used in previous versions of cPanel & WHM. 

cPanel & WHM versions 62 and later ship with binaries that we compile against Perl version 5.22. This change directly affects any custom Perl code that you execute from cPanel binaries. It is critical that you test your plugins and hook code against Perl 5.22 to ensure that they continue to work correctly.

cPanel & WHM version 56 and later

Warning:

Our upgrades to Perl may break custom code and modules that you used in previous versions of cPanel & WHM. 

cPanel & WHM versions 56 through 62 ship with binaries that we compile against Perl version 5.22. This change directly affects any custom Perl code that you execute from cPanel binaries. It is critical that you test your plugins and hook code against Perl 5.22 to ensure that they continue to work correctly.

cPanel & WHM version 11.46 through 54

Warning:

Our upgrades to Perl may break custom code and modules that you used in previous versions of cPanel & WHM. 

cPanel & WHM versions 11.46 through 54 ship with binaries that we compile against Perl version 5.14.4. This change directly affects any custom Perl code that you execute from cPanel binaries. It is critical that you test your plugins and hook code against Perl 5.14.4 to ensure it continues to work correctly. Previously compiled custom modules, with the buildperl system, will not function properly in cPanel & WHM version 11.46 and later, because the system built the module against an older version of Perl.

 

Before you recompile all of your modules, check whether cPanel & WHM already includes your modules. With the addition of several modules to the list of modules that cPanel ships, we expect that cPanel & WHM ships with the majority of the modules that developers built with this tool.
  • For a list of modules that cPanel currently ships, read our Third-Party Software documentation for the appropriate cPanel & WHM version.
  • cPanel wants to ensure that we ship the modules that developers need. If you discover that cPanel & WHM does not ship with a CPAN module that you need, send an email to integration@cpanel.net to request it.

    Note:

    While it is possible to install custom modules to the /opt/cpanel/perl5/514/site_lib library with the /usr/local/cpanel/3rdparty/perl/514/bin/cpan command, this will cause further problems when cPanel switches to newer versions of Perl in the future.

Perl script modifications to use cPanel's Perl environments

Warning:

If your distribution’s core Perl does not provide Perl modules, you may need to change the shebang (#) at the top of your scripts.

Change your shebang if any of the following statements are true:

  • Your scripts need to work on prior versions of cPanel & WHM.
  • Your maintenance scripts tie in to the cPanel & WHM codebase.
  • You want to use Perl 5.14 or later.

We recommend the following option to change the shebang (#!/usr/bin/perl) at the beginning of your script.

Modification to function on cPanel & WHM version 11.36 and later only

If the script must only function in cPanel & WHM version 11.36 and later, replace the shebang at the beginning of your script with the following shebang:

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

Note:

The /usr/local/cpanel/3rdparty/bin/perl symlink points to the location of Perl on the server. We do not recommend that you use the binary to which the symlink points, as it may move in future versions of cPanel & WHM.

Additional documentation