in reply to Allowing object destruction even with an

If you are on 5.6 you can try the WeakRef module.

The second thing that you can do is have your constructor return a wrapper that is a reference to the real object. This wrapper will then go away properly and you can have it properly destroy the underlying argument in its DESTROY method. This does force an extra layer of indirection though.

  • Comment on Re (tilly) 1: Allowing object destruction even with an

Replies are listed 'Best First'.
RE: Re (tilly) 1: Allowing object destruction even with an
by Fastolfe (Vicar) on Sep 08, 2000 at 01:49 UTC
    Yes! WeakRef is exactly what I needed. I can essentially weaken the reference in the @MASTER_LIST and maybe even forego the DESTROY function entirely, making sure to occasionally clean out the undef's in the list. Thanks.