develooper Front page | perl.perl5.porters | Postings from March 2014

[perl #121392] use VERSION MODULE should not be considered legal

Thread Next
From:
Jeffrey Kegler via RT
Date:
March 30, 2014 09:08
Subject:
[perl #121392] use VERSION MODULE should not be considered legal
Message ID:
rt-4.0.18-20184-1395759226-1975.121392-14-0@perl.org
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-Awar​eness-blog/individual/2011/10/perl-and-parsi​ng-12-beating-up-on-the-use-statement.html
In it I list some of the variations of the reversed use statement and their behaviors.

I also discuss this section of the Perl code in two other blog posts:  http://jeffreykegler.github.io/Ocean-of-A​wareness-blog/individual/2011/09/perl-and​-parsing-9-use-and-the-ruby-slippers.html
and
http://jeffreykegler.github.io/Ocean-of​-Awareness-blog/individual/2011/10/perl​-and-parsing-10-use-the-easier-way.html
These don't mention the bug specifically, but they talk about the code that causes it.

Hope this is helpful. -- jeffrey

On Thu Mar 06 13:54:52 2014, kentfredric wrote:
> While reading toke.c a while back, I stumbled upon an unfortunate
> accident.
> 
> use VERSION MODULE;
> use MODULE  VERSION;
> 
> These forms are equivalent.
> 
> And the former form deparses into the latter.


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About