If I have an object and I want to increase it's functionality by "upgrading/promoting" it to a subclass if certain conditions are met during a method call, could/should I use something like:
sub some_method { my $self = $_[0]; # ... if (PROMOTE_CONDITION) { $_[0] = Subclass->copy_constructor($self); } } That will change the reference in the calling code, right? Any reason I shouldn't do this? James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]