1

I was using JSON.pm from CPAN till now to parse a JSON file. But now i am told to use linux libraries instead of CPAN module so i installed libjson-perl on my debian system and removed the line use JSON from my code but now it is showing error.

Can anyone tell me how to use libraries instead of CPAN modules?

shivams
  • 2,597
  • 6
  • 25
  • 47

2 Answers2

4

On Debian, packages like libjson-perl only install JSON.pm (and its documentation) in a place Perl can access it. This is not using "Linux libraries", it is merely an alternative to installing the module (minus its dependencies) from CPAN.

If what you need is to avoid using Perl but use an external tool instead, this answer to another question here may interest you.

Community
  • 1
  • 1
Joseph R.
  • 785
  • 4
  • 11
2

I can only guess as to why you were "told" to use "linux libraries" instead of JSON.pm but perhaps performance is an issue. JSON::XS is an XS (C complied) implementation of json enc/dec. The JSON.pm actually uses this module if it is installed, otherwise falling back to the pure-perl, JSON::PP implementation.

FunkyShu
  • 138
  • 5