Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Problem with utf8 after nearly 4096 bytes

by Random_Walk (Parson)
on Sep 02, 2013 at 09:59 UTC ( #1051915=note: print w/ replies, xml ) Need Help??


in reply to Re: Problem with utf8 after nearly 4096 bytes
in thread Problem with utf8 after nearly 4096 bytes

Your new version is still copying the entire file into mem. What you should try is changing your current approach:

undef $/; my $bigfile = <$fh>; # Do some processing on $bigfile
to something like this
while (my $line = <$fh>) { # Do some processing on $line }

Cheers,
R.

Pereant, qui ante nos nostra dixerunt!


Comment on Re^2: Problem with utf8 after nearly 4096 bytes
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2014-07-11 01:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (217 votes), past polls