in reply to Help with extending Class::DBI please.

Class::DBI::Iterator is an entirely separate class, and you are not subclassing it. There should never be a case where you are unsure if you have an iterator or a single object of your class, and you will never be able to call "hashy" on an iterator. Using a while loop, as you suggested, will work fine for extracting data from an iterator or an array of Class::DBI objects.
  • Comment on Re: Help with extending Class::DBI please.

Replies are listed 'Best First'.
Re: Re: Help with extending Class::DBI please.
by jdtoronto (Prior) on Feb 03, 2004 at 14:52 UTC
    I was thinking about just this after I wrote the question - please forgive me. all this OO stuff is very new to me. If I call Class::DBI in scalar context it returns either an object or an iterator. But if it is called in list context it will return an array of objects, which I can loop over.

    That's where I was getting confused, thanks again perrin