Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add some docs.

  • Loading branch information...
commit 09fda95bee93b4479dccc02ef2475dec23fdf8b7 1 parent 04e0789
Florian Ragwitz authored
Showing with 44 additions and 0 deletions.
  1. +44 −0 lib/B/Hooks/EndOfScope.pm
44 lib/B/Hooks/EndOfScope.pm
View
@@ -14,6 +14,32 @@ use Sub::Exporter -setup => {
groups => { default => ['on_scope_end'] },
};
+=head1 NAME
+
+B::Hooks::EndOfScope - Execute code after a scope finished compilation
+
+=head1 SYNOPSIS
+
+ on_scope_end { ... };
+
+=head1 DESCRIPTION
+
+This module allows you to execute code when perl finished compiling the
+surrounding scope.
+
+=head1 FUNCTIONS
+
+=head2 on_scope_end
+
+ on_scope_end { ... };
+
+ on_scope_end $code;
+
+Registers C<$code> to be executed after the surrounding scope has been
+compiled.
+
+=cut
+
sub on_scope_end (&) {
my $cb = shift;
@@ -21,4 +47,22 @@ sub on_scope_end (&) {
$^H{ $SCOPE_HOOK_KEY } = [Scope::Guard->new($cb), @{ $^H{ $SCOPE_HOOK_KEY } || [] }];
}
+=head1 SEE ALSO
+
+L<Scope::Guard>
+
+=head1 AUTHOR
+
+Florian Ragwitz E<lt>rafl@debian.orgE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (c) 2008 Florian Ragwitz
+
+This module is free software.
+
+You may distribute this code under the same terms as Perl itself.
+
+=cut
+
1;
Please sign in to comment.
Something went wrong with that request. Please try again.