FAQ: While trying to build and upgrade PERL modules for a new box a friend came across this error and it completely stalled his work. In order to get to a solution, I replicated the build procedures with his help and found myself in the same predicament.
To illustrate, we were going to build perl modules. Getting into the PERL shell.
root@host# perl -MCPAN -e shell
cpan shell -- CPAN exploration and modules installation (v1.9205)
ReadLine support enabled
cpan[1]> install Bundle::CPAN
...
...
In order to cut the story short we encountered the error below:
Undefined subroutine &Compress::Zlib::gzopen called at /usr/lib/perl/5.8.8/CPAN.pm line XXXX.
About to give up hope in this automated and supposedly seamless installation, I decided to give it a manual push. Quitting the cpan shell, I changed directory to where the source files of Compress::Zlib were located.
root@host# cd /root/.cpan/build/Compress-Zlib-2.015
root@host# perl Makefile.PL -xs
Writing Makefile for Compress::Zlib
root@host# make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/000prereq.....ok
t/01version.....ok
t/03zlib-v1.....ok
t/05examples....ok
t/06gzsetp......ok
t/08encoding....ok
t/14gzopen......ok
t/99pod.........ok
All tests successful.
Files=8, Tests=766, 3 wallclock secs ( 0.02 usr 0.21 sys + 1.76 cusr 0.67 csys = 2.66 CPU)
Result: PASS
root@host#
After seeing the result of "make test" above, I had breathed a sigh of relief -- Result: PASS. Manually kicking the installation of Compress::Zlib did solve the problem. After execution of "make install", we went back to the automated install of the Bundle::CPAN module and everything went well.
I hope the above solution works for you as well.