in reply to Issues with DBIx::Class
The ->all method always returns a list (not arrayref) of rows. You got "123" because you tried assigning a list to a scalar, which gives you the size of the list.
The rows are objects by default. If you want hashrefs, use DBIx::Class::ResultClass::HashRefInflator. You can also use $row->get_columns to dump the key/value pairs from a row object but if you don't want the object in the first place, just use HashRefInflator and get better performance.
If you are doing a lot of work with DBIx::Class, consider using DBIx::Class::Helper::ResultSet which smooths over some of the rough edges of the DBIx::Class API. With this module installed, you can write:
for my $hashref ($c->model('DB::Thing')->hri->all) { ... }
|
|---|