Subject: | DESTROY not supported |
DESTROYing a Chatbot::Eliza object generates the following error:
Can't access `DESTROY' field in object of class Chatbot::Eliza
Which is because the AUTOLOAD is overzealous. Here is a patch:
--- Eliza.pm.orig Wed Nov 28 17:04:58 2001
+++ Eliza.pm Wed Nov 28 17:05:22 2001
@@ -374,6 +374,8 @@
my $field = $AUTOLOAD;
$field =~ s/.*://; # Strip fully-qualified portion
+ return if $field eq 'DESTROY';
+
unless (exists $self->{"_permitted"}->{$field} ) {
croak "Can't access `$field' field in object of class $class : $!\n";
}
ps the author isn't replying to his email