Re: search always returns an iterator

[prev] [thread] [next] [Date index for 2005/05/06]

From: Michael G Schwern
Subject: Re: search always returns an iterator
Date: 00:35 on 06 May 2005
On Thu, May 05, 2005 at 07:58:34PM -0400, Dana Hudes wrote:
> Despite calling the search method in a list context I always get an 
> iterator back. I don't want this, its inefficient and annoying: I expect 
> no more than perhaps 2 or 3 records and usually only the one. 
> 
> @foo = Data::Foo->search(%bar);
> 
> and you only get the one element in @foo which is an object of 
> Class::DBI::Iterator .

Something's going wrong there because CDBI is supposed to return all the
objects in list context.

Are you sure you're not doing something like overriding search()?


        -- 
        Michael G Schwern     schwern@xxxxx.xxx     http://www.pobox.com/~schwern
Reality is that which, when you stop believing in it, doesn't go away.
	-- Phillip K. Dick

search always returns an iterator
Dana Hudes 23:58 on 05 May 2005

Re: search always returns an iterator
Michael G Schwern 00:35 on 06 May 2005

Re: search always returns an iterator
Cees Hek 01:39 on 06 May 2005

Re: search always returns an iterator
Dana Hudes 02:53 on 06 May 2005

Re: search always returns an iterator
Perrin Harkins 02:57 on 06 May 2005

Re: search always returns an iterator
Dana Hudes 03:11 on 06 May 2005

Re: search always returns an iterator
Cees Hek 03:35 on 06 May 2005

Generated at 06:54 on 17 May 2005 by mariachi v0.52