[Dbix-class] Problem getting data from resultset

Kenneth S Mclane ksmclane at us.ibm.com
Fri Jul 6 16:54:08 GMT 2012


> Subject:
> 
> Re: [Dbix-class] Problem getting data from resultset
> 
> 
> foreach my $method (split(/\./, $field)) {
>     last unless ($val);
>     $val = $val->$method;
> }
> 
> should solve this.
> 
>     patrick
> 
> -- 
That just causes an infinite loop somewhere. I have been trying an if 
(exists $val->$method) { $val= $val->$method; } else { $val = 0; }, but 
that gets me this:
exists argument is not a subroutine name at 
/opt/catalyst/dbms/script/../lib/dbms/Controller/AccountView.pm line 71.
I changed it to this: if (exists $val->$method) { $val= $val->{$method}; } 
else { $val = 0; } and it gets me this:
Caught exception in dbms::Controller::AccountView->list "Can't use string 
("0") as a HASH ref while "strict refs" in use.

I think I'm on the right track, I think I still don't have it laid out 
quite right.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20120706/ec22de09/attachment.htm


More information about the DBIx-Class mailing list