Posted on 2009-09-15 18:01:40-07 by jerome in response to 11449
Re: Retrieving or thawing arbitrary OIO-based classes

Thanks for your prompt response. I actually tried something similar while troubleshooting but without the last call to 'new'. Your example assumes though that the receiving process knows how to instantiate $class. That won't be the case for me. Am I right to think that the sole purpose of your call to 'new' is to run 'initialize'? Before posting to this forum I realized that calling (a hacked-up version of) 'initialize' before thawing seems to do the trick as well. Would it make sense to allow users to do something like this instead?:

sub load_class { my $class = $_[0]; eval "require $class"; if ($@) { die("Failed to load $class: ".$@); } $class->initialize; }
Direct Responses: 11452 | Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.