| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Acme::AllThePerlIsAStage::AndAllTheMenAndWomenJAPH; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
4
|
use strict; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
28
|
|
|
4
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
31
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
213
|
BEGIN { print __PACKAGE__ . " - And so it BEGINs … (\${^GLOBAL_PHASE} is '${^GLOBAL_PHASE}')\n" } |
|
7
|
|
|
|
|
|
|
$Acme::AllThePerlIsAStage::AndAllTheMenAndWomenJAPH::VERSION = '0.01'; |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my $my_set_at_global = $$; |
|
10
|
|
|
|
|
|
|
my $my_set_at_run; |
|
11
|
|
|
|
|
|
|
my $my_set_at_begin; |
|
12
|
|
|
|
|
|
|
my $my_set_at_unitcheck; |
|
13
|
|
|
|
|
|
|
my $my_set_at_check; |
|
14
|
|
|
|
|
|
|
my $my_set_at_init; |
|
15
|
|
|
|
|
|
|
my $my_set_at_end; |
|
16
|
|
|
|
|
|
|
my $my_set_at_init_and_run; |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $our_set_at_global = $$; |
|
19
|
|
|
|
|
|
|
our $our_set_at_run; |
|
20
|
|
|
|
|
|
|
our $our_set_at_begin; |
|
21
|
|
|
|
|
|
|
our $our_set_at_unitcheck; |
|
22
|
|
|
|
|
|
|
our $our_set_at_check; |
|
23
|
|
|
|
|
|
|
our $our_set_at_init; |
|
24
|
|
|
|
|
|
|
our $our_set_at_end; |
|
25
|
|
|
|
|
|
|
our $our_set_at_init_and_run; |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub import { |
|
28
|
1
|
|
|
1
|
|
2
|
_say_stage("inside import()"); |
|
29
|
|
|
|
|
|
|
} |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# Since we are doing BEGIN blocks that call this we need it first: |
|
32
|
|
|
|
|
|
|
sub _say_stage { |
|
33
|
13
|
|
|
13
|
|
18
|
my ($name) = @_; |
|
34
|
13
|
|
|
|
|
112
|
print caller() . " - $name (\${^GLOBAL_PHASE} is '${^GLOBAL_PHASE}')\n"; |
|
35
|
13
|
50
|
|
|
|
1002
|
return unless $ENV{'AllThePerlIsAStage_verbose'}; |
|
36
|
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
for my $var ( |
|
38
|
|
|
|
|
|
|
qw( |
|
39
|
|
|
|
|
|
|
my_set_at_global my_set_at_run my_set_at_begin my_set_at_unitcheck my_set_at_check my_set_at_init my_set_at_end my_set_at_init_and_run |
|
40
|
|
|
|
|
|
|
our_set_at_global our_set_at_run our_set_at_begin our_set_at_unitcheck our_set_at_check our_set_at_init our_set_at_end our_set_at_init_and_run |
|
41
|
|
|
|
|
|
|
) |
|
42
|
|
|
|
|
|
|
) { |
|
43
|
1
|
|
|
1
|
|
4
|
no strict 'refs'; ## no critic |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
146
|
|
|
44
|
0
|
0
|
|
|
|
|
my $val = defined ${$var} ? "'${$var}'" : 'undef() (i.e. not initialized at this point)'; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
my $spacing = " " x ( 22 - length($var) ); |
|
46
|
0
|
|
|
|
|
|
print "\t\$$var$spacing is $val\n"; |
|
47
|
|
|
|
|
|
|
} |
|
48
|
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
print "\n"; |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
#### now the meat and potatoes ## |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
_say_stage("Global Scope 1"); |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
if ( ${^GLOBAL_PHASE} eq 'RUN' ) { |
|
57
|
|
|
|
|
|
|
$my_set_at_run = $$; |
|
58
|
|
|
|
|
|
|
$our_set_at_run = $$; |
|
59
|
|
|
|
|
|
|
$my_set_at_init_and_run = $$; |
|
60
|
|
|
|
|
|
|
$our_set_at_init_and_run = $$; |
|
61
|
|
|
|
|
|
|
_say_stage("IF-RUN 1"); |
|
62
|
|
|
|
|
|
|
} |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
BEGIN { |
|
65
|
1
|
|
|
1
|
|
2
|
$my_set_at_begin = $$; |
|
66
|
1
|
|
|
|
|
2
|
$our_set_at_begin = $$; |
|
67
|
1
|
|
|
|
|
5
|
_say_stage("BEGIN 1"); |
|
68
|
|
|
|
|
|
|
} |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
UNITCHECK { |
|
71
|
|
|
|
|
|
|
$my_set_at_unitcheck = $$; |
|
72
|
|
|
|
|
|
|
$our_set_at_unitcheck = $$; |
|
73
|
|
|
|
|
|
|
_say_stage("UNITCHECK 1"); |
|
74
|
|
|
|
|
|
|
} |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
CHECK { |
|
77
|
1
|
|
|
1
|
|
2
|
$my_set_at_check = $$; |
|
78
|
1
|
|
|
|
|
1
|
$our_set_at_check = $$; |
|
79
|
1
|
|
|
|
|
2
|
_say_stage("CHECK 1"); |
|
80
|
|
|
|
|
|
|
} |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
INIT { |
|
83
|
1
|
|
|
1
|
|
3
|
$my_set_at_init = $$; |
|
84
|
1
|
|
|
|
|
2
|
$our_set_at_init = $$; |
|
85
|
1
|
|
|
|
|
2
|
$my_set_at_init_and_run = $$; |
|
86
|
1
|
|
|
|
|
1
|
$our_set_at_init_and_run = $$; |
|
87
|
1
|
|
|
|
|
3
|
_say_stage("INIT 1"); |
|
88
|
|
|
|
|
|
|
} |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
END { |
|
91
|
1
|
|
|
1
|
|
2
|
$my_set_at_end = $$; |
|
92
|
1
|
|
|
|
|
1
|
$our_set_at_end = $$; |
|
93
|
1
|
|
|
|
|
2
|
_say_stage("END 1"); |
|
94
|
|
|
|
|
|
|
} |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
END { |
|
97
|
1
|
|
|
1
|
|
2
|
_say_stage("END 2"); |
|
98
|
|
|
|
|
|
|
} |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
INIT { |
|
101
|
1
|
|
|
1
|
|
3
|
_say_stage("INIT 2"); |
|
102
|
|
|
|
|
|
|
} |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
CHECK { |
|
105
|
1
|
|
|
1
|
|
2
|
_say_stage("CHECK 2"); |
|
106
|
|
|
|
|
|
|
} |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
UNITCHECK { |
|
109
|
|
|
|
|
|
|
_say_stage("UNITCHECK 2"); |
|
110
|
|
|
|
|
|
|
} |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
BEGIN { |
|
113
|
1
|
|
|
1
|
|
3
|
_say_stage("BEGIN 2"); |
|
114
|
|
|
|
|
|
|
} |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
if ( ${^GLOBAL_PHASE} eq 'RUN' ) { |
|
117
|
|
|
|
|
|
|
_say_stage("IF-RUN 2"); |
|
118
|
|
|
|
|
|
|
} |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
_say_stage("Global Scope 2"); |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
1; |