This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
op.c: Warn on "return $a or $b" [perl #59802]
authorNiels Thykier <niels@thykier.net>
Mon, 15 Jul 2013 20:25:19 +0000 (22:25 +0200)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 15 Sep 2013 21:27:45 +0000 (14:27 -0700)
commit9da2d0467dc553eb6e9c6002cbfe59fc36767759
tree159aedbe6f8fa59eb28039a469c094c4bcfc87bb
parent13c65ef8cd53d353c932eb688b59f1ca81f5c374
op.c: Warn on "return $a or $b" [perl #59802]

Add a warning for the (likely) unintended use of "return $a or $b"
(and similar expressions), which perl parses as "(return $a) || $b"
(which is effectively just "return $a;").

Note this warning is triggered by some modules (e.g. Test::Builder).
These are not fixed by this commit.

Signed-off-by: Niels Thykier <niels@thykier.net>
op.c
pod/perldiag.pod
t/lib/warnings/op