When using cpan.bat the following may be helpful. Please note that this is for a Windows corporate network infrastructure and was tested using both Strawberry and Cygwin Perl in the current network environment where I work. YMMV! BEWARE THAT THIS APPROACH STORES YOUR LAN PASSWORD ON YOU LOCAL HARD DISK. THIS IS INSECURE! Step 1: Information Gathering
  1. Discover the address of your proxy: If using a PAC file (look in IE Tools->Internet Options-> Connections -> LAN Settings and identify the setting 'Use automatic configuration script') then download the PAC file and open in a text editor. The default proxy address (e.g. proxy.corp) and port (e.g. 80) will probably be at the bottom of the PAC script. If you are not using a PAC script then the proxy address will be in the LAN Settings dialog.
  2. Know your domain name (e.g. corpdom) and lan ID (e.g. lanname)
  3. You will also need your lan password (e.g. secret)
Step 2: Configure CPAN
  1. From the command line ensure that you running the correct version of perl (perl --version)
  2. run the command cpan
  3. You may be asked some configuration questions -- answer as best you can and take defaults if not sure
  4. At the CPAN Prompt type the following commands:
    1. o conf proxy_user corpdom\\lanname (NB Double slash required)
    2. o conf proxy_pass secret
    3. o conf ftp_proxy http://proxy.corp:80 (NB No trailling slash on URL)
    4. o conf http_proxy http://proxy.corp:80 (NB No trailling slash on URL)
  5. Now try and install something (e.g. i Bundle::Perl::Critic)
[Update: July 2008 -- tested on Strawberry and Cygwin Perl. See also]