in reply to Can't close STDIN/STDOUT/STDERR

That message does not appear in the Perl distribution. Maybe if you told us what's producing it.

Replies are listed 'Best First'.
Re^2: Can't close STDIN/STDOUT/STDERR
by ikegami (Patriarch) on Feb 09, 2010 at 21:12 UTC

    Ah! It appears to originate from Net::OpenSSH. (Thanks Google)

    Anyway, it's a fair warning. Programs expect to be provided a STDIN, STDOUT and STDERR, and you don't provide them. Don't close them. Instead, redirect them to /dev/null.

      I tried that (redirect to /dev/null) and it broke my program... I'm not well-versed enough in Perl to know why. Could you give me an example of how I should do it?
        You can find samples of how to redirect file handles in open:

        open STDOUT, '>', "/dev/null" or die "Can't redirect STDOUT: $!";

        close(READER) or die "can't close READER: $!"; open STDIN, '<', '/dev/null' or die "can't open STDIN: $!\n"; open STDOUT, '>', '/dev/null' or die "can't open STDOUT: $!\n"; open STDERR, '>&', \*STDOUT' or die "can't dup STDOUT: $!\n";
Re^2: Can't close STDIN/STDOUT/STDERR
by brp4h (Acolyte) on Feb 09, 2010 at 21:12 UTC
    } else { #Child die "cannot fork: $!" unless defined $child_pid; close(READER) or die "can't close READER: $!"; close(STDIN) or die "can't close STDIN: $!"; close(STDOUT) or die "can't close STDOUT: $!"; close(STDERR) or die "can't close STDERR: $!";
      I seriously doubt that code is issuing the error. One of those handles would have to use magic Google didn't find, or some Perl functions would have been replaced by some module Google didn't find. Neither are likely.