This tutorial describes the installation of Perl modules in your $HOME directory without root privileges. The underlying idea is to install the module local::lib in your $HOME first, which then configures your working directory to place all modules installed by cpanm in $HOME.
Installing local::lib
First of all Perl 5.26 has to be loaded with module load. This version of Perl comes with cpanm installed.
$ module load devel/perl/5.26
After that you have to change into $HOME and install local::lib.
Having a properly configured working environment is crucial to the execution of programs. For instance, it determines the availability of programs and their versions. Therefore we will take a look at the environment variables that are relevant for a Perl environemnt. You don't have to touch them just to install new modules but they help in understanding how Perl searches for installed modules.
By default, Perl looks for a module in a number of specific directories. If it cannot find the module it returns an error message like the following:
. Perl is now using completely different directories to find modules. We are simply going to add $HOME to that list. Furthermore we use local::lib to tell cpanm to install new modules in $HOME.
Use the following lines to temporarily (until you logout) modify your environment:
You can also put all of the lines above in your ~/.bashrc to run them automatically whenever you log in.
Installing new modules
Finally we can install modules using cpanm, which offers dependency management and improved error messages compared to cpan. As an example we will install the module Path::Tiny.
Note that modules installed in $HOME won't be found automatically if you log in again and didn't put the environment modifications in your ~/.bashrc.
$ cpanm Path::Tiny
Removing modules
Cpanm can also be used to remove modules.
$ cpanm --uninstall Path::Tiny
Resetting your working environment
If you made a mistake while configuring your environment variables and didn't modify your ~/.bashrc, simply logging out and back in will restore the environment.
In case you modified ~/.bashrc you need to remove the lines you added first and then log out and back in again.
If you want to remove the files created during this tutorial run:
Our website uses cookies. Some of them are mandatory, while others allow us to improve your user experience on our website. The settings you have made can be edited at any time.
or
Essential
in2code
Name
in2cookiemodal-selection
Use
Required to save the user selection of the cookie settings.
Lifetime
3 months
Name
be_lastLoginProvider
Use
Required for the TYPO3 backend login to determine the time of the last login.
Lifetime
3 months
Name
be_typo_user
Use
This cookie tells the website whether a visitor is logged into the TYPO3 backend and has the rights to manage it.
Lifetime
Browser session
Name
ROUTEID
Use
These cookies are set to always direct the user to the same server.
Lifetime
Browser session
Name
fe_typo_user
Use
Enables frontend login.
Lifetime
Browser session
Videos
in2code
Name
iframeswitch
Use
Used to show all third-party contents.
Lifetime
3 months
YouTube
Name
yt-player-bandaid-host
Use
Is used to display YouTube videos.
Lifetime
Persistent
Name
yt-player-bandwidth
Use
Is used to determine the optimal video quality based on the visitor's device and network settings.
Lifetime
Persistent
Name
yt-remote-connected-devices
Use
Saves the settings of the user's video player using embedded YouTube video.
Lifetime
Persistent
Name
yt-remote-device-id
Use
Saves the settings of the user's video player using embedded YouTube video.
Lifetime
Persistent
Name
yt-player-headers-readable
Use
Collects data about visitors' interaction with the site's video content - This data is used to make the site's video content more relevant to the visitor.
Lifetime
Persistent
Name
yt-player-volume
Use
Is used to save volume preferences for YouTube videos.
Lifetime
Persistent
Name
yt-player-quality
Use
Is used to save the quality settings for YouTube videos.
Lifetime
Persistent
Name
yt-remote-session-name
Use
Saves the settings of the user's video player using embedded YouTube video.
Lifetime
Browser session
Name
yt-remote-session-app
Use
Saves the settings of the user's video player using embedded YouTube video.
Lifetime
Browser session
Name
yt-remote-fast-check-period
Use
Saves the settings of the user's video player using embedded YouTube video.
Lifetime
Browser session
Name
yt-remote-cast-installed
Use
Saves the user settings when retrieving a YouTube video integrated on other web pages
Lifetime
Browser session
Name
yt-remote-cast-available
Use
Saves user settings when retrieving integrated YouTube videos.
Lifetime
Browser session
Google
Name
ANID
Use
Used for targeting purposes to profile the interests of website visitors in order to display relevant and personalized Google advertising.
Lifetime
2 years
Name
SNID
Use
Google Maps - Google uses these cookies to store user preferences and information when you view pages with Google Maps.
Lifetime
1 month
Name
SSID
Use
Used to store information about how you use the site and what advertisements you saw before visiting this site, and to customize advertising on Google resources by remembering your recent searches, your previous interactions with an advertiser's ads or search results, and your visits to an advertiser's site.
Lifetime
6 months
Name
1P_JAR
Use
This cookie is used to support Google's advertising services.
Lifetime
1 month
Name
SAPISID
Use
Used for targeting purposes to profile the interests of website visitors in order to display relevant and personalized Google advertising.
Lifetime
2 years
Name
APISID
Use
Used for targeting purposes to profile the interests of website visitors in order to display relevant and personalized Google advertising.
Lifetime
6 months
Name
HSID
Use
Includes encrypted entries of your Google account and last login time to protect against attacks and data theft from form entries.
Lifetime
2 years
Name
SID
Use
Used for security purposes to store digitally signed and encrypted records of a user's Google Account ID and last login time, enabling Google to authenticate users, prevent fraudulent use of login credentials, and protect user data from unauthorized parties. This may also be used for targeting purposes to display relevant and personalized advertising content.
Lifetime
6 months
Name
SIDCC
Use
This cookie stores information about user settings and information for Google Maps.
Lifetime
3 months
Name
NID
Use
The NID cookie contains a unique ID that Google uses to store your preferences and other information.
Lifetime
6 months
Name
CONSENT
Use
This cookie tracks how you use a website to show you advertisements that may be of interest to you.
Lifetime
18 years
Name
__Secure-3PAPISID
Use
This cookie is used to support Google's advertising services.
Lifetime
2 years
Name
__Secure-3PSID
Use
This cookie is used to support Google's advertising services.
Lifetime
6 months
Name
__Secure-3PSIDCC
Use
This cookie is used to support Google's advertising services.