in reply to enoeding iso 8859 issue within a datadump
to print to a file instead of printing at the screen, we just have to change:
Well, that's ignoring the most important distinction between say and print: that say adds a newline at the end. And you can add a filehandle argument to say. So you'd better do:
print $OUT_FILE $text;
If you set
say $OUT_FILE $text;
$OUT_FILE = \*STDOUT;
then you don't even have to swap code out code.
$OUT_FILE = select;
As far as your problem concerns: look at Perl I/O Layers, in particular the :utf8 and :encoding layers.