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
use VERSION MODULE should not be considered legal #13646
Comments
From @kentfredricWhile reading toke.c a while back, I stumbled upon an unfortunate accident. use VERSION MODULE; These forms are equivalent. And the former form deparses into the latter. For example: --- And Moose version 5.01 required--this is only version 2.1204 And a grep of CPAN shows that there are a few cases where this might occur. http://grep.cpan.me/?q=^\s*use\s%2B[v\d.]%2B\s%2B\w ( Marpa is interestingly testing for that exact syntax ) Specifically, when doing this: Which yields the slightly confusing error: --- Though thats only failing because it doesn't like you doing this: --- Which is fine in the alternative form --- Enabling `strict` here changes things slightly: --- But ... the error is weird: --- Fortunately, the odds of triggering a silent bug on a line after a --- Without the trailing semicolon is slim without triggering a subsequent error due to keyword-in-expression. So the only real risk is people doing --- Or similar, and erroneously expecting that to be valid syntax, and it loading something else unintended. For instance --- Giving --- May invoke confusion. Perl Info
|
From jeffreykegler@jeffreykegler.comI am the author of Marpa, a module which is mentioned in the ticket. While looking into Perl parsing for Marpa, I ran into this problem, which I called the "reversed use statement". I incorporated some parsing experiments on it into Marpa's test suite. That's why Marpa tests for reversed use statements. I wrote a blog post on this problem some time ago: http://jeffreykegler.github.io/Ocean-of-Awareness-blog/individual/2011/10/perl-and-parsing-12-beating-up-on-the-use-statement.html I also discuss this section of the Perl code in two other blog posts: http://jeffreykegler.github.io/Ocean-of-Awareness-blog/individual/2011/09/perl-and-parsing-9-use-and-the-ruby-slippers.html Hope this is helpful. -- jeffrey On Thu Mar 06 13:54:52 2014, kentfredric wrote:
|
From [Unknown Contact. See original ticket]I am the author of Marpa, a module which is mentioned in the ticket. While looking into Perl parsing for Marpa, I ran into this problem, which I called the "reversed use statement". I incorporated some parsing experiments on it into Marpa's test suite. That's why Marpa tests for reversed use statements. I wrote a blog post on this problem some time ago: http://jeffreykegler.github.io/Ocean-of-Awareness-blog/individual/2011/10/perl-and-parsing-12-beating-up-on-the-use-statement.html I also discuss this section of the Perl code in two other blog posts: http://jeffreykegler.github.io/Ocean-of-Awareness-blog/individual/2011/09/perl-and-parsing-9-use-and-the-ruby-slippers.html Hope this is helpful. -- jeffrey On Thu Mar 06 13:54:52 2014, kentfredric wrote:
|
From @kentfredricOn 26 March 2014 03:53, Jeffrey Kegler via RT <perlbug-comment@perl.org>wrote:
Just attaching tinyurls of all of the above, because for some reason, each http://tinyurl.com/krqv2e4 # Beating up on the use statement http://tinyurl.com/ma7myyt # Parsing USE http://tinyurl.com/klh56nx # Parsing USE the easy way -- |
From @jkeenanOn Thu Mar 06 13:54:52 2014, kentfredric wrote:
Looking at what's at that link, my impression is that most of the modules on CPAN that display this are Acme::* modules.
This ticket has not generated any discussion since it was file 6+ months ago. Comments? Thank you very much. -- |
The RT System itself - Status changed from 'new' to 'open' |
From @cpansproutOn Tue Sep 23 18:36:36 2014, jkeenan wrote:
I’ve known about this ‘feature’ for a long time. It’s kind of fun to use it in JAPHs, but I don’t mind if it goes. I had concluded that I would rip it out if it got in the way of a bug fix, but leave it otherwise. However, if someone else wants to remove it, that’s fine. -- Father Chrysostomos |
From @bulk88On Tue Sep 23 18:36:36 2014, jkeenan wrote:
I'd keep it since it is DWIM. -- |
From @rjbs* bulk88 via RT <perlbug-followup@perl.org> [2014-09-24T21:42:18]
I'd see it removed for the opposite reason: I don't think anyone who writes -- |
From @andk
rs> * bulk88 via RT <perlbug-followup@perl.org> [2014-09-24T21:42:18]
rs> I'd see it removed for the opposite reason: I don't think anyone who writes +1 -- |
From @AbigailOn Wed, Sep 24, 2014 at 10:35:37PM -0400, Ricardo Signes wrote:
But what do we gain if we start forbidding it now? No doubt there's I'm with bulk88 on this one; since it's DWIM, my vote is to keep it. Abigail |
From @ap* Abigail <abigail@abigail.be> [2014-09-25 11:00]:
It does not fix existing code but would improve not-yet-written code.
My vote too. But document it as discouraged, IMO. Not just because it is bad to use |
From @jkeenanOn 09/25/2014 05:40 AM, Aristotle Pagaltzis wrote:
+1 to early containment of the problem! |
From @rjbs* Aristotle Pagaltzis <pagaltzis@gmx.de> [2014-09-25T05:40:41]
I stand by my earlier reply to this, but...
Say that in mid-2018 we realize, then, that we want to use this syntax, or that I agree that we should take the action that you suggest, but I am going on -- |
Migrated from rt.perl.org#121392 (status was 'open')
Searchable as RT121392$
The text was updated successfully, but these errors were encountered: