require 'gdbm' dbfnam = (ENV['CATDB'] || 'z.database') GDBM.open(dbfnam, 0666) {|hdb| for line in ARGF key, val = line.chomp.split(/,/, 2) next if /^#/ === key hdb.store(key, val) end }