use DB_File; my $db = '/path/to/hash.db'; my %hash; tie (%hash, "DB_File", $db, $DB_BTREE) or die("Unable to tie $db: $!"); # do things with hash untie %hash;