View Full Version : Invoking Perl
My ISP has said that this line shall enable me to find all the modules that they have installed on the server.
#!/usr/bin/perl -w
invoke perl @ /usr/bin/perl;
It isn't working and in the absense of a response from them I wonder if any of you can see an error in it.
bazz
FishMonger
03-07-2006, 07:33 PM
I can't see why they would say that code would tell you what modules were installed.
try this:
#!/usr/bin/perl -w
use ExtUtils::Installed;
my $inst = ExtUtils::Installed->new();
my @modules = $inst->modules();
foreach (@modules) { print "$_\n"; }
http://perldoc.perl.org/perlfaq3.html
Thank you FishMonger but I get an error 500 page with that.
I added
use CGI::Carp qw(fatalsToBrowser);
and still get the 'error 500' page. :(
bazz
FishMonger
03-07-2006, 07:56 PM
Did you print the content-type header?
#!/usr/bin/perl -w
use CGI::Carp qw(fatalsToBrowser);
use ExtUtils::Installed;
my $inst = ExtUtils::Installed->new();
my @modules = $inst->modules();
print "Content-Type: text/plain\n\n";
foreach (@modules) { print "$_\n"; }
uh? How did I forget that. :o
Anyway, all it says is 'Perl'. SO I guess that means there is only the standard range of modules that come with Perl.
bazz
FishMonger
03-07-2006, 08:24 PM
That's odd, it printed all of the module names for me.
Try this method.
#!/usr/bin/perl -w
use File::Find;
my @files;
print "Content-Type: text/plain\n\n";
find( sub {
push @files, $File::Find::name
if -f $File::Find::name && /\.pm$/
},
@INC
);
print join "\n", @files;
Yup, that did it, Thanks.
Of course, it doesn't have installed, the one I want - Date::Calc. :(
bazz
hyperbole
03-08-2006, 07:35 PM
There is a version of Date::Calc called Date::Pcalc that is written totally in perl that you can install on your site as a module in a directory of your choosing. I have it running on my site because my site host doesn't provide Date::Calc either.
.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.