Created by @choroba
When reopening STDERR, its encoding layer doesn't change.
open STDERR, '>:utf8' , 'perl.log' or die $!;
Output (contents of the perl.log file):
Expected output (works OK if I use LOG instead of STDERR, or my $LOG,
E. Choroba wrote:
This actually happens when, and only when, reopening a file handle that
/* Eeek - FIXME !!!
The issue is that the new handle configuration is initially opened on a
The problem of this ticket interacts nastily with threads.
Without threads, the same-fd-on-reopen semantic makes sense. Each file
Threads complicate things because each file handle is duplicated into each
The desire to reuse a low fd number when reopening a handle conflicts
A similar issue arises with the ">&=" open mode. This sets up sharing
The treatment of reopening with a shared fd is really a distinct bug from
A relatively simple possible answer is that a fd can only be reused if