dbm can't store anything but strings. So it converted your second level hash to a string. If you need to store things like this, consider combining Storable with dbmopen. First use freeze from Storable to turn the object into a string. Then store that via the dbm hash. Later, use thaw to get the data back.