I had a process with a hash that grew too big for RAM, and tied it to disk with a few simple lines:
use DB_File; # too big for RAM now my $db = '/path/to/some.db'; my %hash; unlink $db; # to start fresh tie (%hash, "DB_File", $db, $DB_BTREE) or die("Unable to tie $db: $!") +; # do things as before untie %hash;
Performance is fine.
In reply to Re: storing a large hash in a database
by hbm
in thread storing a large hash in a database
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |