anindita.81 has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to install the Log::Dispatch module using CPAN. I get the following error when trying to do so:
perl -MCPAN -e 'install Log::Dispatch' CPAN: Storable loaded ok Going to read /root/.cpan/Metadata Warning: Found only 0 objects in /root/.cpan/Metadata CPAN: LWP::UserAgent loaded ok Fetching with LWP: http://cpansearch.perl.org/src/authors/01mailrc.txt.gz LWP failed with code[500] message[Can't connect to cpansearch.perl.org +:80 (Bad hostname 'cpansearch.perl.org')].. .. ..
I am using CPAN for the first time. Can anyone please suggest what needs to be done? Thanks in advance

Replies are listed 'Best First'.
Re: Error using CPAN to install modules
by marto (Cardinal) on Nov 19, 2010 at 12:32 UTC

    Welcome to the Monastery!

    Are you behind a proxy/firewall? This may need some configuration. If you run cpan from the command line, if it's your first time running it you'll get asked a bunch of questions about various configurations options.

    Also when posting code, output or error messages please use <code></code> like so:

    #!/usr/bin/perl

      I have tried to ping cpansearch.perl.org and it returns the message of unknown host.

        Is the computer in question able to access the internet at all? If not speak to your systems/network administrator. You've not told anything about the operating system in use, or the network to which it is connected. It could be something as simple as a firewall/proxy issue. The CPAN documentation covers this.

        If it's intentional that this server has no internet access, you could create a minimal mirror of CPAN on a system which does have internet access, and transfer it to the other system via CD/DVD/USB. See minicpan for further details of this.

        How do I post a question effectively? may be worth reading since you are new here.

Re: Error using CPAN to install modules
by roc (Sexton) on Nov 19, 2010 at 13:18 UTC

    why don't you try it manually...download the module from cpan and install it step by step...it may help if you have any configuration problem.

      I am trying to install Log:::Dispatch module and it has lot of depebdencies which have to be installed first. Doing it manually will be quite a lengthy process and hence I was wondering if there was a more effective way of doing it.
        If you don't get the automatic way to work soon enough, there is a half automatic way. you have to download the tar.gz, unpack it, go into the directory and type
        cpan .
        so you can at least save the Makefile.PL/Build.PL stuff (but you still have to download all dependencies yourself and do the same steps for each).

        i don't thing there is a better way to do... go through the readme file, download the supporting module...if there is any library file required then search for any RPM package for that lib.. from my experience i found that 'patient is much needed for beginners' while installing the modules..

        I think that your configuration isn't right. There is no cpansearch.perl.org for connecting to CPAN. Normally, when you try to download and install using CPAN, search.cpan.org is called, aka 64.235.248.44.

        Now, if you are browsing CPAN and click "Source", then you'll get something like:

        http://cpansearch.perl.org/src/DROLSKY/Log-Dispatch-2.27/lib/Log/Dispatch.pm.

        Does that help?