close STDIN; close STDOUT; close STDERR; # not really necessary open STDIN, "/dev/tty"; open STDERR, ">/dev/tty"; # testing print "STDOUT\n"; print "STDERR\n"; $_ = ; print $_;