Skip to content

Commit

Permalink
Test::Builder: Fix "return $a or $b" precedence issue
Browse files Browse the repository at this point in the history
perl parses "return $a or $b" effectively as "return $a;", which is
not what was intended.

Signed-off-by: Niels Thykier <niels@thykier.net>
  • Loading branch information
nthykier authored and Father Chrysostomos committed Sep 15, 2013
1 parent 846aaad commit 13c65ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpan/Test-Simple/lib/Test/Builder.pm
Expand Up @@ -915,7 +915,7 @@ sub _is_dualvar {

no warnings 'numeric';
my $numval = $val + 0;
return $numval != 0 and $numval ne $val ? 1 : 0;
return ($numval != 0 and $numval ne $val ? 1 : 0);
}

=item B<is_eq>
Expand Down

0 comments on commit 13c65ef

Please sign in to comment.