Yes, I'm piping the textfile into the script, though that's more for convenience than anything else. It'd be easy enough to change.
I read up on the open pragma again and noticed that it can be fed another subpragma, :std, to affect the STD* streams:
The :std subpragma on its own has no effect, but if combined with the :utf8 or :encoding subpragmas, it converts the standard filehandles (STDIN, STDOUT, STDERR) to comply with encoding selected for input/output handles. For example, if both input and out are chosen to be :encoding(utf8) , a :std will mean that STDIN, STDOUT, and STDERR are also in :encoding(utf8) .
So I tried changing that line to
use open IO => ':std', ':utf8';
but that didn't make a difference either. I'm probably still missing something fairly obvious.
Thanks for your help, by the way!
In reply to Re^2: length() miscounting UTF8 characters?
by AppleFritter
in thread length() miscounting UTF8 characters?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |