Subject: | Documentation error in Spreadsheet::Read version 0.12 |
Date: | Thu, 11 Feb 2010 09:22:17 +0200 |
To: | <bug-Spreadsheet-Read [...] rt.cpan.org> |
From: | Patrick Cronin <pcronin [...] loyola.edu> |
Greetings,
While using the Spreadsheet::Read module, I noticed a problem with the documentation of 'maxrow' and 'maxcol'. From the example under the section "Data structure," which is later duplicated and appended to in the section "Cell Attributes," it seems the author has confused the maxrow and maxcol properties of the "Sheet 1" section of the spreadsheet data structure.
I created an Excel spreadsheet created in Microsoft Word 2007, with the default three worksheets. On the first worksheet I put a "1" in cell A1 and a "Nugget" in cell B5 to mimic the example given in the documentation. The spreadsheet structure produced actually has a maxrow=5 and maxcol=2 instead of what the documentation shows as maxrow=2 and maxcol=4. It seems the author switched maxrow and maxcol, and also miscounted the number of rows. As mentioned above, this error is found in the "Data Structure" section, and later duplicated in "Cell Attributes"
My environment:
Show quoted text
> perl -v
This is perl, v5.10.0 built for darwin-thread-multi-2level
(with 2 registered patches, see perl -V for more detail)
Show quoted text> uname -a
Darwin shihuna.local 10.2.0 Darwin Kernel Version 10.2.0: Tue Nov 3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386 i386
(OS X Snow Leopard 10.6.2)
My test spreadsheet was described above. Test program:
-------------------
#!/usr/bin/perl
use strict;
use warnings;
use Spreadsheet::Read;
use Data::Dumper;
my $spreadsheet = ReadData('/Users/pcronin/Desktop/Book1.xlsx', parser=>'xlsx');
print Dumper $spreadsheet;
-------------------
Test program output:
-------------------
$VAR1 = [
{
'sheets' => 3,
'version' => '0.12',
'sheet' => {
'Sheet2' => '2',
'Sheet1' => '1',
'Sheet3' => '3'
},
'parser' => 'Spreadsheet::XLSX',
'type' => 'xlsx'
},
{
'maxrow' => 5,
'maxcol' => 2,
'A1' => '1',
'label' => 'Sheet1',
'cell' => [
[],
[
undef,
1
],
[
undef,
undef,
undef,
undef,
undef,
'Nugget'
]
],
'attr' => [],
'B5' => 'Nugget'
},
{
'maxrow' => 1,
'maxcol' => 1,
'label' => 'Sheet2',
'cell' => [],
'attr' => []
},
{
'maxrow' => 1,
'maxcol' => 1,
'label' => 'Sheet3',
'cell' => [],
'attr' => []
}
];
-------------------
I am very grateful for the software's existence -- just wanted to clean up the docs a bit as they confused me when I was trying to learn how to use it.
Patrick Cronin