require 'dbm'

d = DBM.new("data")
d["123"] = "toodle-oo!"
puts d["123"]        # "toodle-oo!"
d.close
puts d["123"]        # RuntimeError: closed DBM file
e = DBM.open("data")
e["123"]                # "toodle-oo!"
w=e.to_hash                # {"123"=>"toodle-oo!"}
e.close
e["123"]                # RuntimeError: closed DBM file
w["123"]                # "toodle-oo!

