skelooth has asked for the wisdom of the Perl Monks concerning the following question:

I think I've about got steam coming out of my ears. I was able to install and use the module fine on ubuntu but the production machine is redhat with an out of date service subscription.

First I had to force install PDF::API2 and Compress::Zlib because they would not pass all of the tests for whatever reason.

At first it wasn't finding Compress::Zlib. I did some snooping and found it was installed to Compress::Raw::Zlib, so I copied the perl module up a directory.

Now I am able to get it to create a BLANK pdf file, however when I try to write text to the PDF file it calls Compress::Zlib::compress() which does not exist. It is bootstrapping some code that looks like this:

XSLoader::load('Compress::Raw::Zlib', $XS_VERSION);

So I tried editing it to call Compress::Raw::Zlib::compress() but it comes back with an error saying that it is an invalid macro.

Any help guys? I need the functionality of this library, and it worked without hitch on ubuntu following the same cpan based install. I saw another poster had the same error who solved it by uninstalling and reinstalling everything. That is not an option for me. Any wisdom you can shine on me would be greatly appreciated.

The actual error is:

Undefined subroutine &Compress::ZLib::compress called at /usr/lib/perl5/site_perl/5.8.5/PDF/API2/Content.pm line 103.

  • Comment on Problems with PDF::API2 and Compress:Zlib on redhat e4

Replies are listed 'Best First'.
Re: Problems with PDF::API2 and Compress:Zlib on redhat e4
by Joost (Canon) on Aug 08, 2007 at 19:28 UTC
      Apologies, I don't have the errors anymore. When I try doing install Compress::Zlib it says it's up to date, and if I force install all tests (aside from ones it skips) are successful. I'm really confused as to why I get Can't locate Compress/Zlib.pm in @INC after installing it with CPAN.

      I don't know how to remove modules installed with CPAN, otherwise I would reinstall them for the error messages.