The result of PerlIO layer application on a file handle is dependent on the previously applied layers. As such it is necessary that all layer change instructions (encoding, binary, binmode, utf8 (maybe more?)) do not flip flags on the io object, but add the relevant instructions to an array, which needs to be applied to a file handle at open time.
The result of PerlIO layer application on a file handle is dependent on the previously applied layers. As such it is necessary that all layer change instructions (encoding, binary, binmode, utf8 (maybe more?)) do not flip flags on the io object, but add the relevant instructions to an array, which needs to be applied to a file handle at open time.
This would be the ultimate fix for #36.