[Dbix-class] RFC: list/array context, TT and search()

Richard Jolly Richard.Jolly at bbc.co.uk
Thu Mar 23 11:01:36 CET 2006


Matt S Trout wrote:
> 
> Dave Howorth wrote:
> > Will Hawes wrote:
> >> I'd vote for removing wantarray() completely. IMO, if a user wants 
> >> objects rather than a ResultSet, they should call ->all.

Me too. Consistency is nice.
 
> > How about providing *_all methods to avoid doubling the number of 
> > method invocations and avoid constructing/destroying 
> unwanted iterators?
> 
> It's not an iterator, it's a full ResultSet. This is 
> fundamental to the DBIC design - and also means in many cases 
> you can't get where you need to without creating a new one 
> since it encapsulates the query etc.

... and you don't save anything by returning a list, because internally
it looks like (IIRC):

  return wantarray ? $rs->all : $rs;

> Mostly, I'd really like to just get rid of the 
> array-in-list-context behaviour but don't want to spanner 
> anybody relying on it in production. Anybody got any bright ideas?

Just mark as DEPRECATED now and remove in .07? 

Richard

http://www.bbc.co.uk/

This e-mail (and any attachments) is confidential and may contain
personal views which are not the views of the BBC unless specifically
stated.
If you have received it in error, please delete it from your system. 
Do not use, copy or disclose the information in any way nor act in
reliance on it and notify the sender immediately. Please note that the
BBC monitors e-mails sent or received. 
Further communication will signify your consent to this.





More information about the Dbix-class mailing list