Perl modules for the PanLex tools

Module installer (cpanm)Up

The effective use of Perl requires invoking various modules, not all of which are installed by default. To install needed modules easily, you can use a Perl module installer. The simplest and best of these is cpanm. To check whether cpanm is already installed, enter cpanm -h to get a list of basic cpanm commands. This command will fail if cpanm is not installed.

The appropriate command to install cpanm depends on whether you need administrator privileges to install perl modules. You generally need administrator privileges unless you installed Perl with Perlbrew or are running Perl under Cygwin. If you need administrator privileges, the installation command is curl -L | perl - --sudo App::cpanminus; enter your password when prompted. Otherwise, the command is curl -L | perl - App::cpanminus. If all goes well, you will now be able to use cpanm to install Perl modules.

Exhaustive documentation on cpanm is available through the usual man facility (man cpanm). The basic command for installing any module X::Y is just cpanm X::Y. If you need administrator privileges to install modules (see above), you need to enter sudo cpanm X::Y. Otherwise, you should enter cpanm X::Y without sudo. If you encounter any errors with cpanm, you can specify the -v option for verbose console output.

Installing modules required by the PanLex tools

The PanLex tools require several perl modules in order to run. After cloning the git repository, to install the required modules you should change to the panlex-tools directory and run cpanm --installdeps --with-recommends .. Depending on your Perl installation, you may need to prefix this command with sudo (see above).

Leave a Reply