From: Dagfinn Ilmari Mannsåker Date: Sat, 12 Apr 2014 17:09:17 +0000 (+0100) Subject: Warn if _recurse_where is called in scalar context X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=abe1a49124e6b617928466d7c99e22e186612a19;p=scpubgit%2FQ-Branch.git Warn if _recurse_where is called in scalar context DBIC used to do this, but doesn't any more. Still something else might... --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 61d4762..1b5f490 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -497,9 +497,15 @@ sub _recurse_where { my ($sql, @bind) = $self->$method($where, $logic); - # DBIx::Class directly calls _recurse_where in scalar context, so - # we must implement it, even if not in the official API - return wantarray ? ($sql, @bind) : $sql; + # DBIx::Class used to call _recurse_where in scalar context + # something else might too... + if (wantarray) { + return ($sql, @bind); + } + else { + belch "Calling _recurse_where in scalar context is deprecated and will go away before 2.0"; + return $sql; + } }