My host (iPage) does not have JSON.pm installed. I don’t want to use the modules they have installed (XML) in order to transfer data from a CGI script back to a web page. Is there anyway that I can use JSON without them installing it on Perl?
The reason I ask is because I noticed when I downloaded the JSON zip that I had to run a makefile json.pm command but I don’t have access to a Unix shell or a SSH terminal.
You should be able to install a local copy of the pure Perl version of the JSON module without shell access. Just download the
.tar.gzarchive to your own computer, unpack it and copy everything under thelibsubdirectory to a suitable location on your webhost.You’ll also need to tell Perl where to find the module, for which you need to know the filesystem path to which you copied the module. For example, if you copied the contents of the
libdirectory to/home/username/perl-libon your webhost, then you would include in your code the lines:Depending on how your webhost is configured, you might also be able to use
$ENV{HOME}to obtain the path to your home directory, so that you can write:or you could try using the FindBin module to find the path to the directory containing your script, and locate the
libdirectory from there (see the example in the FindBin documentation).