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
Change in behaviour of "$foo::$bar" in 5.18 #15408
Comments
From @cpansproutIn perl 5.16 and earlier, "$foo::$bar" parsed as: $foo:: . $bar In perl 5.18, it accidentally started being parsed as: $foo . "::" . $bar (I say accidentally, because commit 07f7264, which made the change, does not appear to have been made for this purpose, and its commit message does not even hint at this particular change in parsing.) Now one module, Sub::Attribute (admittedly brand new and still at 0.01), has inadvertently started relying on the new behaviour. (See <https://rt.cpan.org/Ticket/Display.html?id=115570>.) The *real* problem is that we now have a discrepancy between "$foo::$bar" and "$foo::@bar": $ ./perl -Ilib -MO=Deparse,-q -e '"$foo::$bar"' So, what should we do about this? Should we (a) revert to the old behaviour? (Fixing that one module is easy enough.) Or should we (b) make "$foo::@bar" consistent with "$foo::$bar". I prefer option a. Option b is harder, in that we have to decide where exactly to draw the line. Do we stop $foo:: from being interpolated at all? Do we only cut it off at $foo before $ and @? Etc. The change, BTW, did not only affect double-quoted strings, but also print $foo::$bar: $ perl5.14.4 -e 'print $foo::$bar' (The ‘Scalar found where operator expected’ is bogus. [I reported that in another ticket some years ago.] The fact that it does with ‘Can't use an undefined value’ shows that the program compiles and runs.) $ perl5.18.1 -e 'print $foo::$bar' Now we have a very unhelpful error message. (The same unhelpful message you get for ‘foo::bar::$baz’, at least as far back as 5.8.7.) Also, B::Deparse is wrong now: $ ./perl -Ilib -MO=Deparse -e '"${foo::}$a"' -- Father Chrysostomos |
From @cpansproutSo far no response.... On Fri Jun 24 21:51:13 2016, sprout wrote:
And here is a patch for it. Should I apply it? -- Father Chrysostomos |
From @cpansproutFrom b00321c Mon Sep 17 00:00:00 2001 The function scan_word, in toke.c, is used to parse barewords. The Prior to v5.17.9-108-g07f7264, both functions had their own parsing The state purpose of 07f7264 was to fix discrepancies in the parsing One result was that some logic appropriate only to scan_word started The consequence was that "$foo::$bar" started to be parsed as Now, "$foo::@bar" was unaffected, so by fixing one form of inconsis- This commit restores the previous behaviour by giving parse_ident an Inline Patch
|
The RT System itself - Status changed from 'new' to 'open' |
From @HugmeirOn 27 June 2016 at 06:53, Father Chrysostomos via RT
++ I entirely missed this when writing that commit; the fix looks spot-on to me. |
From @cpansproutOn Mon Jun 27 00:09:29 2016, Hugmeir wrote:
Thank you. I have pushed it as d9d2b74. -- Father Chrysostomos |
@cpansprout - Status changed from 'open' to 'pending release' |
From @xsawyerxOn 06/27/2016 03:33 PM, Father Chrysostomos via RT wrote:
I didn't get to respond, but mine was ++ as well. If we start with Thank you. |
From @andk
> Thank you. I have pushed it as d9d2b74. Since this ticket is not closed yet, we probably need no BBC ticket. Please look into http://matrix.cpantesters.org/?dist=Tie-SecureHash-1.10 Does the report of my smoker -- |
From @cpansproutOn Wed Jun 29 22:54:13 2016, andreas.koenig.7os6VVqR@franz.ak.mind.de wrote:
Yes, it does. I have filed a ticket at <https://rt.cpan.org/Ticket/Display.html?id=115772>. -- Father Chrysostomos |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release today of Perl 5.26.0, this and 210 other issues have been Perl 5.26.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#128478 (status was 'resolved')
Searchable as RT128478$
The text was updated successfully, but these errors were encountered: