Perl Diver 2.31
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

autodie::Scope::Guard

Name autodie::Scope::Guard
Version 2.29
Located at /usr/share/perl5/vendor_perl
File /usr/share/perl5/vendor_perl/autodie/Scope/Guard.pm
Is Core No
Search CPAN for this module autodie::Scope::Guard
Documentation autodie::Scope::Guard
Module Details autodie::Scope::Guard

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@perltraining.com.au>


LICENSE

This module is free software. You may distribute it under the same terms as Perl itself.

Perl Diver brought to you by ScriptSolutions.com © 1997- 2024