line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Tabulate::Plugin::HTMLTable; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
15154
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
56
|
|
4
|
2
|
|
|
2
|
|
9
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
47
|
|
5
|
2
|
|
|
2
|
|
1747
|
use HTML::Table; |
|
2
|
|
|
|
|
34951
|
|
|
2
|
|
|
|
|
489
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# ABSTRACT: HTML::Table plugin for Data::Tabulate |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new{ |
13
|
1
|
|
|
1
|
1
|
1789
|
return bless {},shift; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub output { |
18
|
1
|
|
|
1
|
1
|
10
|
my ($self,@data) = @_; |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
|
|
4
|
my %atts = $self->attributes(); |
21
|
1
|
|
|
|
|
9
|
my $obj = HTML::Table->new(%atts); |
22
|
1
|
|
|
|
|
52
|
for(@data){ |
23
|
4
|
100
|
|
|
|
121
|
my @row = map{defined($_) ? $_ : ' '}@$_; |
|
12
|
|
|
|
|
24
|
|
24
|
4
|
|
|
|
|
12
|
$obj->addRow(@row); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
1
|
|
|
|
|
24
|
return $obj->getTable(); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub attributes{ |
32
|
1
|
|
|
1
|
1
|
2
|
my ($self,%atts) = @_; |
33
|
1
|
50
|
|
|
|
5
|
$self->{attributes} = {%atts} if keys %atts; |
34
|
1
|
|
|
|
|
1
|
my %return = (); |
35
|
1
|
50
|
33
|
|
|
9
|
if(defined $self->{attributes} and ref($self->{attributes}) eq 'HASH'){ |
36
|
0
|
|
|
|
|
0
|
%return = %{$self->{attributes}} |
|
0
|
|
|
|
|
0
|
|
37
|
|
|
|
|
|
|
} |
38
|
1
|
|
|
|
|
3
|
return %return; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; # End of Data::Tabulate::Plugin::HTMLTable |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |