http://www.perlmonks.org?node_id=1223376


in reply to Dancer2, DBIx::Class and HTML::FormFu: showing database record in html-form to edit

Hi, search in scalar context returns the resultset, not a record. Try:

my $client = resultset('Client') ->search( { 'client_id' => $id }, { join => ['country'], } ) ->first;

(Also note the DBIx doc recommends use of prefetch rather than join when your join includes all the columns from the joined table.)

https://metacpan.org/pod/DBIx::Class::ResultSet#search
https://metacpan.org/pod/distribution/DBIx-Class/lib/DBIx/Class/Manual/Joining.pod#Whole-related-objects

Hope this helps!


The way forward always starts with a minimal test.