Ahh I had searched cpan and asked in the chatterbox for related modules, but the closest match in functionality I could find was Data::Walk.
Data::Rmap looks like a nice module with a very similar intent, but it doesn't seem to use copy-on-write to protect the original structure. Please correct me if I overlooked something.
My intention with the cheap copy-on-write is to only clone the branches that have changes, and to use a cheap shallow copy for the unchanged branches. This way if you have a reference to a large dataset (e.g. cached lookup tables) you will not be wasting memory by cloning unmodified nodes.
|