1PPI::Statement::SchedulUesde(r3)Contributed Perl DocumenPtPaIt:i:oSntatement::Scheduled(3)
2
3
4
6 PPI::Statement::Scheduled - A scheduled code block
7
9 PPI::Statement::Scheduled
10 isa PPI::Statement::Sub
11 isa PPI::Statement
12 isa PPI::Node
13 isa PPI::Element
14
16 A scheduled code block is one that is intended to be run at a specific
17 time during the loading process.
18
19 There are five types of scheduled block:
20
21 BEGIN {
22 # Executes as soon as this block is fully defined
23 ...
24 }
25
26 CHECK {
27 # Executes after overall compile-phase in reverse order
28 ...
29 }
30
31 UNITCHECK {
32 # Executes after compile-phase of individual module in reverse order
33 ...
34 }
35
36 INIT {
37 # Executes just before run-time
38 ...
39 }
40
41 END {
42 # Executes as late as possible in reverse order
43 ...
44 }
45
46 Technically these scheduled blocks are actually subroutines, and in
47 fact may have 'sub' in front of them.
48
50 type
51 The "type" method returns the type of scheduled block, which should
52 always be one of 'BEGIN', 'CHECK', 'UNITCHECK', 'INIT' or 'END'.
53
55 - Write unit tests for this package
56
58 See the support section in the main module.
59
61 Adam Kennedy <adamk@cpan.org>
62
64 Copyright 2001 - 2011 Adam Kennedy.
65
66 This program is free software; you can redistribute it and/or modify it
67 under the same terms as Perl itself.
68
69 The full text of the license can be found in the LICENSE file included
70 with this module.
71
72
73
74perl v5.16.3 2011-02-26 PPI::Statement::Scheduled(3)