perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Beamish" <>
Subject Forking to an interactive program under mod_perl
Date Tue, 12 Dec 2006 21:18:56 GMT

I have described the challenge I'm facing in some detail here

but essentially I want to launch Ghostscript in an interactive session, and
talk to it interactively through a mod_perl request handler.

The code that I am trying to run (this is what calls Ghostscript) already
works fine from the command line, but it uses IPC::Open2, something that
mod_perl isn't happy with (it complains about not being able to find FILENO
in Apache::RequestRec). I have bashed away at IPC::Run, because that seems
to be the appropriate replacement under mod_perl, but for some reasons the
pipe going to Ghostscript is never read by Ghostscript .. so no output is

I was also pointed to Expect, but that suffers from the same problem as
IPC::Open2 -- mod_perl doesn't like it (it complains about not being able to
find CLOSE in Apache::RequestRec). I've also looked into using
Apache2::SubProcess, and that may be something I try in the future, but the
server I'm working on is Apache 1.3 so I don't believe that option is
available to me.

What I'm trying to do is come up with scaled page images from a PDF on the
fly. Thus, I want to launch Ghostscript and then ask for a couple of page
images. So, launching Ghostscript and getting the first page might happen on
the first request; subsequent requests would come back to the Ghostscript
session left running from the first request, and thus would be able to
quickly produce the required page image.

Suggestions welcome.

Alex Beamish
Toronto, Ontario

View raw message