GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
autodie::Scope::Guard(3) User Contributed Perl Documentation autodie::Scope::Guard(3)

autodie::Scope::Guard - Wrapper class for calling subs at end of scope

    use autodie::Scope::Guard;
    $^H{'my-key'} = autodie::Scope::Guard->new(sub {
        print "Hallo world\n";
    });

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.

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).

Copyright 2008-2009, Paul Fenwick <pjf@perltraining.com.au>

This module is free software. You may distribute it under the same terms as Perl itself.
2015-07-09 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.