Method::Destructor - Cumulative destructors


Method-Destructor documentation  | view source Contained in the Method-Destructor distribution.

Index


NAME

Top

Method::Destructor - Cumulative destructors

VERSION

Top

This document describes Method::Destructor version 0.02.

SYNOPSIS

Top

	package Base;
	use Method::Destructor;

	sub DEMOLISH{
		# ...
	}

	package Derived;
	use parent -norequire => qw(Base);
	use Method::Destructor -optional;

	sub DEMOLISH{
		# ...
	}

	# ...

	my $x = Derived->new();
	# when $x is released,
	# Derived::DEMOLISH and Base::DEMOLISH will be called respecively.

DESCRIPTION

Top

Method::Destructor provides cumulative destructors, or DEMOLISH methods, which are introduced by Perl Best Practices and implemented in modules such as Class::Std or Moose. DEMOLISH is a destructor like DESTROY, but acts as a cumulative method.

To use the cumulative destructors, say use Method::Destructor and replace DESTROY with DEMOLISH. You can also say use Method::Destructor -optional if the destructor does not touch external resources. Optional destructors will not be called if objects are released in global destruction.

DEPENDENCIES

Top

Perl 5.8.1 or later, and a C compiler.

BUGS

Top

No bugs have been reported.

Please report any bugs or feature requests to the author.

SEE ALSO

Top

Class::Std.

Moose.

AUTHOR

Top

Goro Fuji <gfuji(at)cpan.org>.

LICENSE AND COPYRIGHT

Top


Method-Destructor documentation  | view source Contained in the Method-Destructor distribution.