Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: Re (tilly) 1: Reverse Inheritance Irritance

by darobin (Monk)
on Mar 28, 2001 at 01:32 UTC ( #67647=note: print w/replies, xml ) Need Help??

in reply to Re (tilly) 1: Reverse Inheritance Irritance
in thread Reverse Inheritance Irritance

Inheritance is indeed overused and proxying is often a good way to work around it. The downside to that is that it eats up more memory, and runs slower.

While that is usually not bigger and slower enough to be truly detering, in some cases (mostly when you have potentially *lots* of object, for instance in a DOM tree) though it's clearly counter-indicated. I've been planning for a while to look into the ex::interface module on CPAN which is supposed to allow for interface inheritance but I haven't found the time at moments when my brain is in a good enough state :-/

PS: do you still have the code that made DESTROY not turn up in AUTOLOAD ? It should really be called explicitly... a code construct that doesn't force one to check for that would be interesting.

-- darobin

  • Comment on Re: Re (tilly) 1: Reverse Inheritance Irritance

Replies are listed 'Best First'.
Re (tilly) 3: Reverse Inheritance Irritance
by tilly (Archbishop) on Mar 28, 2001 at 09:03 UTC
    I was seriously confused about this. After a bit of debugging I figured it out though. Here is a simple example that shows what is going on:
    my $test = sub {bless {}}; $test->(); $test->(); $test->(); sub DESTROY { print "Calling DESTROY\n"; die "But you won't see this message\n"; }
    See it?

    DESTROY is called in an eval. Since my code was only putting out output within a confess, that output was trapped. So I saw nothing, the script kept on going, and I thought that DESTROY wasn't being called. When in fact it is...

    Mystery solved. :-)

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://67647]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2023-05-28 13:21 GMT
Find Nodes?
    Voting Booth?

    No recent polls found