perl_modules
Differences
This shows you the differences between two versions of the page.
| perl_modules [2024/05/06 13:53] – created admin | perl_modules [2024/05/06 16:53] (current) – admin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | **Install Perl Modules In Your Scratch Directory** | + | === Install Perl Modules In Your Scratch Directory=== |
| The <wrap hi> | The <wrap hi> | ||
| 1. Start with Creating a Perl configuration file, | 1. Start with Creating a Perl configuration file, | ||
| - | | + | <code bash> |
| + | $ perl -MCPAN -e ' | ||
| + | CPAN:: | ||
| + | Running configuration again... | ||
| + | |||
| + | </ | ||
| + | Answer yes to the question on automatic configuration, | ||
| + | |||
| + | <code bash> | ||
| + | Would you like to configure as much as possible automatically? | ||
| + | ... | ||
| + | What approach do you want? (Choose ' | ||
| + | | ||
| + | ... | ||
| + | </ | ||
| + | |||
| + | Next you will be offered some user environment variables that can be added to your path, answer no. | ||
| + | <code bash> | ||
| + | PATH="/ | ||
| + | PERL5LIB="/ | ||
| + | PERL_LOCAL_LIB_ROOT="/ | ||
| + | PERL_MB_OPT=" | ||
| + | PERL_MM_OPT=" | ||
| + | |||
| + | Would you like me to append that to / | ||
| + | |||
| + | </ | ||
| + | where <wrap hi> | ||
| + | |||
| + | ===Configure CPAN To Install In Your Scratch Directory=== | ||
| + | Run: | ||
| + | <code bash> | ||
| + | perl -MCPAN -e shell | ||
| + | </ | ||
| + | In the perl shell, run the following: | ||
| + | |||
| + | <code perl> | ||
| + | cpan[1]> o conf makepl_arg INSTALL_BASE=/ | ||
| + | </ | ||
| + | |||
| + | this will install you perl modules in <wrap hi>/ | ||
| + | At the next CPAN prompt, enter: | ||
| + | |||
| + | <code perl> | ||
| + | cpan[2]> o conf commit | ||
| + | cpan[3]> exit | ||
| + | </ | ||
| + | |||
| + | === Installing Your Modules=== | ||
| + | To install a module, run the following on the shell | ||
| + | <code bash> | ||
| + | $ perl -MCPAN -Mlocal:: | ||
| + | </ | ||
| + | |||
| + | ===Using you modules=== | ||
| + | The <wrap hi> | ||
| + | |||
| + | <code perl> | ||
| + | # | ||
| + | use strict; | ||
| + | use local:: | ||
| + | use Math:: | ||
| + | |||
| + | </ | ||
| + | |||
| + | ===Adding your Perl Modules to your PATH=== | ||
| + | Add the following to your .bashrc or your shell environment, | ||
| + | <code bash> | ||
| + | PATH="/ | ||
| + | PERL5LIB="/ | ||
| + | PERL_LOCAL_LIB_ROOT="/ | ||
| + | PERL_MB_OPT=" | ||
| + | PERL_MM_OPT=" | ||
| + | </ | ||
| + | Do this, and re-login before installing any perl module. Remember to replace " | ||
| - | Take the time to review the information below: | ||
| - | * [[overview|overview]] | ||
| - | * [[How To Get Access|How To Get Access]] | ||
| - | * [[Getting Started|Getting Started]] | ||
| - | * [[HPC Assistance|HPC Assistance]] | ||
| - | * [[Perl Modules|Install Perl Modules]] | ||
perl_modules.txt · Last modified: 2024/05/06 16:53 by admin
