As far as "packaging" scripts to run without modules pre-installed....
If you can assume that Perl is present, you can write a mini-program to look for modules, e.g.
unless ( eval " use Tk; " ) {
&do_install ('Tk');
}
exec "my-real-program.plx";
# ...
sub do_install ($) {
my $pkg = shift;
print "Installing $pkg module...";
if ($^O =~ /win/i) {
`ppm install $pkg.PPD`;
} else {
chdir ('unix_pkg');
`tar -zxf $pkg.tar.gz`;
chdir ($pkg);
require "Makefile.PL";
`sudo gmake install`;
}
}
The above code is both untested (ergo probably nonfunctional and nonportable) and ugly, but it's near enough to what I've used in a pinch before.