in reply to Re: DBD::SQLite - Standalone on webserver via FTP?
in thread DBD::SQLite - Standalone on webserver via FTP?
Better yet, just have that CGI script use CPAN. Here's a (completely untested) outline of a "cpan_installer.cgi" script:
#!perl use CGI qw/:standard/; use CPAN; print header(); if ( my $module = param('module') ) { print start_html("Installing $module"), h1("Installing $module"); $ENV{PREFIX} = '~'; eval { CPAN::Shell->expand('Module',$module)->install }; if ( $@ ) { print "<font color=red>Failure: $@</font>"; } } else { print start_html("CPAN Installer Tool"), h1("CPAN Installer Tool"); print start_form(), textfield('module', ""), submit('install', "Click to Install"), end_form(); } print end_html();
Properly fitted out with some logic to detect common configuration problems and extra form controls to allow futzing with the make process, this might serve as a useful resource... I notice a routine stream of postings along the lines of "I only have FTP and CGI access on my web server account, and want to install X." It'd be nice if we could reply with something like "Just upload this script and it will either guide you through the process, or explain why it can't be done on your server."
Update: On second thought, this is more complicated than the above suggests; for example, we may need to deal with configuring CPAN for the first time, which this script doesn't do... But I still think that a suitably enhanced "cpan.cgi" script could be useful to many.
|
|---|