Skip to content

Perl Module Dependencies Installation

doughphunghus edited this page Sep 1, 2020 · 8 revisions

Summary:

Once you get perl installed on your system (and are not using the system perl!) you will likely need to either isntall or update a few modules as the randomizer script uses some that may not come with your specific perl install/distribution.

Perl sometimes changes what modules are included in each version of perl to keep it small, and distribution packagers/authors of perl itself may decide to add or remove their own modules as they see fit. Because of this, we're going to check we have (or do not have) all the modules the randomizer script needs before moving on. If you skip this step and just run the randomizer script, perl will likely throw an error and tell you which module it cannot find, and then you can install it from the methods outlined here.

The modules the script uses, and we may need to install are:

XML::LibXML
JSON::Parse
POSIX
Getopt::Long
FindBin

Windows: (Windows 10 specifically):

Determine what modules are needed.

Open a powershell administrator command prompt. Keep this open.

For each module above, type this, substituting in the module name

perl -e "use XML::LibXML;"

If the module is installed/working, you will receive no output.

If the module is not installed, you will get something similar to "Can't locate XML::LibXML.pm...."

If you are missing some modules, install them using the perl CPAN module installer.

Type:

perl -MCPAN -e shell

This brings up the perl CPAN module installer.

For each module not installed, type this, substituting in the module name

install XML::LibXML

when you are done, exit the cpan module installer shell type:

quit

Unix (Ubuntu 20.04 specifically):

Determine what modules are needed.

Since we are using perlbrew, we can use perlbrew to install a nice CPAN nodule installer, Type: perlbrew install-cpanm

Once installed, For each module above, type this, substituting in the module name

cpanm XML::LibXML

If the module is installed/working, you will receive something similar to "XML::LibXML is up to date...".

If the module is not installed, the command to check it should install/upgrade it

Mac (OsX 10.14.6 specifically):

Use the Unix instructions above