From: Daniel Ruoso Date: Mon, 14 Apr 2008 14:04:08 +0000 (+0000) Subject: Fix weird bug, caused by a double evaluation in ternary if X-Git-Tag: v0.11008~326 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a83ffc24a70ced47119822cf63e120172ede5e15;p=dbsrgits%2FSQL-Translator.git Fix weird bug, caused by a double evaluation in ternary if --- diff --git a/lib/SQL/Translator.pm b/lib/SQL/Translator.pm index 890b3ca..4e34d0a 100644 --- a/lib/SQL/Translator.pm +++ b/lib/SQL/Translator.pm @@ -536,8 +536,13 @@ sub translate { # Run producer # Calling wantarray in the eval no work, wrong scope. my $wantarray = wantarray ? 1 : 0; - eval { $wantarray ? @producer_output = $producer->($self) : - $producer_output = $producer->($self) }; + eval { + if ($wantarray) { + @producer_output = $producer->($self); + } else { + $producer_output = $producer->($self); + } + }; if ($@ || !( $producer_output || @producer_output)) { my $err = $@ || $self->error || "no results"; my $msg = "translate: Error with producer '$producer_type': $err";