line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tie::Handle::CSV::Array; |
2
|
|
|
|
|
|
|
|
3
|
10
|
|
|
10
|
|
207
|
use 5.006; |
|
10
|
|
|
|
|
41
|
|
|
10
|
|
|
|
|
433
|
|
4
|
10
|
|
|
10
|
|
54
|
use strict; |
|
10
|
|
|
|
|
22
|
|
|
10
|
|
|
|
|
355
|
|
5
|
10
|
|
|
10
|
|
52
|
use warnings; |
|
10
|
|
|
|
|
21
|
|
|
10
|
|
|
|
|
414
|
|
6
|
|
|
|
|
|
|
|
7
|
10
|
|
|
10
|
|
53
|
use overload '""' => \&_stringify, fallback => 1; |
|
10
|
|
|
|
|
18
|
|
|
10
|
|
|
|
|
82
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub _new |
10
|
|
|
|
|
|
|
{ |
11
|
12
|
|
|
12
|
|
23
|
my ($class, $parent) = @_; |
12
|
12
|
|
|
|
|
20
|
my @self; |
13
|
12
|
|
|
|
|
54
|
tie(@self, $class, $parent); |
14
|
12
|
|
|
|
|
62
|
bless \@self, $class; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub TIEARRAY |
18
|
|
|
|
|
|
|
{ |
19
|
12
|
|
|
12
|
|
24
|
my ($class, $parent) = @_; |
20
|
12
|
|
|
|
|
98
|
return bless |
21
|
|
|
|
|
|
|
{ |
22
|
|
|
|
|
|
|
data => [], |
23
|
|
|
|
|
|
|
csv_xs => *$parent->{opts}{csv_parser} |
24
|
|
|
|
|
|
|
}, |
25
|
|
|
|
|
|
|
$class; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub CLEAR |
29
|
|
|
|
|
|
|
{ |
30
|
4
|
|
|
4
|
|
9
|
my ($self) = @_; |
31
|
4
|
|
|
|
|
6
|
@{ $self->{'data'} } = (); |
|
4
|
|
|
|
|
21
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub EXTEND |
35
|
|
|
|
|
|
|
{ |
36
|
4
|
|
|
4
|
|
22
|
my ($self, $count) = @_; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub STORE |
40
|
|
|
|
|
|
|
{ |
41
|
12
|
|
|
12
|
|
21
|
my ($self, $index, $value) = @_; |
42
|
12
|
|
|
|
|
53
|
$self->{'data'}[$index] = $value; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub FETCHSIZE |
46
|
|
|
|
|
|
|
{ |
47
|
2
|
|
|
2
|
|
7
|
my ($self) = @_; |
48
|
2
|
|
|
|
|
4
|
return scalar @{ $self->{'data'} }; |
|
2
|
|
|
|
|
62
|
|
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub FETCH |
52
|
|
|
|
|
|
|
{ |
53
|
31
|
|
|
31
|
|
17519
|
my ($self, $index) = @_; |
54
|
31
|
|
|
|
|
156
|
return $self->{'data'}[$index]; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub _stringify |
58
|
|
|
|
|
|
|
{ |
59
|
14
|
|
|
14
|
|
9268
|
my ($self) = @_; |
60
|
14
|
|
|
|
|
25
|
my $under_tie = tied @{ $self }; |
|
14
|
|
|
|
|
32
|
|
61
|
14
|
|
|
|
|
21
|
my @values = @{ $under_tie->{'data'} }; |
|
14
|
|
|
|
|
54
|
|
62
|
14
|
|
|
|
|
26
|
my $csv_xs = $under_tie->{csv_xs}; |
63
|
14
|
50
|
|
|
|
60
|
$csv_xs->combine(@values) |
64
|
|
|
|
|
|
|
|| croak $$csv_xs->error_input(); |
65
|
14
|
|
|
|
|
315
|
return $csv_xs->string(); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub _init_store |
69
|
|
|
|
|
|
|
{ |
70
|
8
|
|
|
8
|
|
14
|
my ($self, $values) = @_; |
71
|
8
|
|
|
|
|
11
|
my $under_tie = tied @{ $self }; |
|
8
|
|
|
|
|
153
|
|
72
|
8
|
|
|
|
|
18
|
my $data = $under_tie->{data}; |
73
|
8
|
|
|
|
|
11
|
@{ $data } = @{ $values }; |
|
8
|
|
|
|
|
33
|
|
|
8
|
|
|
|
|
18
|
|
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
__END__ |