perl: September 2006 Archives

Annoying PPM error warnings be gone!

| | Comments (0) | TrackBacks (0)

If you use Activestate's port of Perl on Windows and you've installed a few CPAN modules using PPM, chances are you'll have started getting annoyong Parser error messages. Have a read of this by Tom "hitman" Hukins on how to hack those useless errors out of your life:

http://use.perl.org/~tomhukins/journal/29857

Here's the scenario: I wanted to be able to produce tumbnail images on the fly so that a user could upload their photos to a site and then in their page templates use a cgi call as the img src, passing the desired width and height as arguments to the script. For example:
<img src="/cgi-bin/image.fcgi?name=photo1.jpg&width=100&height=150"; alt="" />  
Not rocket science, is it, and it works fine as a normal CGI, but I wanted to run it under FastCGI for obvious reasons: It's a low volume site, so I can afford the overhead of generating thumbnails on the fly, but the speed savings from using FastCGI would be appreciated.

Anyway, the problem appears to be that the FCGI module ties STDOUT to itself, whilst Image::Magick appears to want to do the same. Conflict ensues and when you call the Image::Magick Write method, your image is written to your Apache error log. Bugger. The solution then would appear to be to untie STDOUT from FCGI and tie it to Image::Magick. So that's what I'm going to do, soon. Watch this space...

Update: see my more recent post on this subject with a happy solution

About this Archive

This page is a archive of entries in the perl category from September 2006.

perl: August 2006 is the previous archive.

perl: October 2006 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.21-en