debian man page for aspect::guard

Query: aspect::guard

OS: debian

Section: 3pm

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

Aspect::Guard(3pm)					User Contributed Perl Documentation					Aspect::Guard(3pm)

NAME
Aspect::Guard - General purpose guard object for destroy-time actions
SYNOPSIS
SCOPE: { my $guard = Aspect::Guard->new( sub { print "Goodbye World! "; } ); } # Prints here as it exits the scope
DESCRIPTION
The Aspect::Guard class shipping with Aspect is a convenience module for creating "CODE" based objects that execute when they fall out of scope. It's usage is effectively summarised by the synopsis.
METHODS
new my $guard = Aspect::Guard->new( sub { do_something(); } ); The "new" method creates a new guard object. It takes a single "CODE" references as a parameter, which it will bless into the guard class, which will execute the code reference when it's "DESTROY" hook is called.
AUTHOR
Adam Kennedy <adamk@cpan.org>
COPYRIGHT
Copyright 2011 Adam Kennedy. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-02-01 Aspect::Guard(3pm)
Related Man Pages
aspect::advice(3pm) - debian
aspect::advice::after(3pm) - debian
aspect::advice::before(3pm) - debian
aspect::modular(3pm) - debian
aspect::point::functions(3pm) - debian
Similar Topics in the Unix Linux Community
Adding the individual columns of a matrix.
awk or sed - Convert 2 lines to 1 line
Is UNIX an open source OS ?
One instance of comparing grep and awk
New UNIX and Linux History Sections