How to install Perl modules on a Unix / Linux server

From the command line, as the root user, run:

  # perl -MCPAN -e shell

And then at the cpan command line run:

  cpan> install Module::Name

Alternatively, using sudo on one line, as any user you can directly intall a module by running:

sudo perl -MCPAN -e 'install Module::Name'