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!


Enjoy, Have FUN! H.Merijn

In reply to Spreadsheet::Read - Changes and quest for feedback by Tux

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.