note
btrott
Hmm. Well, this may seem like a silly question, but are
you sure that the PS file exists when run as a CGI script?
How does that PS file get there, after all? That's
not really apparent from your code.<p>
So I'd put in a
<code>
print "PS file doesn't exist!" unless -e $image_output . ".ps";
</code>
Perhaps also print out your environment and see if anything
looks weird or wrong.<p>
Also, check the $? variable after you use the backticks.
From [perlvar]:
<code>
The status returned by the last pipe close, backtick
(``) command, or system() operator. Note that this
is the status word returned by the wait() system
call (or else is made up to look like it). Thus,
the exit value of the subprocess is actually ($? >>
8), and $? & 255 gives which signal, if any, the
process died from, and whether there was a core
dump. (Mnemonic: similar to sh and ksh.)
</code>
Also, you may want to check out <a href=http://search.cpan.org/search?dist=PerlMagick>PerlMagick</a>,
which provides a Perl interface to ImageMagick. So,
presumably, you won't have to bother yourself with running
system commands. One of Randal Schwartz's
<a href=http://www.stonehenge.com/merlyn/WebTechniques/col41.html>Web Techniques columns</a> uses
PerlMagick to create thumnbails on the fly, so you might
take a look at that.
7248
7248