Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Per-object DESTROY

by dmitri (Priest)
on Jul 12, 2007 at 03:53 UTC ( #626136=note: print w/replies, xml ) Need Help??


in reply to Per-object DESTROY

I think you can achieve this using subclassing, something like the following (not tested):
package MyArchive; use base 'Archive::Extract'; sub set_on_destroy { my ($self, $sub) = @_; $self->{'_on_destroy'} = $sub; } sub DESTROY { my $self = shift; if ('CODE' eq ref(my $code = $self->{'_on_destroy'})) { $code->($self); } } 1;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://626136]
help
Chatterbox?
[Corion]: Meh, first round of escalations for me not wanting to fix in production what a project has mismanaged. Now another project, which eats up all the resources until end of this year wants to take that task and put it on my list of things as well.

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2017-08-17 12:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (287 votes). Check out past polls.

    Notices?