in reply to utf8 writing

I use IO::TEE for these kinds of things. Not sure of it will fix your problem though documents say nothing about utf8.

http://search.cpan.org/~kenshan/IO-Tee-0.64/Tee.pm

use IO::Tee; open my $ofh, '>>', 'LOGFILE.txt' or die "Cannot append to 'LOGFILE.tx +t':$!"; my $tee = IO::Tee->new(\*STDOUT, $ofh); # Prints to both file and stdo +ut #my $tee = IO::Tee->new(\*$ofh);Prints to file only print $tee "Opening $name";
Worth a shot. Hope it Helps. Very nice writeup on the previous reply that was a hell of alot of work.