In the lazy-load case I want to ensure that the real object is loaded before forwarding, so it's not that simple.You can call the super class's constructor first:
And then store it, or use it, or rebless it, or whatever.package 'Bar'; use base 'Foo'; sub new { my $class = shift; my $parent_class_object = SUPER->new(); ... }
In reply to Re^3: object swizzling?
by Anonymous Monk
in thread object swizzling?
by perl5ever
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |