Is there a way to prevent CPAN/modules from asking question or auto answering them when installing them. I have the script at the bottom of this post that works great for most modules but there are some modules or CPAN that ask questions during an install, don't time out and don't have an obvious way of overriding it. The current problem I have might be CPAN (not 100% positive). I get "Do you want to install lwp-request? y" for libwww-perl-5.812. It never times out and isn't auto answered by the build_requires_install_policy

Any ideas?

-------
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` ); }

In reply to CPAN Modules asking questions by diabelek

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.