in reply to Polish text

you must decode your input, or to be more precise Perl needs to know that you are handling char-strings and not byte-strings.

For that to happen you need to convert the input's encoding format to Perl's internal text format.

from Encode

$string = decode(ENCODING, OCTETS[, CHECK])

And this can already happen in an input layer when opening.

see perluniintro#Unicode-I/O

No better help, since I don't know your input's encoding.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^2: Polish text
by Schmunzie (Beadle) on Jan 03, 2021 at 20:24 UTC
    Thank you, Rolf, that fixed both my problems.