Use any serializer; the most common is Data::Dumper, but there's also XML::Dumper, Data::Denter, plus a few others. You can just eq the serialized versions, or if they're big, eq the MD5ed serialized versions.
Comment on Re: Comparing contents of 2 Hashes of Hashes