to insert the data, as this is a faster method.
Otherwise, each set of data is inserted into the database using
-L<DBIx::Class::ResultSet/create>, and a arrayref of the resulting row
-objects is returned.
+L<DBIx::Class::ResultSet/create>, and the resulting objects are
+accumulated into an array. The array itself, or an array reference
+is returned depending on scalar or list context.
Example: Assuming an Artist Class that has many CDs Classes relating:
foreach my $item (@$data) {
push(@created, $self->create($item));
}
- return @created;
+ return wantarray ? @created : \@created;
} else {
my ($first, @rest) = @$data;