3

I have a webapp which uses an older version of Perl. I therefore installed an independent Perl version using perlbrew, made a symlink /usr/bin/perlx and changed the path in all my perl files. However, I still have some problems with the additional modules that I've installed. If I try to start the webapp, I get an error message:

Can't locate JSON/XS.pm in @INC (@INC contains: /opt/perlbrew/perls/perl-5.10.1/lib/5.10.1/x86_64-linux /opt/perlbrew/perls/perl-5.10.1/lib/5.10.1 /opt/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux /opt/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1 .) at ism/readfn.pm line 42.

According to cpan -i JSON::XS, the module is installed:

JSON::XS is up to date (2.33)

However, find /opt/ -name 'XS.pm' only prints other locations:

/opt/perlbrew/perls/perl-5.10.1/lib/5.10.1/x86_64-linux/List/Util/XS.pm /opt/perlbrew/perls/perl-5.10.1/lib/5.10.1/ExtUtils/Constant/XS.pm /opt/perlbrew/build/perl-5.10.1/ext/List-Util/lib/List/Util/XS.pm /opt/perlbrew/build/perl-5.10.1/lib/List/Util/XS.pm /opt/perlbrew/build/perl-5.10.1/lib/ExtUtils/Constant/XS.pm /opt/perlbrew/build/perl-5.10.1/t/lib/MakeMaker/Test/Setup/XS.pm

Any idea? Thanks in advance!

Andreas
  • 736
  • 6
  • 15

1 Answers1

2

Check to see if your cpan is working with the same perl as the one that says that you don't have JSON::XS installed:

which perl
which cpan
Tudor Constantin
  • 26,330
  • 7
  • 49
  • 72
  • I've started cpan directly from the perlbrew version: /opt/perlbrew/perls/perl-5.10.1/bin/cpan – Andreas Oct 17 '12 at 10:35
  • Did you fix this problem? If Tudor's suggestion shows that the correct Perl is being referenced, try removing the shebang line from your .pl file(s), and executing it: "perl example.pl" – David Farrell Oct 18 '12 at 12:11
  • Well, this took some time... I've installed a second cpan using `/opt/perlbrew/perls/perl-5.10.1/bin/cpan App::cpanminus`, however, I simply forgot to switch the Perl version! – Andreas Oct 22 '12 at 12:05