autodie::Scope::Guard(3perl) Perl Programmers Reference Guide autodie::Scope::Guard(3perl)
NAME
autodie::Scope::Guard - Wrapper class for calling subs at end of scope
SYNOPSIS
use autodie::Scope::Guard;
$^H{'my-key'} = autodie::Scope::Guard->new(sub {
print "Hallo world\n";
});
DESCRIPTION
This class is used to bless perl subs so that they are invoked when they are destroyed.
This is mostly useful for ensuring the code is invoked at end of scope. This module is
not a part of autodie's public API.
This module is directly inspired by chocolateboy's excellent Scope::Guard module.
Methods
new
my $hook = autodie::Scope::Guard->new(sub {});
Creates a new "autodie::Scope::Guard", which will invoke the given sub once it goes out of
scope (i.e. its DESTROY handler is called).
AUTHOR
Copyright 2008-2009, Paul Fenwick <pjf AT perltraining.au>
LICENSE
This module is free software. You may distribute it under the same terms as Perl itself.
perl v5.34.0 2025-07-25 autodie::Scope::Guard(3perl)
Generated by $Id: phpMan.php,v 4.55 2007/09/05 04:42:51 chedong Exp $ Author: Che Dong
On Apache
Under GNU General Public License
2025-11-21 18:01 @216.73.216.164 CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)