in reply to Using Storable effectively

Inheritance in Perl is handled via the @ISA array. You should be able to do something like this:

package MyModule; use Storable; use vars qw(@ISA); @ISA=qw(Storable); #oops! original had quotes in it. # other methods # overrides Storable's thaw sub thaw { my $this = shift; $this->SUPER::thaw( @_ ); $this->post_loaded_function(); } 1;

HTH

Replies are listed 'Best First'.
Re: Re: Using Storable effectively
by Hrunting (Pilgrim) on Apr 18, 2001 at 20:55 UTC
    Right, I'm sorry, I left out the @ISA portion of the code. Yes, the Storable module is being inherited. Actually, the problem now that I use your code is that I was inheriting STORABLE_freeze/thaw rather than just inheriting freeze/thaw. The documentation makes it sound like that's what you need to do if you want to override those abilities. Misread that, I guess.

    Thanks for the help.

Re: Re: Using Storable effectively
by Hrunting (Pilgrim) on Apr 18, 2001 at 21:06 UTC
    Actually, I lied, that's not working. I'm freezing and thawing this stuff separately (ie, not OO). Therefore, freeze() or thaw() never gets called in an OO fashion, and inheritance doesn't apply. STORABLE_freeze() and STORABLE_thaw() methods are supposed to allow you to "hook" into the Storable processing, but once in, you can't back out and use Storable's default (C-based) serialization routines.

    It appears