As for suppressing prompts, properly-coded versions of Makefile.PL and Build.PL should not prompt (and take the default) if environment variable PERL_MM_USE_DEFAULT is set to a true value. This is documented in the ExtUtils::MakeMaker and Module::Build::API documentation, respectively.

The situation on tests that prompt is more confusing. The Oslo Consensus says to set environment variable AUTOMATED_TESTING where there is no recourse to a human operator. One of my first modules (before the Oslo Consensus' date of 2008) drew as its first RT ticket a complaint that I should respond to this environment variable, so I suspect that CPAN modules will generally respond to it. The Lancaster Consensus talks about setting NONINTERACTIVE_TESTING, but I do not know how wide-spread this is.

Of course, none of this works with ill-behaved installations. A first cut might be to re-open STDIN on the null device -- but of course if the installation is ill-behaved, who knows what that will do?

For specific modules, it is also possible that their Makefile.PL or Build.PL files will respond to command-line options if these are specified. The CPAN client provides a mechanism for configuring individual distributions, which I believe can provide arguments to Makefile.PL or Build.PL. See 'Distroprefs' in the 'CPAN' documentation (NOT 'cpan', which may be a problem if you have a case-blind file system). I can't speak to CPANP or cpanm


In reply to Re: Programmatically installing modules by Anonymous Monk
in thread Programmatically installing modules by morgon

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.