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

Forum statistics

Threads
474,261
Messages
2,571,041
Members
48,769
Latest member
Clifft

Latest Threads

Top