in reply to Re^3: DESTROY problem
in thread DESTROY problem

I get the same output if I change the class name:

use strict; use warnings; use 5.010; {package Dog; sub new { my $class = shift; bless {}, $class; } sub DESTROY { my $self = shift; say "destroy"; $self->SUPER::DESTROY; } } my $d = Dog->new; --output:-- destroy (in cleanup) Can't locate object method "DESTROY" via package +"Dog" at perl2.pl line 16.

I ran the program like this:

C:\Users\Me\Documents>perl perl2.pl

I'll follow JavaFan's instructions--rather than Randall Scwhartz's.