[CDBI] cdbi objects evaluating as false

Aaron Trevena aaron.trevena at gmail.com
Sat Nov 25 17:20:13 GMT 2006


Hi all,

I'm finding that when I do :

while (my $object = $iterator->next) {
..
}

.. the loop never happens because 'my $object = $iterator->next' seems
to be false.

instead I have to do :

my $object = $iterator->next();
while (defined $object && $object->pk) {
  . . .
  $object = $iterator->next();
}

I'm using a wrapper around CDBI iterator, but given both iterators
return the next object, so I don't see any reason for them to have
different results.

I'm hoping there is something I can do to make these objects 'true'
when provided by the iterator so that I can use the normal while loop.

Any suggestions, hints and reasons why I'm having the problem or being
stupid much appreciated.

cheers,

A.

-- 
http://www.aarontrevena.co.uk
LAMP System Integration, Development and Hosting



More information about the ClassDBI mailing list