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

Re: the "require" branch, maintperl, and security

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
March 20, 2016 13:52
Subject:
Re: the "require" branch, maintperl, and security
Message ID:
20160320135211.GI29332@iabyn.com
On Thu, Aug 02, 2012 at 03:59:54PM +0100, Nicholas Clark wrote:
> Yes, given that we already have different meanings for interior sequences of
> multiple pairs of colons within the bareword between modules and packages,
> I'm comfortable that it is consistent to make require with any number of
> paired leading colons an error.
> 
> (I believe that odd numbers of colons are already an error. Hence my phrasing)

I'm just reviving this 4-year old thread concerning what to do about
'require ::Foo::Bar'.

I could have sworn we had already fixed this, but it turns out not.

I think a consensus had been reached in this thread that a bareword
require with any combination of at least 2 leading colons should just die.

In the branch smoke-me/davem/require that I've just pushed, I've
rebased and tweaked Nicholas's original branch, and added an extra commit
that converts anything starting with 2 colons into an error:

    $ perl -e'require ::Foo::Bar'
    Bareword in require must not start with a double-colon: "::Foo::Bar"
    $

(Unlike the similar work in cperl, I've added a specific new error
message, and made the offending module name be displayed pre-conversion to
a pathname.)

If this is ok, should it go in before 5.24?



-- 
It's not that I'm afraid to die, I just don't want to be there when it
happens.
    -- Woody Allen

Thread Previous | 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