in reply to Can't locate JSON.pm in @INC

First, do this:

perl -V
with a capital -V ...

This will give you, among a great many other things, a complete list of all the places that Perl will look for anything, and the sequence in which it will look for them.   (Within a running Perl program, this is accessible as the array-variable, @INC ...)

If Perl cannot find a module, yet cpan can, it simply means that the two are not looking in the same places.   (And, by the way, this is by design ...)

Generally speaking, this information is provided by an “environment variable” named PERL5LIB.   On a Unix-like system, this will most-likely be set by a local script (e.g. .bash_profile.   On a Windows system, this will be set in the registry and/or in the System control-panel, or by a profile.

In any case, perl -V with a capital-V will tell you “what Perl actually knows,” drawing from all of its various sources of information.   “When the rubber finally hits the road,” the list that Perl will obligingly give to you is its authority.