__PACKAGE__->set_sql(regions_sorted => qq{ SELECT customer.id, customer.name, region.name FROM customer INNER JOIN region ON customer.region = region.id ORDER BY region.name DESC }); sub retrieve_sorted_by_region { my $class = shift; my $sth = $class->sql_regions_sorted; $sth->execute or carp "Error: $DBI::errstr"; return $class->sth_to_objects($sth); }