Dear Monks,
According to "Intermediate Perl 2nd":
1) DESTROY is like other method calls: Perl starts at the class of the object and works its way up the inheritance hierarchy until it finds a suitable method. However, unlike other method calls, there's no error if Perl doesn't find a suitable method. (p. 140)
However I get an error when I run this code:
use strict; use warnings; use 5.010; {package B; sub new { my $class = shift; bless {}, $class; } sub DESTROY { my $self = shift; say "destroy"; $self->SUPER::DESTROY; } } --output:-- (in cleanup) Can't locate object method "DESTROY" via package "B" at C +:\Users\Me\Documents\perl2.pl line 17. destroy
In reply to DESTROY problem by 7stud
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |