Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add some docs.

  • Loading branch information...
commit 09fda95bee93b4479dccc02ef2475dec23fdf8b7 1 parent 04e0789
Florian Ragwitz authored

Showing 1 changed file with 44 additions and 0 deletions. Show diff stats Hide diff stats

  1. +44 0 lib/B/Hooks/EndOfScope.pm
44 lib/B/Hooks/EndOfScope.pm
@@ -14,6 +14,32 @@ use Sub::Exporter -setup => {
14 14 groups => { default => ['on_scope_end'] },
15 15 };
16 16
  17 +=head1 NAME
  18 +
  19 +B::Hooks::EndOfScope - Execute code after a scope finished compilation
  20 +
  21 +=head1 SYNOPSIS
  22 +
  23 + on_scope_end { ... };
  24 +
  25 +=head1 DESCRIPTION
  26 +
  27 +This module allows you to execute code when perl finished compiling the
  28 +surrounding scope.
  29 +
  30 +=head1 FUNCTIONS
  31 +
  32 +=head2 on_scope_end
  33 +
  34 + on_scope_end { ... };
  35 +
  36 + on_scope_end $code;
  37 +
  38 +Registers C<$code> to be executed after the surrounding scope has been
  39 +compiled.
  40 +
  41 +=cut
  42 +
17 43 sub on_scope_end (&) {
18 44 my $cb = shift;
19 45
@@ -21,4 +47,22 @@ sub on_scope_end (&) {
21 47 $^H{ $SCOPE_HOOK_KEY } = [Scope::Guard->new($cb), @{ $^H{ $SCOPE_HOOK_KEY } || [] }];
22 48 }
23 49
  50 +=head1 SEE ALSO
  51 +
  52 +L<Scope::Guard>
  53 +
  54 +=head1 AUTHOR
  55 +
  56 +Florian Ragwitz E<lt>rafl@debian.orgE<gt>
  57 +
  58 +=head1 COPYRIGHT AND LICENSE
  59 +
  60 +Copyright (c) 2008 Florian Ragwitz
  61 +
  62 +This module is free software.
  63 +
  64 +You may distribute this code under the same terms as Perl itself.
  65 +
  66 +=cut
  67 +
24 68 1;

0 comments on commit 09fda95

Please sign in to comment.
Something went wrong with that request. Please try again.