Update: I've since discovered that I prefer cpanm

Using your code as a starter, here is what I'm using. I think it's a bit simpler not having to rewrite the FirstTime.pm file:
######################################## # Get CPAN::Config.pm initialized export PERL_MM_USE_DEFAULT=1 PERL_MM_NONINTERACTIVE=1 AUTOMATED_TESTIN +G=1 perl <<'EOT' || exit use strict; use Data::Dumper; # get the path to the library use Config; my $libpath = $Config{privlib}; # force CPAN::FirstTime to not default to manual # setup, since initial CPAN setup needs to be automated { local @ARGV = "$libpath/CPAN/FirstTime.pm"; my @source = <>; $source[72] =~ s/\byes\b/no/ or die "Could not auto configure CPAN"; eval join('', @source) or die "Error executing CPAN::FirstTime: $@"; } CPAN::FirstTime::init("$libpath/CPAN/Config.pm"); delete $CPAN::Config->{links}; $CPAN::Config->{auto_commit} = '0'; $CPAN::Config->{check_sigs} = '0'; $CPAN::Config->{halt_on_failure} = '0'; $CPAN::Config->{make_install_make_command} = '/usr/bin/make'; $CPAN::Config->{mbuild_arg} = ''; $CPAN::Config->{mbuildpl_arg} = ''; $CPAN::Config->{mbuild_install_arg} = ''; $CPAN::Config->{show_upload_date} = ''; $CPAN::Config->{tar_verbosity} = '1'; $CPAN::Config->{trust_test_report_history} = '0'; $CPAN::Config->{use_sqlite} = '0'; $CPAN::Config->{yaml_load_code} = '0'; $CPAN::Config->{urllist} = [q[ftp:...your list.../], q[http://...your list...]]; $CPAN::Config->{connect_to_internet_ok} = '1'; $CPAN::Config->{perl5lib_verbosity} = 'v'; $CPAN::Config->{prefer_installer} = 'MB'; $CPAN::Config->{build_requires_install_policy} = 'no'; $CPAN::Config->{term_ornaments} = '1'; $CPAN::Config->{mbuild_install_build_command} = './Build'; mkdir ".cpan/CPAN" or die "Can't create .cpan/CPAN: $!"; CPAN::Config->commit(".cpan/CPAN/MyConfig.pm"); CPAN::install('Bundle::CPAN'); #CPAN::force('install', ''); CPAN::install('JSON'); CPAN::install('JSON::XS'); exit 0; EOT

In reply to Re^5: Automating CPAN Configuration by runrig
in thread Automating CPAN Configuration by dsheroh

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.