line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::Table2YAML::Loader::DSV; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1030
|
use common::sense; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
6
|
|
4
|
1
|
|
|
1
|
|
51
|
use charnames q(:full); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
5
|
1
|
|
|
1
|
|
188
|
use English qw[-no_match_vars]; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
6
|
1
|
|
|
1
|
|
1555
|
use IO::File; |
|
1
|
|
|
|
|
13326
|
|
|
1
|
|
|
|
|
243
|
|
7
|
1
|
|
|
1
|
|
9
|
use Moo::Role; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
8
|
1
|
|
|
1
|
|
2162
|
use Text::CSV_XS; |
|
1
|
|
|
|
|
16634
|
|
|
1
|
|
|
|
|
907
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.002'; # VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub load_dsv { |
13
|
4
|
|
|
4
|
1
|
7
|
my $self = shift; |
14
|
|
|
|
|
|
|
|
15
|
4
|
|
50
|
|
|
111
|
my $ref = ref $self->input() // q(); |
16
|
4
|
50
|
|
|
|
129
|
my $dsv_fh |
17
|
|
|
|
|
|
|
= $ref eq q(GLOB) |
18
|
|
|
|
|
|
|
? $self->input() |
19
|
|
|
|
|
|
|
: IO::File->new( $self->input(), q(r) ); |
20
|
4
|
|
|
|
|
795
|
my $csv_obj = Text::CSV_XS->new( |
21
|
|
|
|
|
|
|
{ binary => 1, |
22
|
|
|
|
|
|
|
empty_is_undef => 1, |
23
|
|
|
|
|
|
|
sep_char => $self->field_separator(), |
24
|
|
|
|
|
|
|
eol => $self->record_separator(), |
25
|
|
|
|
|
|
|
auto_diag => 9, |
26
|
|
|
|
|
|
|
diag_verbose => 1, |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
); |
29
|
1
|
|
|
1
|
|
10
|
my @dsv = @{ $csv_obj->getline_all($dsv_fh) }; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
39
|
|
|
4
|
|
|
|
|
876
|
|
|
4
|
|
|
|
|
202
|
|
30
|
|
|
|
|
|
|
|
31
|
4
|
|
|
|
|
8480
|
return @dsv; |
32
|
|
|
|
|
|
|
} ## end sub load_dsv |
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
1
|
|
14
|
no Moo; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
11
|
|
35
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |