in reply to Redirect output of the system() command

Just a thought:

Have you tried using backticks (qx//) instead of system? The perldoc entry addresses the problem of redirecting STDOUT and/or STDERR.

HTH,

Athanasius <°(((><contra mundum

  • Comment on Re: Redirect output of the system() command

Replies are listed 'Best First'.
Re^2: Redirect output of the system() command
by Gangabass (Vicar) on Jul 11, 2012 at 05:24 UTC
    It's not a system() problem so the qx// doesn't help too. The called program (wkhtmltopdf) just eat all arguments and don't rest anything to the shell.

      You never invoked a shell because you didn't pass a shell command to system

      You want

      system('sh' => ( '-c' => '"$@" >/dev/null 2>&1', '--', $config->{wkhtmltopdf_path}, @options, $source_file, $config->{result_filename}, ));

      This approach handles spaces and other special characters in file names and options.

        Same error as before (I'm sure wkhtmltopdf just grab all arguments): Error: Failed loading page http: (sometimes it will work just to ignore this error with --load-error-handling ignore)