require CPAN; require CPAN::Config; # configure cpan to go to pyro $CPAN::Config->{urllist} = [ q[http://server/cpan] ]; $CPAN::Config->{http_proxy} = q[]; $CPAN::Config->{ftp_proxy} = q[]; $CPAN::Config->{build_requires_install_policy} = q[yes]; $CPAN::Config->{prerequisites_policy} = q[follow]; # now get the modules from the config appropriate file my @packages = []; my @ppm_packages = []; my $common_package_file; my $os_package_file; my $ppm_package_file; if( $^O eq "MSWin32" ) { open( $common_package_file, 'p:\automation\commoncpan.txt' ) or die( "Unable to open common package file\n" ); open( $os_package_file, 'p:\automation\windowscpan.txt' ) or die( "Unable to open windows package file\n" ); open( $ppm_package_file, 'p:\automation\windowsppm.txt' ) or die( "Unable to open windows ppm package file\n" ); } elsif( $^O eq "linux" ) { open( $common_package_file, '/srv/automation/commoncpan.txt' ) or die( "Unable to open common package file\n" ); open( $os_package_file, '/srv/automation/linuxcpan.txt' ) or die( "Unable to open linux package file\n" ); } else { die( "ERROR: Unsupported OS\n" ); } @packages = <$common_package_file>; my $package; while( ($package = <$os_package_file>) ) { #just add the packages to the end of the array push( @packages, $package ); } @ppm_packages = <$ppm_package_file>; close( $common_package_file ); close( $os_package_file ); close( $ppm_package_file ); foreach my $line (@packages) { chomp( $line ); print( CPAN::install( $line ) ); } foreach my $line (@ppm_packages) { chomp( $line ); $ENV{http_proxy} = 'proxy'; print( `ppm install $line` ); }