Can I install my own Perl CPAN modules?
If you use Perl scripts, you’ll find our servers have many Perl CPAN modules already installed, but you can also add your own “local” modules.
For example, let’s say your script needs the Text::Lorem module, but you find it isn’t preinstalled when you try running this script:
#!/usr/bin/perl use Text::Lorem; print Text::Lorem->new()->words(5);
... and get the error “Can't locate Text/Lorem.pm in @INC (you may need to install the Text::Lorem module)”.
To fix this, you can install it for your account from the command-line shell using the cpanm command. First run this in your shell session to tell cpanm to save any installed modules locally:
eval `perl -Mlocal::lib`
Then run:
cpanm Text::Lorem
New modules will be installed by default in the /perl5/lib/perl5 directory of your home directory, so you then need to add this line to your Perl scripts:
use lib '/home/ex/example.com/perl5/lib/perl5';
So the complete script will now look like:
#!/usr/bin/perl use lib '/home/ex/example.com/perl5/lib/perl5'; use Text::Lorem; print Text::Lorem->new()->words(5);
After doing that, the script works.
If your project has a cpanfile, you can install any missing dependencies automatically by running this command in the same directory as the cpanfile:
cpanm --installdeps --notest .
That will install any runtime dependencies that aren't already installed on our servers. If you want to limit these dependencies to a particular project, you can install them in folder named local within the project root:
cpanm -l local --installdeps --notest .
#!/usr/bin/perl use FindBin; use lib "$FindBin::Bin/local/lib/perl5"; use Text::Lorem; print Text::Lorem->new()->words(5);
Copyright © 2000-2026 Tiger Technologies LLC