open with encoding(utf8) takes forever

E

Erik Sandblom

Hi,

I'm trying to open a utf-8 file with a long line, 2000 characters or
so. It works with the top method, but the second method gags when it
hits the long line:

open FILE, "gc.html";
open FILE, '<:encoding(utf8)', "gc.html";

Here is my whole script; I confess that utf-8 and I don't get along
very well:

#!/usr/bin/perl -w

use utf8;

open FILE, '<:encoding(utf8)', "gc.html";
while ($line = <FILE>) {
print $line;
}
close FILE;

# gc.html is http://www.greencargo.com/templates/NewsListPage.aspx?id=31
# long line is on line 56

many thanks in advance,
Erik Sandblom
 

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

Similar Threads


Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top