So, I want to use the Storable module to make my objects persistent, but I can't seem to use what Storable says are "inheritable" features. For instance, so I have some code like this:
package MyModule;
sub STORABLE_freeze {
my $this = shift;
my $value = $this->{'key'};
delete $this->{'key'};
my $serialized = $this->SUPER::STORABLE_freeze( @_ );
# or $this->SUPER::freeze( @_ ) or etc. etc.
$this->{'key'} = $key;
return $serialized;
}
sub STORABLE_thaw {
my $this = shift;
$this->SUPER::STORABLE_thaw( @_ );
# or $this->SUPER::thaw( @_ ) or any other arrangment
$this->post_loaded_function();
}
1;
The problem is, that once I'm in STORABLE_freeze/thaw, I can't access the functions of my parent without either a) generating an error or b) throwing myself into an endless loop where I'm repeatedly calling myself. How in the world are you supposed to use Storable's routines from when you're being called as the Storable freeze/thaw function?