use DB_File; my %db; tie (%db,'DB_File','./myhashfile.dat') or die "Can't open hash file\n"; # do stuff with %db here untie %db;