Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Per-object DESTROY

by dmitri (Curate)
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;


Comment on Re: Per-object DESTROY
Download Code

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 perusing the Monastery: (6)
As of 2015-07-07 05:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls