#!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 "Failure: $@"; } } 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();