Getting CPAN to use the locally installed gzip and/or tar


Sometimes, at least on our HP-UX 11.00 boxes, using CPAN.pm to install other perl modules doesn't work because CPAN says it can't find the required tar or gzip module like so:

CPAN.pm needs either both external programs tar and gzip installed or
both the modules Archive::Tar and Compress::Zlib. Neither prerequisite
is available. Can't continue.

In a catch-22, if you try to run 'perl -MCPAN -e 'install Archive::Tar' you'll get the same message. Fortunately, tar and gzip are usually already installed, and the error message just means that perl doesn't have the correct path to them. Hunt for the Config.pm file--it's usually buried several levels down. On one HP box I found it in /usr/local/lib/perl5/5.8.0/CPAN, where the perl binary was in /usr/local/bin/. Edit Config.pm, setting the correct paths and you won't need the perl modules mentioned above.

07/29/2004