line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::AsSubs; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: functions that construct a HTML syntax tree |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
24047
|
use warnings; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
32
|
|
7
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
454
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '5.909'; # TRIAL VERSION from OurPkgVersion |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
require HTML::Element; |
12
|
|
|
|
|
|
|
require Exporter; |
13
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# Problem: exports so damned much. Has no concept of "export only HTML4 |
16
|
|
|
|
|
|
|
# elements". TODO:?? make something that make functions that just |
17
|
|
|
|
|
|
|
# wrap XML::Generator calls? |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
our @TAGS = qw(html |
21
|
|
|
|
|
|
|
head title base link meta isindex nextid script style |
22
|
|
|
|
|
|
|
body h1 h2 h3 h4 h5 h6 p pre div blockquote |
23
|
|
|
|
|
|
|
a img br hr |
24
|
|
|
|
|
|
|
ol ul dir menu li |
25
|
|
|
|
|
|
|
dl dt dd |
26
|
|
|
|
|
|
|
dfn cite code em kbd samp strong var address span |
27
|
|
|
|
|
|
|
b i u tt |
28
|
|
|
|
|
|
|
center font big small strike |
29
|
|
|
|
|
|
|
sub sup |
30
|
|
|
|
|
|
|
table tr td th caption |
31
|
|
|
|
|
|
|
form input select option textarea |
32
|
|
|
|
|
|
|
object applet param |
33
|
|
|
|
|
|
|
map area |
34
|
|
|
|
|
|
|
frame frameset noframe |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
our @EXPORT; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
for (@TAGS) { |
40
|
|
|
|
|
|
|
my $code; |
41
|
|
|
|
|
|
|
$code = "sub $_ { _elem('$_', \@_); }\n"; |
42
|
|
|
|
|
|
|
push( @EXPORT, $_ ); |
43
|
|
|
|
|
|
|
## no critic |
44
|
4
|
|
|
4
|
1
|
3407
|
eval $code; |
|
1
|
|
|
1
|
1
|
472
|
|
|
1
|
|
|
1
|
1
|
536
|
|
|
1
|
|
|
1
|
1
|
2726
|
|
|
1
|
|
|
1
|
1
|
590
|
|
|
1
|
|
|
1
|
1
|
483
|
|
|
1
|
|
|
1
|
1
|
435
|
|
|
1
|
|
|
1
|
1
|
1248
|
|
|
1
|
|
|
1
|
1
|
668
|
|
|
1
|
|
|
1
|
1
|
464
|
|
|
1
|
|
|
1
|
1
|
592
|
|
|
1
|
|
|
1
|
1
|
508
|
|
|
1
|
|
|
1
|
1
|
842
|
|
|
1
|
|
|
1
|
1
|
774
|
|
|
1
|
|
|
1
|
1
|
648
|
|
|
1
|
|
|
1
|
1
|
933
|
|
|
1
|
|
|
1
|
1
|
1493
|
|
|
1
|
|
|
1
|
1
|
586
|
|
|
1
|
|
|
1
|
1
|
786
|
|
|
1
|
|
|
1
|
1
|
569
|
|
|
1
|
|
|
1
|
1
|
1505
|
|
|
1
|
|
|
1
|
1
|
532
|
|
|
1
|
|
|
1
|
1
|
1033
|
|
|
1
|
|
|
1
|
1
|
1490
|
|
|
1
|
|
|
1
|
1
|
819
|
|
|
1
|
|
|
1
|
1
|
8619
|
|
|
1
|
|
|
1
|
1
|
2572
|
|
|
1
|
|
|
1
|
1
|
1602
|
|
|
1
|
|
|
1
|
1
|
1299
|
|
|
1
|
|
|
1
|
1
|
839
|
|
|
1
|
|
|
1
|
1
|
1020
|
|
|
1
|
|
|
1
|
1
|
1478
|
|
|
1
|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; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub _elem { |
53
|
75
|
|
|
75
|
|
187
|
my $tag = shift; |
54
|
75
|
|
|
|
|
126
|
my $attributes; |
55
|
75
|
100
|
100
|
|
|
1075
|
if ( @_ and defined $_[0] and ref( $_[0] ) eq "HASH" ) { |
|
|
|
100
|
|
|
|
|
56
|
1
|
|
|
|
|
2
|
$attributes = shift; |
57
|
|
|
|
|
|
|
} |
58
|
75
|
|
|
|
|
405
|
my $elem = HTML::Element->new( $tag, %$attributes ); |
59
|
75
|
|
|
|
|
452
|
$elem->push_content(@_); |
60
|
75
|
|
|
|
|
854
|
$elem; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
__END__ |