1nickt has asked for the wisdom of the Perl Monks concerning the following question:
Hi all,
My understanding is that using JSON will cause Perl to load JSON::XS or Cpanel::JSON::XS if they are installed. But my testing shows that JSON::PP is used:
$ perl -MJSON -e 1 $ perl -MJSON::XS -e 1 Can't locate JSON/XS.pm in @INC (you may need to install the JSON::XS +module) [...] BEGIN failed--compilation aborted. $ perl -MCpanel::JSON::XS -e 1 $ perl -MJSON -MData::Dumper -wE 'decode_json(qq{{"foo":"bar"}}); say +Dumper %INC;' | grep JSON $VAR33 = 'JSON/PP.pm'; $VAR34 = '/Users/ntonkin/perl5/perlbrew/perls/perl-5.26.1/lib/5.26.1/J +SON/PP.pm'; $VAR37 = 'JSON.pm'; $VAR38 = '/Users/ntonkin/.perlbrew/libs/perl-5.26.1@dev/lib/perl5/JSON +.pm';
Anything I have missed?
The way forward always starts with a minimal test.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: JSON not loading Cpanel::JSON::XS
by dasgar (Priest) on Apr 16, 2018 at 15:52 UTC | |
by 1nickt (Canon) on Apr 16, 2018 at 16:01 UTC | |
Re: JSON not loading Cpanel::JSON::XS
by Haarg (Priest) on Apr 17, 2018 at 10:04 UTC | |
by 1nickt (Canon) on Apr 17, 2018 at 13:25 UTC |
Back to
Seekers of Perl Wisdom