http://www.perlmonks.org?node_id=998639


in reply to installing missing perl modules

Silly and obvious question but can you resolve "cpan.strawberryperl.com" or "www.cpan.org" from the command line with nslookup?

What happens if you go to cpan.strawberryperl.com or www.cpan.org via your browser? You say "assignment" so are you behind a proxy/firewall at school/college? If so take a look at using LWP behind a proxy.

In order of likelihood this looks like either:

a name resolution issue. ie. /etc/hosts or nslookup
you're behind a proxy and need to add the proxy server to your code
or possibly your timing out in which case set $ua->timeout() but don't think that is your problem.

Replies are listed 'Best First'.
Re^2: installing missing perl modules
by sibasankar (Initiate) on Oct 12, 2012 at 09:47 UTC

    Thank you for your reply. I am behind the firewall of my company. But If I directly use the URL, I am able to download 01mailrc.txt.gz. So is it possible if I use the downloaded file? If yes, do I need to modify any config file?

      No, do this properly by configuring your cpan client to work from behind your firewall. See CPAN for details or speak to your systems/network administrator.

      Update: fixed typo in link.

      On one hand, you can download the tarballs of modules directly from CPAN and manually install them. The problem comes when modules have prerequisite modules that you don't have. For example, let's say you want to install module #1. However, module #1 needs module #2 & #3, which you don't have. So you download those for install. However, module #2 needs module #4, which you don't have. See how this can easily become a painful process?

      If you use the cpan utility, it will detect and install the needed prerequisite modules, which will make things much easier for you.

      Since you're behind a corporate firewall, you're probably also sitting behind an HTTP proxy and/or an FTP proxy as well. The documentation link in marto's reply should get you started on what you need to do to get the cpan utility working with those proxy and firewall servers.

      As marto said the best/correct fix is to configure cpan with a proxy. Your proxy info should be in your browser or best speak with your network team.

      Firefox. tools-options-advanced-network-settings
      IE. tools-internet options-connections-lan settings
      Chrome... don't have to hand! :)