This the called program can still successfully read/write to stdin,
stdout, stderr and the output is discarded.
# Bundled with perl.
'Encode' => 0,
'Fcntl' => 0,
+ 'File::Spec' => 0,
'File::Temp' => 0,
'I18N::Langinfo' => 0,
'Pod::Usage' => 0,
# Necessary for GNU screen or it'll keep the window open until an
# external command has run.
- close STDIN or die $!;
- close STDOUT or die $!;
- close STDERR or die $!;
+ require File::Spec;
+ my $devnull = File::Spec->devnull();
+ open STDIN, '<', $devnull or die $!;
+ open STDOUT, '>', $devnull or die $!;
+ open STDERR, '>', $devnull or die $!;
# Double-fork to prevent zombies.
my $pid = fork;