The use utf8
means Perl expects your source code to be UTF-8.
The open
pragma can change the encoding of the standard filehandles:
use open qw( :std :encoding(UTF-8) );
And, whatever is going to deal with your output needs to expect UTF-8 too. If you want to see it correctly in your terminal, then you need to set up that correctly (but that’s nothing to do with Perl).