File: README.md

package info (click to toggle)
libb-hooks-endofscope-perl 0.13-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 268 kB
  • ctags: 16
  • sloc: perl: 320; makefile: 7
file content (71 lines) | stat: -rw-r--r-- 1,767 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# NAME

B::Hooks::EndOfScope - Execute code after a scope finished compilation

# VERSION

version 0.13

# SYNOPSIS

    on_scope_end { ... };

# DESCRIPTION

This module allows you to execute code when perl finished compiling the
surrounding scope.

# FUNCTIONS

## on\_scope\_end

    on_scope_end { ... };

    on_scope_end $code;

Registers `$code` to be executed after the surrounding scope has been
compiled.

This is exported by default. See [Sub::Exporter](https://metacpan.org/pod/Sub::Exporter) on how to customize it.

# PURE-PERL MODE CAVEAT

While [Variable::Magic](https://metacpan.org/pod/Variable::Magic) has access to some very dark sorcery to make it
possible to throw an exception from within a callback, the pure-perl
implementation does not have access to these hacks. Therefore, what
would have been a compile-time exception is instead converted to a
warning, and your execution will continue as if the exception never
happened.

To explicitly request an XS (or PP) implementation one has two choices. Either
to import from the desired implementation explicitly:

    use B::Hooks::EndOfScope::XS
      or
    use B::Hooks::EndOfScope::PP

or by setting `$ENV{B_HOOKS_ENDOFSCOPE_IMPLEMENTATION}` to either `XS` or
`PP`.

# SEE ALSO

[Sub::Exporter](https://metacpan.org/pod/Sub::Exporter)

[Variable::Magic](https://metacpan.org/pod/Variable::Magic)

# AUTHORS

- Florian Ragwitz <rafl@debian.org>
- Peter Rabbitson <ribasushi@cpan.org>

# COPYRIGHT AND LICENSE

This software is copyright (c) 2008 by Florian Ragwitz.

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

# CONTRIBUTORS

- Karen Etheridge <ether@cpan.org>
- Tomas Doran <bobtfish@bobtfish.net>