Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

How to configure CPAN automatically?

by szabgab (Priest)
on Mar 17, 2015 at 06:38 UTC ( #1120273=perlquestion: print w/replies, xml ) Need Help??

szabgab has asked for the wisdom of the Perl Monks concerning the following question:

When on a newly compiled perl I try to run cpan it asks me if I want to automatically configure it. The thing is that I would like to eliminate even this question, just run the code and let it auto-configure itself. I tried yes | cpan but it got into an endless loop of
Refusing to autoload 'y' in recursion cpan[40953]> Refusing to autoload 'y' in recursion cpan[40954]> Refusing to autoload 'y' in recursion cpan[40955]>
Please, don't point me to cpanminus. I specifically need the cpan command.

Replies are listed 'Best First'.
Re: How to configure CPAN automatically?
by Anonymous Monk on Mar 17, 2015 at 07:22 UTC
      This ought to do it but it doesn't quite work for me , ignores the first arg, prompts for url list
      require CPAN::FirstTime; CPAN::FirstTime::init( 'GonerConfig.pm', autoconfig => 1 , );
Re: How to configure CPAN automatically?
by Anonymous Monk on May 09, 2016 at 19:38 UTC

    If you want multiple Enters, you can give the `yes` command a parameter of '' empty string.

    yes ''|cpan

    If you want just one Enter — as `cpan` only requires the first one to begin automatically deciding on the remainder of the prompts, you can just pipe in an `echo`.

    echo|cpan

    Alternatively, if you feed an empty pipe in, that also seems to work.

    cpan < /dev/null

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1120273]
Approved by Athanasius
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2020-05-26 13:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (150 votes). Check out past polls.

    Notices?