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

i have given a private url in configuration which requires user name and password for access.
connect to internet is no
when i run cpan
cpan>install xyz
Warning: no success downloading '/root/.cpan/sources/authors/01mailrc.txt.gz.tmp1302'. Giving up on it. at /usr/lib/perl5/5.10.1/CPAN/Index.pm line 225
please help!!! it is not e1 asking me for user name and password

Replies are listed 'Best First'.
Re: problem with cpan configuration
by Corion (Patriarch) on Oct 17, 2011 at 08:17 UTC

    Then you need to reconfigure CPAN. Start the CPAN shell and type

    o conf init

    Or alternatively, install a local copy of the CPAN using CPAN::Mini.

      i have done o conf init but still nothing changed
      i dnt know y it is not asking me for username and password?
      may be it is taking some default username and password
      can you help in .wgetrc file in root???

        Please consult with your system administrator on how to reach the outside internet and what settings are necessary.

Re: problem with cpan configuration
by JavaFan (Canon) on Oct 17, 2011 at 08:38 UTC
    As far as I know, CPAN will not ask for a user name and password. But you should be able to use the username/password form of the URL.

      http://search.cpan.org/grep?cpanid=ANDK&release=CPAN-1.9800&string=prompt&i=1&n=1&C=0

      1079: $CPAN::Frontend->myprint($prompts{proxy_user}) unless + $auto_config; 1081: if ($CPAN::Config->{proxy_user} = prompt("Your proxy +user id?",$default)) { 1082: $CPAN::Frontend->myprint($prompts{proxy_pass}) un +less $auto_config; 1087: $CPAN::Frontend->myprint($prompts{password_wa +rn}) unless $auto_config; 1089: $CPAN::Config->{proxy_pass} = prompt_no_strip("Yo +ur proxy password?");
      lib/CPAN/HTTP/Credentials.pm 36: my $username_prompt = "\nProxy authentication needed! 42: _get_username_and_password_from_user($username_prompt); 56: my $username_prompt = "\nAuthentication needed! 63: _get_username_and_password_from_user($username_prompt); 71: ExtUtils::MakeMaker->import(qw(prompt)); 72: $username = prompt($username_message); 81: $password = prompt("Password:");
Re: problem with cpan configuration
by locked_user sundialsvc4 (Abbot) on Oct 17, 2011 at 12:16 UTC

    Please take it the right way when I say:   “Stop, and figure it out.”

    There are several possibilities here, which might be informed by other messages you haven’t listed here, such as:

    • Incorrect specification of which server to contact.
    • Unable to log on to that server.
    • No read/write access by your user-id to the target directory on your system.
    • etc...

    On the one hand, CPAN is quite confusing to get to know ... well do I remember how it fuddled me.   But on the other hand, the first thing they tell you to do when you’re lost in the woods is to stop.   You need to gather clues from the messages surrounding the one that you have reported.   None of us here can respond meaningfully to what you have posted because we have no way to know, either the whole of what you actually did, or the whole of what the computer actually said ...

Re: problem with cpan configuration
by Anonymous Monk on Oct 17, 2011 at 08:15 UTC

    What did you do exactly? Put some values in $HOME/CPAN/MyConfig.pm? What documentation are you referencing?