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;