I've just updated Spreadsheet::Read with two major new features
The addition of OO is just to make the other changes easier. The functional API did not change at all:
my $book = ReadData ("file.xls"); my $book = Spreadsheet::Read->new ("file.xls");
That makes adding data from other sources possible (and intuitive)
Spreadsheet::Read::add ($book, "file.csv"); $book->add ("file.csv");
that makes it clear that when you go beyond a simple read of one Spreadsheet, this new OO interface is to be preferred.
For types that do not store labels on sheets, like CSV and SquirrelCalc, one can now pass a label. (the default label for CSV is its filename).
$book->add ("file.csv", label => "Testing");
and my personal fav new OO is that you can now take a sheet as object and use that with methods
my $sheet = $book->sheet ("Test"); # or numbered my $maxcol = $sheet->maxcol; my $maxrow = $sheet->maxrow; my $label = $sheet->label; $sheet->label ("New label"); my @row = $sheet->row (2); my @col = $sheet->col (6);
When I presented this yesterday at the Amsterdam Perl Mongers meeting, it was received very well. The support for labels was added today after feedback during the short presentation.
What was also asked is if it would now be possible to do more complicated tasks like merging, moving, copying rows/columns/blocks between sheets, but there was no useful example for that YET. We can all wander off in our fantasies and think of idiotic data moves, but that would result is an unworkable API.
My quest here is if people think that new functionality is indeed useful, to come up with suggestions for the API, like
# suggestions $sheet2->copy ("C5", $sheet1->block ("F6", "H20")); $sheet->deleterow (12); $sheet->deletecol ("D" .. "F"); $sheet->block ("A1", "D5", sub { ... });
Open to useful suggestions. No promise all of them will be implemented and if, then no guarantee it will be available next week :P
SHOOT!
In reply to Spreadsheet::Read - Changes and quest for feedback by Tux
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |