in reply to How can I re-open STDOUT?
I may be on completely the wrong track, but IIRC from my C days, 'typically' STDOUT is related intimately with file number 1 (STDIN being 0 and STDERR being 2). When you close and the reopen STDOUT, it does not get the lowest available file number but the next available, which is 3. I believe you have to do a dup call of STDIN to get the next lowest number (thus recreating fileno 1) and then manipulate that (via ioctl's) to recreate it as a clone of STDOUT. How this relates to Perl IO model I have no idea, but I see strong similiarities in the C API and Perl's support
I feel confident that errors in this assertion will be pointed out to me.