James Board has asked for the wisdom of the Perl Monks concerning the following question:
system("pbmtextps -fontsize 24 SampleText > out.pbm");
I get this error message
pbmtextps: failed to run Ghostscript process: rc=-1
However, if I run the exact same pbmtextps command from the command-line outside of Perl, it runs with no errors.
Why does it cause the ghostscript error when I run it from inside a Perl script?
Also, I tried to hack around this by creating a C program which does the exact same thing with a C system call. That works correctly from the command line. No errors. But then when I try to run that C program from the Perl script with a call to system(), I get the same ghostscript error.
ANSWER: I solved it. The problem was this line in the PERL script:
$SIG{CHLD} = 'IGNORE';
When I got rid of that (which I need for other things, but not in this script) it worked okay.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to run pbmtextps from inside Perl script
by stefbv (Priest) on Feb 08, 2014 at 18:58 UTC | |
by James Board (Beadle) on Feb 08, 2014 at 19:47 UTC |