in reply to Sytem Call Not Waiting
Sometimes programs want '>', '/dev/null' , separated. Others might want '> /dev/null' as a single string. Try some variations in the @arg list until you get the desired output. I remember one tricky program I had, that wouldn't accept @args like '-o', "$filename", but needed "-o $filename".... took me all day to figure it out by trial and error. :-)#my $cmd = 'pdftohtml ' . $filename_pdf . ' ' . $filename_html . ' -no +f #+rames -c -i >/dev/null' ; #system("$cmd"); my @args = ( $filename_pdf, $filename_html, 'noframes', '-c-, '-i' , ' +>', '/dev/null' ); system ('pdftohtml', @args);
UPDATE It was pointed out to me that the /dev/null redirection, may be nonsense, in this particular instance. It didn't make much sense to me either, when I first saw it, but I have seen other apps, like mplayer or mencoder, which required the following odd redirection
$pid = open(MP, "| mplayer @options init.mpg >/dev/null 2>&1 ");
|
|---|