line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::Table2YAML::Loader::DSV; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1726
|
use common::sense; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
4
|
1
|
|
|
1
|
|
64
|
use charnames q(:full); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
5
|
1
|
|
|
1
|
|
306
|
use English qw[-no_match_vars]; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
6
|
1
|
|
|
1
|
|
2413
|
use IO::File; |
|
1
|
|
|
|
|
36966
|
|
|
1
|
|
|
|
|
239
|
|
7
|
1
|
|
|
1
|
|
14
|
use Moo::Role; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
14
|
|
8
|
1
|
|
|
1
|
|
2197
|
use Text::CSV_XS; |
|
1
|
|
|
|
|
12142
|
|
|
1
|
|
|
|
|
345
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.003'; # VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub load_dsv { |
13
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
50
|
|
|
26
|
my $ref = ref $self->input() // q(); |
16
|
1
|
50
|
|
|
|
32
|
my $dsv_fh |
17
|
|
|
|
|
|
|
= $ref eq q(GLOB) |
18
|
|
|
|
|
|
|
? $self->input() |
19
|
|
|
|
|
|
|
: IO::File->new( $self->input(), q(r) ); |
20
|
1
|
|
|
|
|
220
|
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
|
|
|
|
|
44
|
|
|
1
|
|
|
|
|
213
|
|
|
1
|
|
|
|
|
58
|
|
30
|
|
|
|
|
|
|
|
31
|
1
|
|
|
|
|
4475
|
return @dsv; |
32
|
|
|
|
|
|
|
} ## end sub load_dsv |
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
1
|
|
12
|
no Moo; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10
|
|
35
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |