in reply to @ISA, Inheritance, and Class Methods
And the first idea that came to me was your idea of writing a wrapper object. But I didn't like the idea too much. The next idea (and I think this was someone else's idea) was to do it like this:sub DESTROY { my $self = shift; $self->Finish(); }
To replace an already existing method you would only need to add no strict and (5.6+) no warnings within the block. As it turns out, and the more advanced have already made this jump, you can just declare:{ package Class; sub DESTROY { my $self = shift; $self->Finish(); } }
Aint it grand? :-)sub Class::DESTROY { my $self = shift; $self->Finish(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 2: @ISA, Inheritance, and Class Methods
by tilly (Archbishop) on Mar 13, 2001 at 21:12 UTC |