Возможно дело в
Excel::Reader::XLSX. Мой код работает:
use Excel::Writer::XLSX;
use Spreadsheet::ParseXLSX;
use threads;
use feature qw(say);
use Encode qw(decode);
my $target_workbook = Excel::Writer::XLSX->new("Result.xlsx");
#Обрабатываю два файла "Sample_Сентябрь_2014.xlsx" и "Sample_Октябрь_2014.xlsx")
my @source_files = glob("Sample_*.xlsx");
my $thread = threads->create(
sub {
foreach my $source_file (@source_files) {
my $reader = Spreadsheet::ParseXLSX->new();
my $source_workbook = $reader->parse($source_file);
my ($target_worksheet_name) = $source_file =~ m/Sample_(.+)\.xlsx$/;
$target_worksheet_name =
decode( 'windows-1251', $target_worksheet_name );
my $target_worksheet =
$target_workbook->add_worksheet($target_worksheet_name);
my ($worksheet) = $source_workbook->worksheets();
my ( $row_min, $row_max ) = $worksheet->row_range();
my ( $col_min, $col_max ) = $worksheet->col_range();
foreach my $row ( $row_min .. $row_max ) {
foreach my $col ( $col_min .. $col_max ) {
my $cell = $worksheet->get_cell( $row, $col );
my $value = $cell->value();
$target_worksheet->write( $row, $col, $value );
}
}
}
$target_workbook->close();
exit;
}
);
$thread->join();