binmode must be in the middle of the file

D

Dan Jacobson

Below, I found if I place binmode() earlier, the first UTF-8 <<EOF
becomes gibberish on output. Removing it causes wide character
warnings at $p->header. I suppose it will just have to stay in between
the two. Must be my junior programmer status to blame.
require HTML::HeadParser; print <<EOF;
[some raw utf-8 characters here]
EOF
binmode(STDOUT,":utf8"); open(my $fh,"<:utf8",$_);
$p=HTML::HeadParser->new; $p->parse_file($fh); print $p->header('Title');
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,444
Messages
2,571,709
Members
48,796
Latest member
Greg L.
Top