~3 min read • Updated Feb 18, 2026
1. What Are Perl Modules?
Perl Modules allow you to extend the functionality of cPanel & WHM. These modules can introduce new features or enhance existing ones. Before installing any module, ensure that it is compatible with the Perl environment provided by cPanel.
2. Install Modules to the System Perl
The system Perl environment is located at /usr/bin/perl. You can install modules into this environment using several methods.
2.1 Install from WHM
To install a Perl module through WHM, navigate to:
WHM » Software » Install a Perl Module
You must have compiler access enabled to use this interface.
2.2 Install via perlinstaller Script
The perlinstaller script installs modules using their CPAN names.
/usr/local/cpanel/scripts/perlinstaller Module::NameIf you run the script without arguments, it opens an interactive CPAN shell. You may also use the --force flag to ignore errors, though this may install broken modules.
2.3 Install via cpan Command
The cpan command directly invokes the CPAN utility.
cpan Module::Name3. Install Modules to the cPanel Perl Environment
The cPanel-included Perl environment is located at /usr/local/cpanel/3rdparty/bin/perl. To install modules here, use the cpanm script.
/usr/local/cpanel/bin/cpanm -i Module::NameThis method requires minimal interaction and is the fastest way to install modules.
4. Confirm Module Installation
4.1 Check System Perl
/usr/bin/perl -MModule::Name -e 'print $Module::Name::VERSION . "\n"'4.2 Check cPanel Perl
/usr/local/cpanel/3rdparty/bin/perl -MModule::Name -e 'print $Module::Name::VERSION . "\n"'Both commands return the installed module’s version number.
5. Manage Installed Modules
The perlmods script helps manage installed modules.
-l: List all installed modules-s: Search for a module-u: Uninstall a module
6. Troubleshooting Perl Module Issues
6.1 Check Error Logs
Perl-related errors are logged at:
/usr/local/cpanel/logs/error_log6.2 Use strace for Deeper Debugging
For errors not logged normally, use strace:
strace -s 4096 -fvt -o /root/strace.issue.at.hand -p `cat /var/run/cpsrvd.pid`6.3 Fix @INC Errors
An @INC error means Perl cannot locate the module. The error message lists the directories it searched.
Solutions include:
- Placing the module in one of the listed
@INCpaths - Creating a
symlinkfrom an @INC path to the module location - Fixing build-time issues in the module
View Current @INC Paths
perl -VThis command displays the current @INC paths.
Conclusion
Installing and managing Perl Modules in cPanel & WHM involves multiple methods for both the system Perl and the cPanel Perl environments. With WHM tools, command-line utilities, and proper troubleshooting techniques, you can reliably deploy and maintain Perl modules across your server.
Written & researched by Dr. Shahin Siami