The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

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

SYNOPSIS

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

ABSTRACT

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

DESCRIPTION

POST

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