[Dbix-class] search() returning REFs

Paul Makepeace paulm at paulm.com
Mon Feb 18 15:12:24 GMT 2008


It seems that a search() is returning an array of \bless'ed instead of
bless'ed objects.

I'm putting in a die to dump out am example:

Caught exception in IDL::Web::Controller::SP::Companies->edit "SPC:
REF(0xa9328f4) = REF at
/home/paulm/idl/trunk/IDL-Web/script/../lib/IDL/Web/Controller/SP/Companies.pm
line 86."

   82: 	my @service_profile_companies :Stashed = \
   83: 		$ds_ro->resultset('ServiceProfileCompany')->search({service_profile_uid
   84: => $service_profile_uid});
   85: 	foreach my $spc (@service_profile_companies) {
   86: 		die "SPC: $spc = ", ref($spc);
   87: 	}

I'd be expecting a model/schema class. Needless to say, attempting to
get anything from it goes nowhere in TT, and "can't deref an unblessed
ref" in the controller.

That said, it's pulling the right number of rows out of the DB, and if
I Data::Dumper the obj,

$VAR1 = \bless( {
                   '_source_handle' => bless( {
                                                'source_moniker' =>
'ServiceProfileCompany',
                                                'schema' => bless( {

So it's a reference to the right thing.

Any idea what's up here?

Paul, suspecting something obvious but just not seeing it...



More information about the DBIx-Class mailing list