Perl needs to compare two data structures and the difference in return

I have two data structures with a mix of hashes and arrays. How can I compare two data structures and return their differences, something like perl Test :: Harness, but I don't want to run unit test .... or is there a way to drag Test :: Harness without actually running unit test?

+3
source share
2 answers

Perl Monks says that Test :: Deep , Data :: Compare and Data :: Match are your friends. These packages do not seem to aim at creating detailed differences, but you can hack a callback to track the exact differences.

+4

Test:: Deep:: NoTest ( Test:: Deep) , , Test:: script (eq_deeply, cmp_deeply ..). , deep_diag(), , .

Data:: Compare - , (, cmp ), ( ) .

, , deep_diag(), Data:: Compare , .

+3

Source: https://habr.com/ru/post/1771232/


All Articles