Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: enoeding iso 8859 issue within a datadump

by bart (Canon)
on Oct 06, 2012 at 12:18 UTC ( [id://997621]=note: print w/replies, xml ) Need Help??


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:
say $text;
to:
print $OUT_FILE $text;
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:
say $OUT_FILE $text;
If you set
$OUT_FILE = \*STDOUT;
or even
$OUT_FILE = select;
then you don't even have to swap code out code.

As far as your problem concerns: look at Perl I/O Layers, in particular the :utf8 and :encoding layers.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://997621]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2024-04-25 05:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found