#cpan-batch


 
#!/usr/local/bin/perl
# Batch mode install of CPAN modules for SpamAssassin and Amavisd-new

use CPAN;

@modlist = qw( MD5 LWP Mail::Internet Archive::Tar Archive::Zip IO::Wrap IO::Stringy Unix::Syslog MIME::Words MIME::Head MIME::Body MIME::Entity MIME::Parser Net::SMTP Net::DNS Net::Ping Net::Server Net::Server::PreForkSimple Convert::TNEF Convert::UUlib MIME::Decoder::Base64 MIME::Decoder::Binary MIME::Decoder::Gzip64 MIME::Decoder::NBit MIME::Decoder::QuotedPrint MIME::Decoder::UU Time::HiRes Digest::SHA1 Digest::Nilsimsa Getopt::Long File::Copy Bit::Vector Date::Calc);

# install my favorite programs if necessary:
for $mod (@modlist){
my $obj = CPAN::Shell->expand('Module',$mod);
$obj->install;
printf "%s module version available is %s\n", $obj->id, $obj->cpan_version;
}

##for $modu (CPAN::Shell->expand("Module","/./")){
## next unless $modu->inst_file;
## next if $modu->uptodate;
## printf "Module %s is installed as %s, could be updated to %s from CPAN\n", $modu->id, $modu->inst_version, $modu->cpan_version;
##}

exit;

sub PrintArray {
foreach my $i (@_) {
print STDOUT "$i\n";
}
}