PGTS PGTS Pty. Ltd.   ACN: 007 008 568

point Site Navigation

point Other Blog Threads



  Valid HTML 4.01 Transitional

   Stop The Internet Filter!

   No Clean Feed

   The Internet Filter Is An Ex-parrot!






PGTS Humble Blog

Thread: Tips/Tricks For Programming etc

Author Image Gerry Patterson. The world's most humble blogger
Edited and endorsed by PGTS, Home of the world's most humble blogger

A Tiny Problem


Chronogical Blog Entries:



Date: Sun, 29 Jul 2018 23:35:05 +1000

CPAN packages can be very troublesome if they are not kept up to date. And the combination of Windows and Unix into one package (Cygwin) can be especially troublesome if it is not kept up to date. This is especially true if we find ourselves contemplating Server 2012, but our code base is something from Server 2003 (or even believe it or not --- Server 2000).

Not too long ago I found it necessary to install a CPAN package into cygwin perl. If you have done this via a proxy firewall you probably realise that this can be difficult. In the past I have found that curl is a reliable tool that CPAN can use to fetch packages via a proxy. To do this, you will need the Cygwin curl package and then you need to set your user and password in the .curlrc file in your home folder. If your user name is "foo" and your password is "password", and your proxy is foo.proxy.bar.com:8080, you would need to add the following lines:

proxy-user=foo:password
proxy=foo.proxy.bar.com:8080
proxy-insecure
Then you need to configure CPAN to use curl as described here.

However it seems that the most recent version of CPAN has a preference for HTTP::Tiny. And if the package you are fetching has lots of dependancies you may find it very tedious waiting for CPAN to try several times to fetch something with HTTP::Tiny and then fail-over to fetch it with curl, and then repeat the process on the next step, and the next step ... etc.

When I encountered this, without delving too deep into the internals of CPAN, I decide the simplest way to prevent CPAN using HTTP::Tiny was to locate the Tiny.pm and rename it to Tiny.pm.bak ... Depending on your installation, you'll find it in the one of the perl llibrary locations in a folder called HTML. And if you've set all of the other fetch methods to null, CPAN will go straight to using curl. (Note: must remember to rename it back to Tiny.pm when you finish).

However a little while later, while installing another CPAN package, I did a little research on HTML::Tiny, and decided that it looked as though it might be simpler and quicker than curl. All that is required is to include your user/password in the CPAN settings.

This can be done by using the following CPAN commands:

o conf http_proxy "foo.proxy.bar.com:8080"
o conf http_user "foo"
o conf http_pass "password"
o conf commit

The last command will commit your changes.


Other Blog Posts In This Thread:

Copyright     2018, Gerry Patterson. All Rights Reserved.