The data structures were only hard-coded in my example because it was an example. You would need to create the hashes on the fly from the files, and then compare them.
If you are wanting to know all the differences in the files, you could use Test::Differences::eq_or_diff_data(), but that still wouldn't print out just the hierarchy as you wish. For that, choroba's solution seems like it may be the way to go.
But any diff solution (Test::Differences, system diff, whatever) will specify the lines at which the structures differ, so if that's all you need to know it might not be necessary to make the fully qualified "paths" choroba suggested. (It would help if you provided a sample input file and an example of the actual output you'd like to see.)
In reply to Re^3: Finding the parent of a text in a file ( is_deeply )
by 1nickt
in thread Finding the parent of a text in a file
by ExperimentsWithPerl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |