How to Install Perl Modules on Shared Servers

Author:Esadax
Updated:Jul 12, 2025

To resolve the issue with the Perl module installation on your server, follow these step-by-step instructions:

  1. Access cPanel: Log in to your hosting account's cPanel interface.

  2. Navigate to Perl Modules:

    • In the cPanel menu, locate and click on Perl Modules.
  3. Modify Configuration Settings:

    • Click on Module Config.
    • Find the section labeled makepl_arg and set it to an empty string: makepl_arg=.
    • Similarly, set mbuildpl_arg to an empty string: mbuildpl_arg=.
    • Save these changes by clicking Commit Changes.
  4. Reinstall the Module:

    • Go back to the Perl Modules section.
    • Click on Install Module and select the module you wish to install.
    • Follow the prompts to begin the installation.
  5. Check for Errors:

    • If an error occurs, such as a failed build in /home/nctests/.cpan/build/..., use FTP or cPanel File Manager to delete this directory manually before retrying the installation.
  6. Review Installation Log:

    • After successful installation, check the log file for any issues.
    • Ensure the module is listed under Perl Modules after installation.
  7. Update Your Script:

    • Add #!/usr/bin/perl and use cPanelUserConfig; or use cPanel::UserConfig; at the top of your script to ensure proper module handling.
  8. Exit cPanel Shell:

    • After finishing, type exit in the cpan shell to close it and remove any lock files.