>> Maybe this has some connection to your problem?
>> https://github.com/perl/perl5/issues/14839
>
> Reads like the reason why it now errors, yeah.
---
perldoc -f sysread
"Note that if the filehandle has been marked as ":utf8",
"sysread" will throw an exception. "
---
https://github.com/Perl/perl5/issues/17885
"The sysread(), recv(), syswrite() and send() operators are deprecated
on handles that have the ":utf8" layer, either explicitly, or
implicitly, eg., with the ":encoding(UTF-16LE)" layer."
"The problem is that it assumes the byte stream will be in Perl's
internal upgraded encoding (:utf8, which is kind of like UTF-8 but not
quite), but ignores any other layers on the handle which could be really
important, like an :encoding layer that actually translates that
internal encoding to a completely different encoding, or a :crlf you
might then expect to be noticed. So in the case of non-UTF-8 encodings
it was actually completely broken, and when you only mean to use it for
UTF-8 it is risky (like using :utf8 in general for input), so in 5.30 it
is an error."
---
It seems as if it isn't going to be resolved either.
I would suggest that you should try to rewrite your code.
/Jörgen