=================================================================== RCS file: /cvs/todotxt/Text-Todo/lib/Text/Todo.pm,v retrieving revision 1.19 retrieving revision 1.23 diff -u -r1.19 -r1.23 --- todotxt/Text-Todo/lib/Text/Todo.pm 2010/01/18 02:46:48 1.19 +++ todotxt/Text-Todo/lib/Text/Todo.pm 2010/01/22 01:30:45 1.23 @@ -1,6 +1,6 @@ package Text::Todo; -# $AFresh1: Todo.pm,v 1.17 2010/01/12 20:09:02 andrew Exp $ +# $AFresh1: Todo.pm,v 1.22 2010/01/19 18:53:36 andrew Exp $ use warnings; use strict; @@ -10,14 +10,17 @@ use Text::Todo::Entry; use File::Spec; -use version; our $VERSION = qv('0.0.1'); +use version; our $VERSION = qv('0.1.1'); { - my %path_of; - my %list_of; - my %loaded_of; + my @attr_refs = \( + my %path_of, + my %list_of, + my %loaded_of, + ); + sub new { my ( $class, $options ) = @_; @@ -382,6 +385,17 @@ croak "Invalid entry [$entry]!"; } + + sub DESTROY { + my ($self) = @_; + my $ident = ident $self; + + foreach my $attr_ref (@attr_refs) { + delete $attr_ref->{$ident}; + } + + return; + } } 1; # Magic true value required at end of module @@ -397,7 +411,7 @@ Since the $VERSION can't be automatically included, here is the RCS Id instead, you'll have to look up $VERSION. - $Id: Todo.pm,v 1.19 2010/01/18 02:46:48 andrew Exp $ + $Id: Todo.pm,v 1.23 2010/01/22 01:30:45 andrew Exp $ =head1 SYNOPSIS