[Dbix-class] Re: Return value of DBIx::Class::ResultSet::find()

A. Pagaltzis pagaltzis at gmx.de
Tue May 15 01:31:20 GMT 2007


* Matt S Trout <dbix-class at trout.me.uk> [2007-05-14 18:45]:
> On Mon, May 14, 2007 at 09:15:18AM -0700, John Napiorkowski wrote:
> > I'm personally attached to the following syntax:
> > 
> > my $result = $dbic->resultset('MyApp')->find(xxx) ||
> > $self->throw('Not Found Type Error');
> 
> That'll still work whatever. What would break is
> 
> my ($result) = ($dbic->resultset('MyApp')->find(xxx)) || ...;
> 
> I suspect.

No. The left-hand side of a boolean op is always in scalar context.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>



More information about the Dbix-class mailing list