Path: usenet.cise.ufl.edu!huron.eel.ufl.edu!usenet.eel.ufl.edu!uky.edu!atl-news-feed1.bbnplanet.com!cpk-news-hub1.bbnplanet.com!news.gtei.net!news-xfer.newsread.com!netaxs.com!newsread.com!WCG!cyclone.i1.net!uunet!in2.uu.net!news.neta.com!not-for-mail
From:
[email protected] (Brad Appleton)
Newsgroups: comp.lang.perl.announce,comp.lang.perl.modules
Subject: [ANNOUNCE] AtExit-2.00 Uploaded to CPAN
Followup-To: comp.lang.perl.modules
Date: 26 Nov 1998 03:36:17 GMT
Organization: Motorola CIG
Lines: 85
Approved:
[email protected] (comp.lang.perl.announce)
Message-ID: <
[email protected]>
Reply-To:
[email protected]
NNTP-Posting-Host: gadget.cscaper.com
X-Trace: news.neta.com 912051376 14861 206.67.186.3 (26 Nov 1998 03:36:17 GMT)
X-Complaints-To:
[email protected]
NNTP-Posting-Date: 26 Nov 1998 03:36:17 GMT
X-Disclaimer: The "Approved" header verifies header information for article transmission and does not imply approval of content.
Xref: usenet.cise.ufl.edu comp.lang.perl.announce:173 comp.lang.perl.modules:6286
Version 2.00 of the AtExit module has been uploaded to CPAN.
AtExit is a fairly simple and straightforward module that provides
atexit(3C) functionality from Perl. This is trivial to do with END{}
blocks, and in fact the first versions of the module were simply to
show a friend of mine just how easy it was (the docs were way longer
than the code).
Then Michael A. Chase <
[email protected]> emailed me some changes
made to extend it to provide exit/cleanup processing for end-of-scope
(in addition to end-of-program). I tried to keep the interface more
consistent with what exists, but the basic idea was easy enough to
do without much in the way of extra code. I just had to make several
of the functions be callable as methods as well.
Now you can atexit() and rmexit() to register & unregister "cleanup"
callbacks to invoke at program-exit.
And you can create an AtExit object using something like:
$scope = AtExit->new();
and then use use $scope->atexit() and $scope->rmexit() to register &
unregister "cleanup" callbacks to invoke when the $scope object goes
away.
Once again, the modifications to the code were few, but the mods to the
docs were more involved (new functionality, but not much new code ;-)
Here is the information from the README file for version 2.00 of AtExit:
WHAT IS THIS?
=============
This is "AtExit", a Perl5 module which exports a function name "atexit()"
to perform ANSI-C style exit processing for Perl5 programs; and a class
named "AtExit" to register clean-up functions for any variable-scope in
which the AtExit object is defined.
AUTHORS/CONTRIBUTORS
====================
Andrew Langmead <
[email protected]> (initial draft).
Brad Appleton <
[email protected]> (Version 1.02 and 2.00).
Michael A. Chase <
[email protected]> (Version 2.00).
[...]
HISTORY
=======
18-Oct-1998 Brad Appleton <
[email protected]>
-----------------------------------------------------------------------------
Version 2.00
Made the following changes based on patches contributed by Michael Chase
- AtExit may now be used as a class to create objects which invoke callbacks
whenever the AtExit object is destroyed (or goes out of scope with no
other references to it).
- atexit() and rmexit() may now be invoked as functions, or as methods.
When invoked as methods, they operate on an object for destruction-time
callbacks. Otherwise they operate on the program for program-exit-time
callbacks.
- Added the exit_subs(), is_exiting() and ignore_when_exiting() subroutines
to replace the use of @AtExit::EXIT_SUBS, $AtExit::EXITING, and
$AtExit::IGNORE_WHEN_EXITING. Use of these three variables is now
deprecated in favor of these new subroutines.
Although atexit & rmexit are still exported (for backward compatibility),
exit_subs(), is_exiting() and ignore_when_exiting() are NOT exported
by default.
- $AtExit::EXITING, $AtExit::IGNORE_WHEN_EXITING, and @AtExit::EXIT_SUBS
are now merely aliases to a class hash/object.
[...]
Please see the README file in the distribution for details regarding previous
versions, as well as copyrights, disclaimers, and installation.
--
Brad Appleton <
[email protected]> |
http://www.enteract.com/~bradapp/
"And miles to go before I sleep." | 3700+ WWW links on CS & Sw-Eng