line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::TableReader::Decoder::XLSX; |
2
|
1
|
|
|
1
|
|
69526
|
use Moo 2; |
|
1
|
|
|
|
|
10285
|
|
|
1
|
|
|
|
|
6
|
|
3
|
1
|
|
|
1
|
|
1372
|
use Carp; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
52
|
|
4
|
1
|
|
|
1
|
|
6
|
use Try::Tiny; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
249
|
|
5
|
|
|
|
|
|
|
extends 'Data::TableReader::Decoder::Spreadsheet'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our @xlsx_probe_modules= qw( Spreadsheet::ParseXLSX Spreadsheet::XLSX ); |
8
|
|
|
|
|
|
|
our $default_xlsx_module; |
9
|
|
|
|
|
|
|
sub default_xlsx_module { |
10
|
1
|
|
33
|
1
|
1
|
1596
|
$default_xlsx_module ||= |
11
|
|
|
|
|
|
|
Data::TableReader::Decoder::_first_sufficient_module('XLSX parser', \@xlsx_probe_modules); |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# ABSTRACT: Access sheets/rows of a modern Microsoft Excel workbook |
15
|
|
|
|
|
|
|
our $VERSION = '0.011'; # VERSION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub _build_workbook { |
19
|
0
|
|
|
0
|
|
|
my $self= shift; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
my $wbook; |
22
|
0
|
|
|
|
|
|
my $f= $self->file_handle; |
23
|
0
|
0
|
0
|
|
|
|
if (ref $f and ref($f)->can('worksheets')) { |
24
|
0
|
|
|
|
|
|
$wbook= $f; |
25
|
|
|
|
|
|
|
} else { |
26
|
0
|
|
|
|
|
|
my $class= $self->default_xlsx_module; |
27
|
|
|
|
|
|
|
# Spreadsheet::XLSX has an incompatible constructor |
28
|
0
|
0
|
|
|
|
|
if ($class->isa('Spreadsheet::XLSX')) { |
29
|
0
|
|
|
|
|
|
$wbook= $class->new($f); |
30
|
|
|
|
|
|
|
} else { |
31
|
0
|
|
|
|
|
|
$wbook= $class->new->parse($f, $self->xls_formatter); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
0
|
0
|
|
|
|
|
defined $wbook or croak "Can't parse file '".$self->file_name."'"; |
35
|
0
|
|
|
|
|
|
return $wbook; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |