line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tags::Element; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
58872
|
use base qw(Exporter); |
|
3
|
|
|
|
|
15
|
|
|
3
|
|
|
|
|
359
|
|
4
|
3
|
|
|
3
|
|
16
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
46
|
|
5
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
3
|
|
|
|
|
12
|
|
|
3
|
|
|
|
|
70
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
1324
|
use Readonly; |
|
3
|
|
|
|
|
10151
|
|
|
3
|
|
|
|
|
576
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# Constants. |
10
|
|
|
|
|
|
|
Readonly::Array our @EXPORT_OK => qw(element); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# Version. |
13
|
|
|
|
|
|
|
our $VERSION = 0.04; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# Common element. |
16
|
|
|
|
|
|
|
sub element { |
17
|
8
|
|
|
8
|
1
|
6786
|
my ($element, @data) = @_; |
18
|
|
|
|
|
|
|
|
19
|
8
|
|
|
|
|
14
|
my @attr; |
20
|
|
|
|
|
|
|
my @content; |
21
|
8
|
|
|
|
|
15
|
foreach my $ref (@data) { |
22
|
10
|
100
|
|
|
|
29
|
if (ref $ref eq 'HASH') { |
|
|
100
|
|
|
|
|
|
23
|
4
|
|
|
|
|
7
|
foreach my $key (sort keys %{$ref}) { |
|
4
|
|
|
|
|
12
|
|
24
|
3
|
|
|
|
|
10
|
push @attr, ['a', $key, $ref->{$key}]; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} elsif (ref $ref eq 'ARRAY') { |
27
|
3
|
|
|
|
|
4
|
push @content, @{$ref}; |
|
3
|
|
|
|
|
6
|
|
28
|
|
|
|
|
|
|
} else { |
29
|
3
|
|
|
|
|
8
|
push @content, ['d', $ref]; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
return ( |
34
|
8
|
100
|
|
|
|
49
|
['b', $element], |
|
|
100
|
|
|
|
|
|
35
|
|
|
|
|
|
|
@attr ? @attr : (), |
36
|
|
|
|
|
|
|
@content ? @content : (), |
37
|
|
|
|
|
|
|
['e', $element], |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |