in reply to Re: Tie, DBM's, HoH and Sparse Keys
in thread Tie, DBM's, HoH and Sparse Keys

Yeah, that didn't work quite as expected, so I followed runrigs suggestion and changed it to:
sub checkdbm { my $hashref=shift; my $key=shift; if (-f "$key-dbm.db") { return; } my %hash; tie (%hash,'NDBM_File',"$key-dbm",O_RDWR|O_CREAT,0640); $hashref->{$key}=\%hash; }
which works .. sorta. The DB files fill with the correct information, but my memory usage isn't any less. Odd, no?

Well, off to Storable I suppose (and I was really trying to get THIS to work ... for stubborness sake).

Replies are listed 'Best First'.
Re: Re: Re: Tie, DBM's, HoH and Sparse Keys
by TheoPetersen (Priest) on Apr 11, 2001 at 00:24 UTC
    If speed is not of the essence...

    Could you try untying the hashes in between operations on particular top-level keys? That should release the NDBM_File buffers and what-not.