Last Updated: February 25, 2016
·
834
· ukautz

Install a perl modul in given directory

Sometimes it's handy to install your perl modules into another directory than ~/perl5 or your default directories. Especially if you want to test different versions of a module or need different versions for different apps.

Here is a small bash script to do so: http://pastebin.com/6Kb2xdz7

Copy & save in /usr/local/bin/perl-install-dir (or so)

Usage:

perl-install-dir /opt/my-app DBIx::Simple YAML

or skip tests:

FORCE_INSTALL=1 perl-install-dir /opt/my-app DBIx::Simple YAML

In your perl script:

...
use lib '/opt/my-app/lib/perl5';
use DBIx::Class;
use YAML;
...