3

I am trying to install these packages in a local directory to use with AWS Lambda.

cpan Crypt::CBC . 
cpan Crypt:OPENSSL::AES .
cpan Crypt:Rijndael packages .

I don't think they are being installed correctly. How do I make sure they are installed in the local directory

Aaron
  • 1,345
  • 2
  • 13
  • 32
  • 1
    See [local::lib](https://metacpan.org/pod/local::lib). – Corion Feb 26 '19 at 21:55
  • Possible duplicate of [Installing PERL CPAN modules in local directory](https://stackoverflow.com/questions/7072101/installing-perl-cpan-modules-in-local-directory) – Håkon Hægland Feb 26 '19 at 22:02
  • Aavoid headaches now and later by installing a local `perl` (e.g. using `perlbrew`) then using `cpan Foo::Bar`. – ikegami Feb 26 '19 at 23:04

1 Answers1

1

With cpanm:

cpanm -l local Crypt::CBC

Then in your script:

use lib '/path/to/local/lib/perl5';

lib::relative could be used with a relative path instead of absolute.

Or when running your script:

$ perl -I/path/to/local/lib/perl5 script.pl
Grinnz
  • 9,093
  • 11
  • 18
  • For `cpan Crypt:OPENSSL::AES` and `cpan Crypt:Rijndael packages`, I am getting `Couldn't find module errors.` – Aaron Feb 27 '19 at 02:47
  • 1
    @Aaron You misspelled the module names. The first one is spelled `Crypt::OpenSSL::AES` (note it is also case sensitive) and you missed half of the double-colon in the second one. – Grinnz Feb 27 '19 at 03:37