http://www.perlmonks.org?node_id=980995

Gangabass has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Monks

I'm trying to redirect output (warnings) of some weird program to /dev/null (I don't want this info in web server's error log) but with no luck.

The program I'm talking about is wkhtmltopdf and the main problem with it that it's accept several files. So then I use ">/dev/null 2>&1" it think about /dev/null like a file to convert.

So this code gives me an error about wrong file name:

my @options = qw( --orientation Landscape --page-size A3 --title "Here is our Title" ); system( $config->{wkhtmltopdf_path}, @options, $source_file, $config-> +{result_filename}, ">/dev/null", "2>&1" );

I'm also tried to enclose whole command in () and next redirect it. But this approach is not working from system().

system("( /usr/bin/wkhtmltopdf www.google.com Result.pdf )", ">/dev/nu +ll", "2>&1");

Please help me to redirect output in this situation.