in reply to Re: Need a module for persistence of dynamic objects
in thread Need a module for persistence of dynamic objects

The next challenge is that one of my structures contains coderefs. This could prove interesting. :-)
Can you turn those coderefs into methods and simply rebless and object into resurrection?
  • Comment on Re: Re: Need a module for persistence of dynamic objects

Replies are listed 'Best First'.
Re: Re: Re: Need a module for persistence of dynamic objects
by rinceWind (Monsignor) on Feb 18, 2002 at 18:12 UTC

    princepawn wrote:
    > Can you turn those coderefs into methods and simply rebless and object into resurrection?

    In this instance, no (nice idea though :-)). The coderefs here are closures containing info private to the object. Hence they do not want to be available to other objects in the same class.

    I have a workaround, based on keeping a scalar alongside the coderef, which holds the code in string form. These are kept together in a code object. I am using storeable's STORABLE_freeze and STORABLE_thaw hooks to provide my own serialisation of said objects. This is working fine.

    I am tempted to publish when I have some complete, working code.

    rW