my @command = ('htmldoc', '--webpage', '-f', $pdffile, $htmlfile); my $rv = system(@command); die("Unable to execute htmldoc: $!\n") if $rv == -1; die("htmldoc was unable to complete the request (Exit code = $&)\n") if $rv; ... success! ...