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
require number-parsing errors #11803
Comments
From @cpansprout$ ./perl -Ilib -le '(require 5); print "ok"' What fun! The same thing happens with commas: $ ./perl -Ilib -le 'require 5, print "ok"' This bug seems to go back to 89bfa8c (perl 5.003_01: toke.c) (I’m too lazy to do a binary search), which changed KEY_require to use the new force_version instead of force_word. What is the best way to fix this? I think the answer to that may depend on how #105926 (require has the num/str bug) is fixed. Should require be special-casing numbers syntactically at all? If require ${\6} should do a version check, then removing the special-casing from parsing would fix all the problems. On the other hand, if require NUMBER is to be special-cased, we would have to tread more carefully, perhaps by skipping force_version’s check for what characters follow the number. Here is an untested test case, which I started to write as I was about to fix this, before I discovered bug #105924 (5 << 1 vs require 5 >> 1): # require VERSION should allow any operators after the version number that 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 @nwc10On Sun, Dec 11, 2011 at 01:42:11PM -0800, Father Chrysostomos wrote:
~/Perl/perl/Porting/bisect.pl -e 'require 5, print "ok"' reports HEAD is now at a7cb1f9 support for v5.5.640 style version numbers support for v5.5.640 style version numbers p4raw-id: //depot/utfperl@4705 :100755 100755 8c53dbb7249c707087ee036ac905a704075dd0d2 f57ef0b9e276969426f6a27c661269fe79f0ded9 M configpm So it's more recent than your hunch.
Sorry, I don't know. Nicholas Clark |
The RT System itself - Status changed from 'new' to 'open' |
From @nwc10On Mon, Dec 12, 2011 at 10:42:17AM +0000, Nicholas Clark wrote:
Curiously, that commit also make the example with the space between the HEAD is now at 1acb48c make global symbol exports AIX-specific longstanding bug in parsing "require VERSION", could reallocate p4raw-link: @5004 on //depot/perl: 18b0951 p4raw-id: //depot/perl@5061 :040000 040000 24ed1acdd13f4627706c5e143985b286803d07ae 2ce5123bfe412884d54c68e0f5c5ca4c7fa92423 M t Checking the first two examples you gave, the same commit is fingered for HEAD is now at a7cb1f9 support for v5.5.640 style version numbers support for v5.5.640 style version numbers p4raw-id: //depot/utfperl@4705 Whereas it seems that C<require 5 , print "ok"> was never a syntax error. Nicholas Clark |
From @cpansproutOn Sun Dec 11 13:42:10 2011, sprout wrote:
This applies to require bareword as well: $ perl5.15.5 -MO=Concise -e 'require a:: . 1' $ perl5.15.5 -MO=Concise -we 'require a::b + 1' -- Father Chrysostomos |
From [Unknown Contact. See original ticket]On Sun Dec 11 13:42:10 2011, sprout wrote:
This applies to require bareword as well: $ perl5.15.5 -MO=Concise -e 'require a:: . 1' $ perl5.15.5 -MO=Concise -we 'require a::b + 1' -- Father Chrysostomos |
From @cpansproutOn Sat Dec 17 17:49:29 2011, sprout wrote:
Actually, that’s bug #105924. But the two are related. -- Father Chrysostomos |
From [Unknown Contact. See original ticket]On Sat Dec 17 17:49:29 2011, sprout wrote:
Actually, that’s bug #105924. But the two are related. -- Father Chrysostomos |
Migrated from rt.perl.org#105928 (status was 'open')
Searchable as RT105928$
The text was updated successfully, but these errors were encountered: