如何做一个简单的Perl哈希等价比较? [英] How do I do a simple Perl hash equivalence comparison?

查看:143
本文介绍了如何做一个简单的Perl哈希等价比较?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有一个惯用的一线程或标准分发包/函数,我可以用来比较两个Perl哈希值与内置的,非祝福类型。哈希值不相同(它们没有等效的内存地址)。

I'm wondering if there's an idiomatic one-liner or a standard-distribution package/function that I can use to compare two Perl hashes with only builtin, non-blessed types. The hashes are not identical (they don't have equivalent memory addresses).

我想知道浅层哈希和散列与嵌套集合的答案,但我理解浅散列可能有一个更简单的解决方案。

I'd like to know the answer for both for shallow hashes and hashes with nested collections, but I understand that shallow hashes may have a much simpler solution.

TIA!

推荐答案

Test :: Deep 中提供的cmp_deeply类似?

Something like cmp_deeply available in Test::Deep ?

这篇关于如何做一个简单的Perl哈希等价比较?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆