http://qs321.pair.com?node_id=94517


in reply to recursively comparing heterogenous data structures

You can generalize this into a more useful routine by allowing the user to provide optional subroutine refs that will be called when:<bl>
  • A has something that B doesn't
  • B has something that A doesn't
  • A and B have different values
  • A and B have same values </bl>

    See Algorithm::Diff for an example of passing in such subroutines. And you should also provide for an extra scalar that will be passed to the user subroutines, so the user can provide context to them without using globals.

    • Comment on Re: recursively comparing heterogenous data structures