package LIBL::Schema::ResultSet::PlayerDataCurr; use strict; use warnings; use parent "DBIx::Class::ResultSet::HashRef"; # <-Nice alternative to DBIx::Class::ResultSet. sub teams { +shift->search({ team_libl => { '!=' => undef } }); } sub teams_rs { scalar +shift->teams } sub with_id_static { +shift->search({}, { prefetch => [ 'id_static' ] }); } sub with_id_static_rs { scalar +shift->with_id_static } 1; __END__ =pod =head1 Do you even Pod? L + L for speedy delivery. use JSON; for my $team ( $player_curr_model->teams->hashref_rs->all ) { print encode_json($team), $/; } # OR my @teams = $player_curr_model ->teams ->with_id_static; =cut