[Dbix-class] Problem getting data from resultset

Kenneth S Mclane ksmclane at us.ibm.com
Fri Jul 6 20:50:48 GMT 2012


Patrick Meidl <patrick at pantheon.at> wrote on 07/06/2012 03:29:41 PM:


> 'exists' tests the existence of hash keys, array elements and subroutine
> names, not object methods (see 'perldoc perlfunc'). as I mentioned
> before, you should use can() for this. so something like this should put
> you on the right track:
> 
> foreach my $method (split(/\./, $field)) {
>     if (defined($val) and ref($val) and $val->can($method)) {
>         $val = $val->$method;
>     } else {
>         # this is not required, but shortcuts the processing
>         last;
>     }
> }
> 
> HTH
> 
>     patrick
> 
I added this and I get a never ending stream of : 
Use of uninitialized value $data[0] in join or string at 
/opt/catalyst/dbms/script/../lib/dbms/Controller/AccountView.pm line 59.

Which is just a debug statement, but it never ends. I comment it out and 
it acts like it is hung, my browser just says "Waiting for local Host".

I am actually quite close, I created a custom resultsource and have it 
populating the spreadsheet, but it keeps trying to iterate over the 86th 
row, which doesn't exist.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20120706/115ea536/attachment-0001.htm


More information about the DBIx-Class mailing list