Here is a nifty little script i put together for someone that was having problems like yours

#!/usr/bin/perl use strict; use warnings; print "content-type: text/plain\n\nTesting Use commands\n\n"; #addin('Data::Dumper'); #addin('strict');addin('warnings'); #addin('Config');addin('Fcntl'); #addin('CGI::Carp qw(fatalsToBrowser)'); #addin('GD'); #addin('LWP::UserAgent'); addin('JSON'); addin('x::x'); sub addin { my $mod=shift; my $pre=shift; my %inc0=%INC; if ($pre) {print '<pre>'."\n";} print "\n"; print 'new to %INC from adding use '.$mod."\n"; eval 'use '.$mod.';' ; print 'eval use ERROR:'.$@."\n" if ($@); my %incnew=(); my $max=0; # this ends up as largest in %INC not largest that is new + , good nuf for my $k (keys %INC) { $max=length($k) if (length($k)>$max);} my $fmt=' %-'.$max.'s => %s'."\n"; for my $k (sort keys(%INC)) { printf $fmt,$k,$INC{$k} unless ($inc0{$k}); } if ($pre) {print '</pre>'."\n";} }
It is customized for your JSON instance, but you can put in any lines to load anymodule you like, as the comment out lines show.

It will either display what gets added to your program when a use statment is executed, or an error message like my example of x::x shows.

result for my server
Testing Use commands new to %INC from adding use JSON Carp.pm => /usr/share/perl/5.18/Carp.pm Exporter.pm => /usr/share/perl/5.18/Exporter.pm Exporter/Heavy.pm => /usr/share/perl/5.18/Exporter/Heavy.pm JSON.pm => /usr/share/perl5/JSON.pm JSON/XS.pm => /usr/lib/perl5/JSON/XS.pm XSLoader.pm => /usr/share/perl/5.18/XSLoader.pm attributes.pm => /usr/lib/perl/5.18/attributes.pm base.pm => /usr/share/perl/5.18/base.pm common/sense.pm => /usr/lib/perl5/common/sense.pm constant.pm => /usr/share/perl/5.18/constant.pm overload.pm => /usr/share/perl/5.18/overload.pm overloading.pm => /usr/share/perl/5.18/overloading.pm vars.pm => /usr/share/perl/5.18/vars.pm warnings/register.pm => /usr/share/perl/5.18/warnings/register.pm new to %INC from adding use x::x eval use ERROR:Can't locate x/x.pm in @INC (you may need to install th +e x::x module) (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 / +usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/ +perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at (eval 8 +) line 1. BEGIN failed--compilation aborted at (eval 8) line 1.
Hope it helps.


In reply to Re: pl script in webserver by huck
in thread pl script in webserver by bigup401

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.