On Wed, 13 Jun 2001, Bryan Gmyrek wrote:
> I have just written a program that makes an array of hashes of hashes of
> hashes. It reads all kind of information in from a bunch of files and
> then later I access the elements of this thing in a convienient way
> because it's kind of like a little database. Anyways, I end up printing
> everything out into a very big html table. I noticed that *sometimes*
> nothing is printed when I say 'print this part of that array...'
> Thought it was a bug in the code, but then I ran the program on a
> machine with more memory and *now* the elements that were missing
> previously are printed, but some 'further on down the line' are not. It
> seems that the computer is running out of memory and at some point no
> data really gets added to this monster of a list of lists... What the
> heck should I do so that I can perform these functions, but not run into
> this problem of running out of memory?
You might want to look into using DB_File -- your hash will use your disk
as a sort of 'virtual memory', plus your hash will be persistent between
calls of your script:
use DB_File;
tie %myhash, "DB_File", $filename or die "Can't open $filename$!\n";
#do stuff to gather data
$myhash{$somekey} = $somevalue;
#do more stuff with your data
untie %myhash;
http://www.chapelperilous.net/btfwk/
------------------------------------------------------------------------
Youth. It's a wonder that anyone ever outgrows it.