How to install Perl modules with CPAN🔗

Launch CPAN to initialise a personal configuration

perl -MCPAN -e shell

All default choices (especially [local::lib]) is OK

quit (q) cpan and start cpan again (to clean out the pid)

perl -MCPAN -e shell

quit (q) cpan again.

Edit the configuration file for cpan:

vi .cpan/CPAN/
  'build_requires_install_policy' => q[yes],                      <optional>
  'prefs_dir'                     => q[/cephyr/users/<CID>/Vera/.cpan/prefs],
  'prerequisites_policy'          => q[follow],                   <optional>

Then launch CPAN again with local::lib support (important!)

perl -MCPAN -Mlocal::lib -e shell

After that you can install Perl modules in standard cpan way (for example):

install CPAN::DistnameInfo
install parent
install Moose
install Bio::AssemblyImprovement

NOTE: - You need to explicitly call these Perl modules in your submission script later. - The modules are installed in ~/perl5/... - The cpan configuration is installed in ~/.cpan/... - If you export $PERL5LIB, check if all your modules are located in ~/perl5/lib/per5/ dir, OR if some of them actually are located in ~/perl5/lib/perl5/x86_64-linux-thread-multi/ dir. You might need to export that dir as well to make your Perl application work.