Perl modules are reusable software components that extend the functionality of the Perl programming language. You can install Perl modules directly from the CPAN repository through your hosting control panel, allowing you to add powerful features to your Perl scripts and applications. Before you can use any Perl module in your programs, you must first install it on your hosting account.
What Are Perl Modules?
Perl modules are pre-written libraries of code that provide specific functionality for your Perl applications. Instead of writing complex code from scratch, you can install modules from the Comprehensive Perl Archive Network (CPAN), which contains thousands of tested and documented modules. These modules handle everything from database connections to web forms, image processing, and email functionality.
Module Include Path
The Module Include Path section displays the location where your installed modules are stored on your hosting account. When you reference modules from your Perl scripts or other programs, you'll need to use this include path. This path tells your Perl interpreter where to find the installed modules when your script runs.
How to Install a Perl Module
You can install Perl modules through your control panel using one of three methods:
- Direct Installation: If you know the exact module name, enter it in the Install a Module text box and click Install Now. The system will download and install the module from CPAN.
- Search Method: Enter a search term in the Search text box and click Go. The interface will display modules related to your search term, making it easier to find what you need.
- Browse Available Modules: Click Show Available Modules to view a list of available Perl modules from the CPAN repository. Note that not every CPAN module will appear in this list.
For each module in the search results, you'll see the module name, version number, and available actions. If you don't find the desired module on your first search, try different search terms or browse the available modules list.
Using Your Perl Module
The Using Your Perl Module(s) section provides the code you must include at the top of your Perl script. This code specifies the location of the Perl interpreter that the system will use to run your script. Copy this code exactly as shown and paste it as the first line of your Perl programs to ensure they execute correctly.
To actually use an installed module in your script, you'll also need to add a use or require statement for that specific module after the interpreter line. For example, if you installed the CGI module, you would add use CGI; to your script.
Managing Installed Modules
The Installed Modules table shows all Perl modules currently installed on your hosting account. For each module, you can view:
- Module Name: The complete name of the installed module
- Version: The current version number of the module
- Actions: Available management options, including the ability to update the module to the latest version or uninstall it if no longer needed
Keeping your modules updated ensures you have the latest features, performance improvements, and security patches. Click the Update action next to any module to upgrade it to the newest available version from CPAN.
Frequently Asked Questions
Do I need to restart anything after installing a Perl module?
No, you don't need to restart any services after installing a Perl module. The module becomes immediately available for use in your Perl scripts. However, if you have a long-running Perl script that's already executing, you may need to restart that specific script to use the newly installed module.
What happens if I install the wrong Perl module?
If you accidentally install the wrong module, you can simply uninstall it from the Installed Modules table. Click the uninstall action next to the module you want to remove. This won't affect your other installed modules or your Perl scripts that don't use that particular module.
Why can't I find a specific module when searching?
The control panel interface doesn't display every module available on CPAN. If you can't find a specific module through the search or browse features, try installing it directly by name using the Install a Module text box. If the module still won't install, it may have dependencies that need to be installed first, or it may not be compatible with your hosting environment.
Can I install multiple Perl modules at once?
You need to install Perl modules one at a time through the control panel interface. After installing each module, you can immediately proceed to install another. Some modules may automatically install their required dependencies during the installation process, which can save you time.
If you need assistance with Perl modules or encounter any issues during installation, the OBHost support team is available 24/7 to help. Visit our contact page or email us at support@obhost.org for technical support.