Installing Perl modules

When there are special requirements then the need for additional Perl modules may arise. Fortunately Perl has an excellent package repository that can satisfy almost all needs. That repository is called CPAN and is available at

It is recommended that modules from CPAN are installed with the command line client cpanm. Alternatively, many Perl modules are also available as packages for your operating system. These packages can be installed via your systems regular package manager.

The utility cpanm is often already installed on your system. Please see for what to do when is isn’t already available.

Per default cpanm installs module into a systemwide location. In this case modules must be installed as the root user. For example, the command

root> cpanm Acme::Dice

results in:

otobo> perldoc -l Acme::Dice

Special care must be taken when OTOBO runs within Docker. In this case, it seems an easy option to install the wanted module into the system Perl. However, due to how Docker works, this change would be lost when the container is restarted. Therefore the modules must be installed into a location that survives a restart. The local install location can be specified with the option --local-lib. Installed modules will be found by Perl because of the environment variables PERL5LIB and PATH, which are set-up accordingly in the Docker image.

otobo> cd /opt/otobo
otobo> cpanm --local-lib local Acme::Dice
Fetching ... OK
Configuring Acme-Dice-1.01 ... OK
Building and testing Acme-Dice-1.01 ... OK
Successfully installed Acme-Dice-1.01
1 distribution installed

otobo> perldoc -l Acme::Dice

otobo: echo $PERL5LIB

otobo: echo $PATH