Development Guides Home >> Guide to Perl

Guide to Perl in cPanel - Perl Environments


cPanel & WHM servers include multiple Perl environments. Your Perl modules can use these Perl environments, but they may require certain modifications in order to function correctly.

Perl environments

The server's Perl binary

The server's Perl binary environment is in the /usr/bin/perl directory. Operating system maintenance scripts and some custom modules use this environment.

The cPanel & WHM server's operating system determines the Perl binary environment as follows:

Operating system Perl version
AlmaLinux OS 8 5.26.3
AlmaLinux 9 5.32.1
CloudLinux 6 5.10.1
CloudLinux 7 5.16.3
CloudLinux 8 5.26.3
CloudLinux 9 5.26.3
Rocky Linux 8 5.26.3
Rocky Linux 9 5.32.1
Ubuntu 22.04 5.34.0

You can 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 installation

The server may use a self-embedded Perl 5.36.0 environment that compiles in the cPanel binary to handle CGI scripts, as well as maintenance scripts from the /usr/local/cpanel/scripts directory.

You can use this environment to manage the system's Perl binary independently from cPanel & WHM, and to install Perl scripts to a cPanel & WHM server.

The symlink to this Perl environment is /usr/local/cpanel/3rdparty/bin/perl. You may install custom modules for this Perl environment into the /opt/cpanel/perl5/536/site_lib directory. This directory will only appear once you have installed a Perl module.

  • @INC walks this directory after it walks all other directories for modules.
  • For more information about how to modify scripts and modules to use this Perl environment, read our Modules and Scripts documentation.