You can use
Storable (a core module) for generating a compact (binary) string representation of a hash, but make sure to first set
$Storable::canonical = 1;
You can either use that value directly for comparison, or calculate a checksum from it.
Perl 6 - links to (nearly) everything that is Perl 6.