Subject: | Bug in interaction with SpreadSheet::ExcelWriter and IO::Scalar |
Hi,
there is a runtime error when you generate big excel-files (>7MB) and
use IO::Scalar, the module call BINMODE on the file handle (line 229).
IO::Scalar doesn't support this call. I'know, this is a bug in
IO::Scalar, but it's easy to fix here. I suggest to say
<code>UNIVERSAL::can($sFile, 'binmode') ? $sFile->binmode() :
binmode($sFile)</code>
The script to reproduce the error is the following:
<code>
use WiP::Util::ExcelWriter;
use OLE::Storage_Lite;
use OLE::Storage;
use IO::Scalar 2.110;
use strict;
use Spreadsheet::WriteExcel;
my $content = '';
my $test = new IO::Scalar(\$content);
$test->binmode();
my $workbook = Spreadsheet::WriteExcel->new($test);
my $worksheet = $workbook->add_worksheet();
$worksheet->set_column(0, 50, 18);
for my $col (0 .. 50) {
for my $row (0 .. 6000) {
$worksheet->write($row, $col, "Row: $row Col: $col");
}
}
$workbook->close();
print "Laenge: ".length($content)."\n";
</code>
Regards
Tobias