Data::Grid::Table - A table implementation for Data::Grid
Version 0.01_01
my $grid = Data::Grid->parse('arbitrary.csv'); # Just take the first one, since a CSV will only have one table. my ($table) = $grid->tables; while (my $row = $table->next) { # do some stuff } # or while (my $row = <$table>) { # ... } # or my @rows = $table->rows; # or my @rows = @$table;
Retrieves the next row in the table or undef when it reaches the end. This method "must be overridden" by a driver subclass. The iteration operator <> is also overloaded for table objects, so you can use it like this:
undef
<
while (my $row = <$table>) { ...
Returns the first row in the table, and is equivalent to calling "rewind" and then "next".
Sets the table's cursor back to the first row. Returns the previous position, beginning at zero. This method must be overridden by a driver subclass.
Retrieves an array of rows all at once, or if taken in scalar context, an array reference. This method overloads the array dereferencing operator @{}, so you can use it like this:
@{}
my @rows = @$table;
Gets the width, in columns, of the table.
Gets the height, in rows, of the table. Careful, for drivers that only do sequential access, this means iterating over the whole set, so you might as well.
Serializes the table into a string and returns the result. Currently unimplemented.
Returns a new Data::Table object for compatibility.
Dorian Taylor, <dorian at cpan.org>
<dorian at cpan.org>
Please report any bugs or feature requests to bug-data-grid at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Data-Grid. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-data-grid at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Data::Grid::Table
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Data-Grid
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Data-Grid
CPAN Ratings
http://cpanratings.perl.org/d/Data-Grid
Search CPAN
http://search.cpan.org/dist/Data-Grid/
Data::Grid, Data::Grid::Container, Data::Grid::Row, Data::Grid::Cell
Copyright 2010 Dorian Taylor.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Data::Grid, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Grid
CPAN shell
perl -MCPAN -e shell install Data::Grid
For more information on module installation, please visit the detailed CPAN module installation guide.