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

See this
$ perl -le"print for grep /^\w+::/, keys %:: version:: Tie:: utf8:: re:: CORE:: DynaLoader:: mro:: Win32CORE:: attributes:: Regexp:: UNIVERSAL:: main:: Win32:: PerlIO:: IO:: Internals:: DB::
Its not inconceivable that B could be loaded without an explicit use B;

Replies are listed 'Best First'.
Re^4: DESTROY problem
by 7stud (Deacon) on Dec 31, 2010 at 22:07 UTC

    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.