Here is a nifty little script i put together for someone that was having problems like yours
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.#!/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";} }
Hope it helps.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.
In reply to Re: pl script in webserver
by huck
in thread pl script in webserver
by bigup401
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |