P is for Practical | |
PerlMonks |
How to run pbmtextps from inside Perl scriptby James Board (Beadle) |
on Feb 08, 2014 at 17:54 UTC ( [id://1074043]=perlquestion: print w/replies, xml ) | Need Help?? |
James Board has asked for the wisdom of the Perl Monks concerning the following question:
I'm on a Linux machine and I'm coding a Perl script to generate images with text in by calling pbmtextps multiple times. When I try to run pbmtextps in Perl with a system call like this 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.
Back to
Seekers of Perl Wisdom
|
|