title: Installed JSON module for Perl but cannot load it, Can't locate JSON.pm in @INC
body: <p></p>
  
  <p>I installed <a href="http://search.cpan.org/~makamaka/JSON-2.90/lib/JSON.pm" rel="nofollow noreferrer">JSON</a> for PERL with command:</p>
  
  <pre class="lang-none prettyprint-override"><code>sudo perl -MCPAN -e 'install JSON'
  </code></pre>
  
  <p>but I cannot use it, <code>use JSON;</code> causes to  error:</p>
  
  <blockquote>
    <p>Can't locate JSON.pm in @INC (you may need to install the JSON module)<br>
    (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level<br>
    /Library/Perl/5.18<br>
    /Network/Library/Perl/5.18/darwin-thread-multi-2level<br>
    /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2<br>
    /System/Library/Perl/5.18/darwin-thread-multi-2level<br>
    /System/Library/Perl/5.18<br>
    /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level<br>
    /System/Library/Perl/Extras/5.18 .) at<br>
    /Users/snaggs/Appsflyer/projects/build-machine-sdk/scripts/build_ios.pl
    line 13. BEGIN failed--compilation aborted at
    /Users/snaggs/Appsflyer/projects/build-machine-sdk/scripts/build_ios.pl
    line 13.</p>
  </blockquote>
  
  <p><code>ls -l /Users/snaggs/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0/JSON/</code> gives me:</p>
  
  <pre class="lang-none prettyprint-override"><code>drwxr-xr-x  3 snaggs  staff    102 Nov 29 12:53 PP
  -r--r--r--  1 snaggs  staff  82532 Nov 29 12:53 PP.pm
  </code></pre>
  
  <p><code>$ perl -V</code> gives me:</p>
  
  <pre class="lang-none prettyprint-override"><code>Summary of my perl5 (revision 5 version 16 subversion 0) configuration:
  
    Platform:
      osname=darwin, osvers=16.1.0, archname=darwin-2level
      uname='darwin snaggss-macbook-pro.local 16.1.0 darwin kernel version 16.1.0: thu oct 13 21:26:57 pdt 2016; root:xnu-3789.21.3~60release_x86_64 x86_64 '
      config_args='-de -Dprefix=/Users/snaggs/perl5/perlbrew/perls/perl-5.16.0 -Aeval:scriptdir=/Users/snaggs/perl5/perlbrew/perls/perl-5.16.0/bin'
      hint=recommended, useposix=true, d_sigaction=define
      useithreads=undef, usemultiplicity=undef
      useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
      use64bitint=define, use64bitall=define, uselongdouble=undef
      usemymalloc=n, bincompat5005=undef
    Compiler:
      cc='cc', ccflags ='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include',
      optimize='-O3',
      cppflags='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
      ccversion='', gccversion='4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)', gccosandvers=''
      intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
      d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
      ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
      alignbytes=8, prototype=define
    Linker and Libraries:
      ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -fstack-protector -L/usr/local/lib'
      libpth=/usr/local/lib /usr/lib
      libs=-lgdbm -ldbm -ldl -lm -lutil -lc
      perllibs=-ldl -lm -lutil -lc
      libc=, so=dylib, useshrplib=false, libperl=libperl.a
      gnulibc_version=''
    Dynamic Linking:
      dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
      cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector'
  
  
  Characteristics of this binary (from libperl): 
    Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV
                          PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_ALL
                          USE_64_BIT_INT USE_LARGE_FILES USE_LOCALE
                          USE_LOCALE_COLLATE USE_LOCALE_CTYPE
                          USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
    Locally applied patches:
      Devel::PatchPerl 1.38
    Built under darwin
    Compiled at Nov 29 2016 12:51:12
    %ENV:
      PERLBREW_BASHRC_VERSION="0.78"
      PERLBREW_HOME="/Users/snaggs/.perlbrew"
      PERLBREW_MANPATH="/Users/snaggs/perl5/perlbrew/perls/perl-5.16.0/man"
      PERLBREW_PATH="/Users/snaggs/perl5/perlbrew/bin:/Users/snaggs/perl5/perlbrew/perls/perl-5.16.0/bin"
      PERLBREW_PERL="perl-5.16.0"
      PERLBREW_ROOT="/Users/snaggs/perl5/perlbrew"
      PERLBREW_VERSION="0.78"
    @INC:
      /Users/snaggs/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/darwin-2level
      /Users/snaggs/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0
      /Users/snaggs/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0/darwin-2level
      /Users/snaggs/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0
  </code></pre>