http://www.perlmonks.org?node_id=1012939


in reply to Re: Using encoding
in thread Using encoding

It's more correct to write:
use strict; use warnings; use utf8; my $string = '£'; open my $output, '>:encoding(utf8)', 'out.txt' or die $!; #binmode $output, ":encoding(utf8)"; print $output $string; close $output;
(with or without 'binmode $output, ":encoding(utf8)"' but without 'binmode $output;')