# progs => [ multi-liner (avoid quotes) ]
# progfile => perl script
# stdin => string to feed the stdin (or undef to redirect from /dev/null)
-# stderr => redirect stderr to stdout
+# stderr => If 'devnull' suppresses stderr, if other TRUE value redirect
+# stderr to stdout
# args => [ command-line arguments to the perl program ]
# verbose => print the command line
if (defined $args{args}) {
$runperl = _quote_args($runperl, $args{args});
}
- $runperl = $runperl . ' 2>&1' if $args{stderr};
+ if ($args{stderr} eq 'devnull') {
+ $runperl = $runperl . ($is_mswin ? ' 2>nul' : ' 2>/dev/null');
+ }
+ elsif ($args{stderr}) {
+ $runperl = $runperl . ' 2>&1';
+ }
if ($args{verbose}) {
my $runperldisplay = $runperl;
$runperldisplay =~ s/\n/\n\#/g;