in reply to Re: Re: Re: Re: How to change referent of lexical reference?
in thread How to change referent of lexical reference?
What doesn't work? Does the solution not provide a complete answer? I said that it didn't, and said what the unaddressed hard bit is. Does the technique do what I said it would? Yes. Does the technique presented show something useful to what you want to do? I believe so. Come up with a way of comparing the data structure that you are passed in with others that you have seen and then alias it by force. The hard part is doing that tracking. Does this have anything to do with how Storable implements its thaw method? Not that I can see.
Given how long my day has been I am not going to write the code for a full implementation. But I assure you that it is fairly straightforward to take the incoming structure, stringify using Storable (preferably with the canonical flag set to true), use Digest::MD5 to produce a short key, and look in a hash of other thawed structures for your element. Making this recursive to catch substructures is also doable.
But I haven't implemented this tonight, so this post has nothing that will work out of the box.
|
|---|