-
Notifications
You must be signed in to change notification settings - Fork 578
stacked filetest ops stat unexpected “filename containing newline” #18293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The use of HTTP::Tiny appears to be a partial red herring; without it I see:
.. so somehow |
Hmm, it correctly reaches op.c:S_try_amagic_ftest, but in:
the first stacked opcode has OPpFT_STACKING, so we don't perform the getmagic. We need a test that will be true on the first of a stack of filetests, and false on the rest; however this test will be true on the last of a stack, and false on the rest. Not sure how best to fix that. |
Module: core
Description
The following MWE script unexpectedly outputs a warning about an “unsuccessful stat on filename containing newline”:
A workaround is to replace
-f -r $1
with-r $1 && -f _
. This is in contradiction to the documentation inman perlfunc
, which states that the former is just “a form of purely syntactic sugar” for the latter.Steps to Reproduce
Run the above script on Ubuntu Linux (e.g., 20.04).
Actual behavior
Expected behavior
Perl should try to stat the filename
a
instead of any “filename containing newline”,and output
a
if and only if filea
exists and is readable.Perl configuration
I encountered this behaviour on both Perl 5.30.0 as included in Ubuntu Linux 20.04 (x86_64), as well as Perl 5.22.1 as included in Ubuntu Linux 16.04 (x86_64).
The text was updated successfully, but these errors were encountered: