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
Perl parser sometimes tolerates stray nulls, sometimes not #11799
Comments
From @cpansproutStray nulls are tolerated in files but not in string evals. Why is that? I know which piece of code is doing it, but is it by design? Why the inconsistency? #!perl -l require PerlIO::scalar; This prints: syntax error at (eval 1) line 1, at EOF Flags: Site configuration information for perl 5.15.5: Configured by sprout at Sat Nov 26 11:40:22 PST 2011. Summary of my perl5 (revision 5 version 15 subversion 5) configuration: Locally applied patches: @INC for perl 5.15.5: Environment for perl 5.15.5: |
From @HugmeirOn Sun Dec 11 13:15:49 2011, sprout wrote:
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/bin
I would imagine this was not by design -- probably a leftover from back --hugmeir |
The RT System itself - Status changed from 'new' to 'open' |
From zefram@fysh.orgFather Chrysostomos wrote:
Prior to Perl 3.0, the tokeniser made no attempt to handle NULs in source. Perl 3.0 in 1989 was the first version that claimed to support binary The treatment of a NUL, when detected, was as it is now, to skip past it. Indeed, it's a time-honoured interpretation of a NUL: all bits zero means Of course, this time-honoured treatment of NUL is more at home in the Anyway, was it intentional that NULs in strings are errors? The answer $ perl -e 'eval "3+4\0"; print $@' The error is coming from the yacc parser, not from the tokeniser. $ perl -e 'eval "print qq(hi\\n);\0garbage here"; print $@ || "OK\n"' Why do you usually get a syntax error? Because of semicolons. It is clearly a bug that NUL in an eval string terminates tokenisation However, as a matter of language design, it seems silly to be treating -zefram |
Migrated from rt.perl.org#105920 (status was 'open')
Searchable as RT105920$
The text was updated successfully, but these errors were encountered: