On Mon, Aug 18, 2003 at 05:50:16PM -0400, Chip Salzenberg wrote: > According to Simon Cozens: > > Yitzchak Scott-Thoennes: > > > > > my $y; > > > > > { my $x = bless sub { $y }, 'X'; } > > > > > sub X::DESTROY { print "DESTROYED\n" } > > > > My initial reaction is that calling a destructor on a sub that happens > > to be a closure and not on one that doesn't is not just an unexpected > > special case, but it's surely a bug. Why (and I ask this honestly, not > > rhetorically) is it supposed to be so hard to fix? > > Because every value of > > $a = sub { print "hi" } > > is the same CV. Printing $a will confirm this. The original owner of Oh yes. Mmm. Arguably action at a distance: $ perl -le 'sub foo { return sub {}}; $a = foo; $b = foo; print ref $b; bless $a; print ref $b' CODE main Nicholas ClarkThread Previous | Thread Next