On 12/22/05 10:14 AM, Perrin Harkins wrote: >> The docs are wrong, but I've changed my mind on this a few times. Opinions? > > I hate wantarray. It's a constant source of bugs and makes testing more > complicated. I prefer methods that consistently return the same thing. > > As an example, I've had to debug problems like this for my co-workers a > few times with Class::DBI: > > my @foo = Bar->search(baz => 1) || die "no baz found"; > > That will not give the list context return, but rather the scalar > return, which is an iterator in Class::DBI. This is just the tip of the > iceberg.
Yeah, that's basically why it unconditionally returns a reference now. But I also like to be able to do stuff like this: foreach my $prod (Product::Manager->get_products(...)) { ... } Hrm. Any more opinions or ideas? Is there a happy medium? -John ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object