NAME

Hook::Scope - Perl extension for adding hooks for exiting a scope

SYNOPSIS

 use Hook::Scope; 
 {
   Hook::Scope::leave(sub { print "I just left my scope"});
   print "you will see this first!";
 }

 use Hook::Scope qw(leave);
 {
   leave { print "foo" };
   leave sub { print "bar"};
 }

ABSTRACT

This module allows you to register hooks to run when the scope it is registred in has been left.

DESCRIPTION

leave

leave takes a reference to a subroutine or a subroutine name and will register a hook to run when the scope is left, note that even if the scope is left using die() the hook is run

EXPORT

None by default.

SEE ALSO

l<Hook::LexWrap>

Please report any bugs using the bug report interface at rt.cpan.org

AUTHOR

Arthur Bergman, <abergman@cpan.org>

Thanks go to Nick Ing-Simmons for the wicked idea of LEAVE;ENTER;

COPYRIGHT AND LICENSE

Copyright 2002 by Arthur Bergman

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.