in reply to Re^4: search a large text file
in thread search a large text file
If you use a disk based hash, for example a DBM::Deep hash, you won't run out of memory. The main reason to have a disk-based hash is that you can create hashes that are bigger than your memory (another reason to use it is that the hash is permanent).
For sample code just look at the perldoc page of DBM::Deep, under 'Synopsis'. Basically you just call DBM::Deep to link a hashname with a file on disk and after that you use that hash like any other hash, only that everything you store in there is (behind the scenes) transfered directly to disk.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: search a large text file
by perl_lover_always (Acolyte) on Feb 10, 2011 at 09:45 UTC | |
by jethro (Monsignor) on Feb 10, 2011 at 10:16 UTC | |
by perl_lover_always (Acolyte) on Feb 10, 2011 at 10:25 UTC | |
by jethro (Monsignor) on Feb 10, 2011 at 10:45 UTC | |
by perl_lover_always (Acolyte) on Feb 10, 2011 at 13:47 UTC | |
|