NAME

ogd - ordered global destruction of objects

SYNOPSIS

use ogd;

ogd->register( @object ); # for objects from XSUBs only

DESCRIPTION

This module adds ordered destruction of object in LIFO order during global destruction.

CLASS METHODS

register

ogd->register( @object ); # only for blessed objects created in XSUBs

Not all blessed objects in Perl are necessarily created with "bless": they can also be created in XSUBs and thereby bypass the registration mechanism that ogd installs for "bless". For those cases, it is possible to register objects created in such a manner by calling the "register" class function. Any object passed to it will be registered.

REQUIRED MODULES

B (any)
Scalar::Util (any)

ORDER OF LOADING

The ogd pragma installs its own version of the "bless" system function. Without that special version of "bless", it can not work (unless you register your objects yourself). This means that the ogd pragma needs to be loaded before any modules that you want the special functionality of ogd to be applied to.

TODO

Examples should be added.

AUTHOR

Elizabeth Mattijsen, <liz@dijkmat.nl>.

Please report bugs to <perlbugs@dijkmat.nl>.

ACKNOWLEDGEMENTS

Mark Jason Dominus for the initial impetus. Yitzchak Scott-Thoennes for the suggestion of using the B module. Inspired by similar work on Thread::Bless.

COPYRIGHT

Copyright (c) 2004 Elizabeth Mattijsen <liz@dijkmat.nl>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

Thread::Bless.