line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tree::Object::Array::Glob; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $DATE = '2016-03-30'; # DATE |
4
|
|
|
|
|
|
|
our $VERSION = '0.06'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
21083
|
use 5.010001; |
|
1
|
|
|
|
|
3
|
|
7
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
15
|
|
8
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
140
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub import { |
11
|
1
|
|
|
1
|
|
6
|
my ($class0, @attrs) = @_; |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
|
|
2
|
my $caller = caller(); |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
|
|
12
|
my $code_str = "package $caller;\n"; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
|
|
2
|
$code_str .= "use Class::Accessor::Array::Glob {\n"; |
18
|
1
|
|
|
|
|
2
|
$code_str .= " accessors => {\n"; |
19
|
1
|
|
|
|
|
1
|
my $idx = 0; |
20
|
1
|
|
|
|
|
2
|
for (@attrs, "parent", "children") { |
21
|
3
|
|
|
|
|
6
|
$code_str .= " '$_' => $idx,\n"; |
22
|
3
|
|
|
|
|
2
|
$idx++; |
23
|
|
|
|
|
|
|
} |
24
|
1
|
|
|
|
|
1
|
$code_str .= " },\n"; |
25
|
1
|
|
|
|
|
1
|
$code_str .= " glob_attribute => 'children',\n"; |
26
|
1
|
|
|
|
|
1
|
$code_str .= "};\n"; |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
|
|
1
|
$code_str .= "use Role::Tiny::With;\n"; |
29
|
1
|
|
|
|
|
1
|
$code_str .= "with 'Role::TinyCommons::Tree::NodeMethods';\n"; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
#say $code_str; |
32
|
|
|
|
|
|
|
|
33
|
1
|
|
|
1
|
|
166
|
eval $code_str; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
58
|
|
34
|
1
|
50
|
|
|
|
703
|
die if $@; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
# ABSTRACT: An array-based tree object (variant) |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |