Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2016-08-28 05:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (390 votes). Check out past polls.