clintongormley / Elastic-Model

Use ElasticSearch as a NoSQL database in Perl
9 stars 8 forks source link

wrong return precedence [cpan #87300] #32

Closed rurban closed 11 years ago

rurban commented 11 years ago

https://rt.cpan.org/Public/Bug/Display.html?id=87300

returns binds stronger than or, so the expressions after or are ignored. See https://rt.perl.org/rt3/Public/Bug/Display.html?id=59802

diff -bu ./lib/Elastic/Model/Meta/Class/Doc.pm~ ./lib/Elastic/Model/Meta/Class/Doc.pm
--- ./lib/Elastic/Model/Meta/Class/Doc.pm~  2013-05-08 14:30:06.000000000 -0500
+++ ./lib/Elastic/Model/Meta/Class/Doc.pm   2013-07-25 08:17:09.536402358 -0500
@@ -91,7 +91,7 @@
         . $self->_inline_generate_instance( '$instance',
         '"' . $self->name . '"' )
         . 'return $instance' . '}';
-    return eval($src) or croak $@;
+    return eval($src) || croak $@;
 }
clintongormley commented 11 years ago

Hiya @rurban

thanks for spotting that. i'm away at the moment, but will get this patched and released when i'm back

clint