NAME
Class::XSDestructor - a destructor in XS
SYNOPSIS
package Person {
use Class::XSConstructor qw( name! age email phone );
use Class::XSDestructor;
use Class::XSAccessor {
accessors => [qw( name age email phone )],
exists_predicates => [qw( age email phone )],
};
}
DESCRIPTION
Importing this class gives you a DESTROY method which acts similarly to the DESTROY method provided by Moose and Moo, calling DEMOLISH methods at every level of the inheritance hierarchy.
It also installs a DEMOLISHALL method which does the same but accepts additional arguments which it passes on to the DEMOLISH methods, while DESTROY ignores any parameters and passes the DEMOLISH methods a single boolean parameter indicating whether the Perl process is in global destruction or not.
SEE ALSO
Class::XSConstructor, Class::XSDelegation, Class::XSReader, Class::XSAccessor.
AUTHOR
Toby Inkster <tobyink@cpan.org>.
COPYRIGHT AND LICENCE
This software is copyright (c) 2025-2026 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
DISCLAIMER OF WARRANTIES
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.