Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Out of memory

by sundialsvc4 (Abbot)
on Jun 09, 2015 at 14:05 UTC ( [id://1129665]=note: print w/replies, xml ) Need Help??


in reply to Out of memory

If you know that you are looking for a pattern that will not stretch over more than 2 (or, any n) consecutive records, then you can simply build an array of the first n records in the file (to “prime the pump” ...), then proceed as follows:

  1. Concatenate all n records in the current list, into a single string.   Then, search within that string.
  2. unshift the first record from the head of the array, and push the next record onto the tail of it.
  3. Rinse and repeat, until an undef indicates that you have reached the end of the file.

No matter how enormous the file being processed may be, the memory requirements are negligible.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-25 02:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found