DBIx::DataModel::Schema::ResultAs::Categorize - tree of categorized lists of rows
my $tree = $source->select(..., -result_as => [categorize => ($column1, ...)]); # or my $tree = $source->select(..., -result_as => [categorize => sub {...}]);
Builds a tree of lists of rows through module List::Categorize, with the content of $column1, etc. as categorization keys. This is quite similar to the hashref result kind, except that the categorization keys need not be unique : each leaf of the tree will contain lists of rows matching those categories, while the hashref result kind only keeps the last row matching the given keys.
$column1
hashref
Instead of a list of column names, the argument can be a reference to a subroutine. That subroutine will we called for each row and should return a list of scalar values to be used as categorization keys.
To install DBIx::DataModel, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::DataModel
CPAN shell
perl -MCPAN -e shell install DBIx::DataModel
For more information on module installation, please visit the detailed CPAN module installation guide.