in reply to using binmode() to override default encoding specified in "use open"

Just use

open(FILE, '>:encoding(UTF-8)', 'fpo');

Notes:

my $qfn = 'fpo'; open(my $FILE, '>:encoding(UTF-8)', $qfn) or die("Can't create \"$qfn\": $!\n");

Replies are listed 'Best First'.
Re^2: using binmode() to override default encoding specified in "use open"
by raygun (Scribe) on Jul 23, 2020 at 19:04 UTC

    Thank you for the response. The fourth paragraph of my initial post explains why I'm using binmode rather than this solution.

    Your additional notes are good advice, but I omitted error checking, etc., from my example because I simplified my code to include only the relevant bits. I apologize for not stating this explicitly; I wrongly presumed it was clear from constructions like if 1 that are pointless in production code. (In practice I use autodie to avoid having to individually check every open with identical logic or to write my own open wrapper.)