in reply to Passing self from class to class?
Maybe I am misunderstanding, but I think you would be better off subclassing your original class and calling the parent constructor. If a subclass is innapropriate, then SomeOtherClass should instantiate its own SomeClass object, store it in $self and use accessors that way. With either strategy, your eval will use SomeOtherClass instead of SomeClass.
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
|---|