Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix function calls being misinterpreted as bareword filehandles
When bareword filehandles are disabled, the parser was interpreting any bareword as a filehandle, even when immediatey followed by parens: $ perl -M-feature=bareword_filehandles -le 'print foo()' Bareword filehandle "foo" not allowed under 'no feature "bareword_filehandles"' at -e line 1. While with the feature enabled, it works and prints the value returned by the function: $ perl -le 'sub foo { @_ } print foo("bar")' bar As for filehandles versus functions, a space before the parens makes the difference: $ perl -le 'print STDOUT ("bar")' bar $ perl -le 'print STDOUT("bar")' Undefined subroutine &main::STDOUT called at -e line 1. This fixes the bug by using the already-existing "immediate_paren" variable to make it consistent when the feature is disabled. Fixes #19271
- Loading branch information