$ perl -Mstrict -Mwarnings -E 'use Spreadsheet::XLSX; say $Spreadsheet
+::XLSX::VERSION'
Can't locate Spreadsheet/XLSX.pm in @INC (you may need to install the
+Spreadsheet::XLSX module) ...
I installed it without any problems:
$ cpan
...
cpan[1]> install Spreadsheet::XLSX
...
MIKEB/Spreadsheet-XLSX-0.15.tar.gz
/usr/bin/make install -- OK
Now, that earlier command works fine:
$ perl -Mstrict -Mwarnings -E 'use Spreadsheet::XLSX; say $Spreadsheet
+::XLSX::VERSION'
0.15
You need to install any non-core modules that you want to use, for each version of Perl that you install.
In case you haven't used Perlbrew before:
'perlbrew list' shows you the installed versions; and
'perlbrew switch <perlbrew-perl-version-name>' makes that version your current version.
You also could have a problem with shebang lines in your scripts.
Any that begin with lines like either of these:
#!/usr/bin/perl ...
#!/usr/local/bin/perl ...
will use one of the system Perls regardless of your current Perl (i.e. the one you switched to with Perlbrew).
I start all my scripts like this:
#!/usr/bin/env perl ...
That ensures the script always uses the current Perl:
there's nothing else to do when you switch between versions.
|