"D" corresponds to "i + o" whose documentation in perlrun states (emphasis mine):
> The "io" options mean that any subsequent open() (or similar I/O operations) in the current file scope will have the ":utf8" PerlIO layer implicitly applied to them, in other words, UTF-8 is expected from any input stream, and UTF-8 is produced to any output stream.
If you put the call to open into a module, it falls out of the current file scope.
The -C is intended for oneliners, in larger programs and modules, use binmode, explicit layers with 3-arg open, or open.pm.
In reply to Re: The module version works, but the standlone version crashes with "Malformed UTF-8 character"
by choroba
in thread The module version works, but the standlone version crashes with "Malformed UTF-8 character"
by Perlfan52
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |