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

Re: Parse string greater than 2GB

by kcott (Archbishop)
on Jun 30, 2013 at 02:15 UTC ( [id://1041538]=note: print w/replies, xml ) Need Help??


in reply to Parse string greater than 2GB

G'day BigHoss,

Welcome to the monastery.

You've written 'the "read()" of the file cannot be changed.' and then, in your code, you've shown what happens when you do change it. So, please clarify what you mean; I can provide a few suggestions but, until that ambiguity is sorted out, I'm really just guessing.

The error you're getting is described in perldiag.

Reading the entire file and then looping through the output from split can be achieved more simply with code like this:

while (my $l = <INFILE>) { chomp $l; print $l; }

You'll probably find that passing a lexical filehandle (see open) to BigParse() is easier than dealing with globrefs.

Check the read documentation and man wc for discrepancies between what each considers a character and a byte to be.

sysopen and sysread may be better options for dealing with your binary data.

-- Ken

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (1)
As of 2024-04-25 03:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found