As a rule of thumb, and to avoid confusion, stick to the use of utf8 binmode for unicode text streams onlyAll strings in the Perl programming language are unicode text strings, and all streams produce those, so what exactly do you mean by "unicode text streams"? You probably meant something like "use only read, readline, print on streams marked (using binmode, open etc.) with utf-8".
if you don't have a compelling need for that, you can use lower level system IO via sysopen/sysread/syswrite and be done with it. In the end, bytes at rest in files are just bytes. If you aren't trying to encode your text as UTF-8 strict, you can safely use system IO without adding any additional IO disciplines/layers and you should be fine.Just delete that part, IMO. People who understand what using thin wrappers over (system) read, pread implies (wrt buffering, for example) do not need to read that, and people who don't understand don't need to use sysread and syswrite, but they might think it's an advice to use those.
With system IO, no translations will occur on your input/output streams that could cause your file content to be mangled. You can write raw text or even binary streams and never worry.That's confusing to me. "Mangled" in Perl pretty much always means "improper upgrading or downgrading". If the new changes cause the string to not be downgraded when using syswrite - well, that would be just wrong! but I'm sure that won't be the case - so "raw text" can still get mangled... just delete it, too, IMO.
So, basically, I don't like any of it :) Yeah, sorry, but it's just written in a pretty confusing manner, and there definitely shouldn't be any recommendation or encouragement to use sys functions.
In reply to Re: UTF-8 and systemIO are not friends anymore
by Anonymous Monk
in thread UTF-8 and systemIO are not friends anymore
by Tommy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |