textconv/xls.pm untested

filter: Statementstmt 0.0% 0 / 24 Branchbran n/a Conditioncond 0.0% 0 / 12 MC/DCmcdc 0.0% 0 / 7 Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 50 CC 1 SCAR 6.9
CC
1
Cov
0%
to_text
2.0
sheet
2.0
BEGIN
2.0
CRAP 2.0
1 package App::optex::textconv::xls;
2  
3 our $VERSION = '1.08';
4  
5 use strict;
6 use warnings;
7  
8 use Spreadsheet::ParseExcel;
9  
10 sub to_text {
11 my $file = shift;
12 my $book = Spreadsheet::ParseExcel::Workbook->Parse($file) or return;
13 my $worksheet = $book->{Worksheet} // return;
14 my @sheets = @{$worksheet} or return;
15 join "\n", grep { defined and length } map sheet($_), @sheets;
16 }
17  
18 sub sheet {
19 my $sheet = shift;
20 my @rows = do {
21 map { join(' ', map $_->Value, grep defined, @$_) . "\n" }
22 grep { defined and @$_ > 0 }
23 @{$sheet->{Cells}}
24 };
25 join '', @rows;
26 }
27  
28 1;