This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #123753] &\0foo parsing
Normally the lexer skips over stray nulls, treating them as white-
space. After a sigil, though, it was getting confused. While $\0foo
would work and was equivalent to $foo (but did not work for lexicals),
$\0eq was a syntax error. Some cases of &\0foo would cause assertion
failures or outright buggy behaviour, such as strictures randomly
turning on and off.
There were two problems occurring:
1) Nulls were not being treated as whitespace right after a sigil,
unlike elsewhere.
2) '&' not followed immediately by an identifier was not getting
pl_yylval set, so the previous value, which might be an op address,
was being passed as a flags parameter to an op constructor. (The
other sigil tokens never use their values.)
This commit addresses the first of those. I still need to investigate
whether the second can still cause problems.