Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hiding INC directories from cpan, so as to install ALL dependencies of a module in a directory

I come across requirements to package a perl module with all its dependent modules, for systems where one cannot run cpan install (internet connectivity issues on production). However, from the linux system i can do cpan install, already have these modules installed. Is there a way i can mask the @INC directories from cpan command, and provide just one directory to look for all perl modules, so that it downloads all dependencies into that local directory.

Thanks in advance!!

like image 365
Hamzah Jamal Avatar asked Dec 14 '25 10:12

Hamzah Jamal


1 Answers

Take a look at lib::core::only and local::lib - the first excludes all non-core paths from @INC, the second makes it easy to set up a local perl module directory.

The combination should solve the problem.