I just wanted to correct my small example: On Thu, Apr 28, 2005 at 05:00:53PM +0200, Robin Redeker wrote: > > Robin Redeker writes: > And with explicit resource handling (without timely destruction) it may be: > > { > my $s = new CoolClass; > ... > destroy $s; > }
This should actually be, to prevent the resource from leaking: { my $s = new CoolClass; eval { ... do stuff that may throws ... }; destroy $s; } > > Not that big difference. And this is what we have with > refcounting/timely destruction: > > { > my $s = new CoolClass; > ... > } > The latter example will destruct nicely if something throws. -- [EMAIL PROTECTED] / [EMAIL PROTECTED] Robin Redeker