|Subject:||[PATCH] perl -e "eof or die" dies|
|Date:||Wed, 12 Dec 2018 22:29:39 +0100|
|From:||Hauke D <haukex [...] zero-g.net>|
|To:||perlbug [...] perl.org|
Hi all, As the subject says: These die, when AFAICT they shouldn't: $ perl -e "eof or die" Died at -e line 1. $ perl -e "eof or die" /dev/null Died at -e line 1. These all work: $ perl -e "eof() or die" </dev/null $ perl -e "eof() or die" /dev/null $ perl -e "<>; eof or die" /dev/null It appears to be the same behavior on Linux and Windows. I ran a bisect and the commit that changed this is 32e653230c7ccc7fa595b1ab68502c6eb66ff980, the change was first released with 5.12.0 (more specifically, 5.11.0). See also [#60978]. I'm definitely not an expert, but it looks to me like "if (!gv) RETPUSHNO;" should probably be "if (!gv) RETPUSHYES;" instead? At least that's what the logic prior to 32e65323 seems to be doing: "PUSHs(boolSV(!gv || do_eof(gv)))" Patch attached. (I didn't see a place where "eof" is really tested in the test suite?) Thanks, Regards, -- Hauke D
Message body is not shown because sender requested not to inline it.