in reply to How do you delete an unwanted object?

undef does indeed invoke garbage destruction as can be shown in the following code.
#!/usr/bin/perl -w use strict; my $foo = new stuff; my $bar = new stuff; print $foo,"\n"; $foo = undef; print STDERR "foo gone\n"; exit; package stuff; sub new { my $self = []; bless $self; return $self; } sub DESTROY { my ($self) = @_; print STDERR "destroying...\n"; } 1;
The output is:
stuff=ARRAY(0x80cb9c8)
destroying...
foo gone
destroying...
As you can see:
  1. $foo gets undef'ed
  2. DESTROY gets called for $foo
  3. program exits, begins garbage collection
  4. DESTROY gets called for $bar
  5. program exits
The real question is do Gtk::CList objects get refrenced anywhere else or have circluar data structures that will prevent them from getting destroyed with the undef?