Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: recursively comparing heterogenous data structures

by bikeNomad (Priest)
on Jul 06, 2001 at 21:00 UTC ( #94517=note: print w/replies, xml ) Need Help??

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
  • Log In?

    What's my password?
    Create A New User
    Domain Nodelet?
    Node Status?
    node history
    Node Type: note [id://94517]
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others taking refuge in the Monastery: (4)
    As of 2022-05-20 16:38 GMT
    Find Nodes?
      Voting Booth?
      Do you prefer to work remotely?

      Results (75 votes). Check out past polls.