Check out this man page http://perldoc.perl.org/functions/open.html For
encoding UTF8, the example is
open(FH, "<:encoding(UTF-8)", "file")
Mike
----- Original Message -----
From: "André Warnier" <a...@ice-sa.com>
To: "mod_perl list" <modperl@perl.apache.org>
Sent: Sunday, June 28, 2009 11:41 AM
Subject: quick pure perl question
Hi.
By curiosity, and just in case anyone knows off-hand :
perl 5.8.8
In a script, I substantially do this :
open(FIRST,'<:utf8',$name1);
open(SECOND,'>:raw',$name2);
while(defined($line = <FIRST>)) {
print SECOND $line;
}
and I get warnings : "wide character in print to <SECOND>,.."
I mean, I know that my data is UTF-8, and I know that some characters are
going to be "wide", and that's how I want them.
I also know that I could specify the output I/O layer as 'utf8' (which
avoids the warning).
But why do I get warnings when I specified 'raw' as the I/O layer ?
Doesn't 'raw' mean like 'as is' ?