develooper Front page | perl.perl5.porters | Postings from November 2011

Re: Make use-version, feature and strict play nicely together

Thread Previous | Thread Next
From:
Jesse Luehrs
Date:
November 9, 2011 08:43
Subject:
Re: Make use-version, feature and strict play nicely together
Message ID:
20111109164255.GO2678@tozt.net
On Wed, Nov 09, 2011 at 11:39:12AM -0500, David Golden wrote:
> On Wed, Nov 9, 2011 at 11:19 AM, Jesse Luehrs <doy@tozt.net> wrote:
> >> To summarize:
> >>
> >>  - use use v5.1{0,2,4} works as usual
> >>  - use v5.16 will abort unless it is the first statement.
> >>  - under v5.16, using any other use v5.1{0,2,4} will abort
> >>  - starting with v5.16, a well-defined set of features/pragmas will be
> >>    established.
> >
> > So does this mean that "use v5.16" is no longer lexical (if there can be
> > only one declaration, it will necessarily have to apply to the entire
> > program to actually make sense)? Will "use v5.16; use CGI;" break (since
> > CGI.pm isn't strict-safe)? This seems to defeat the entire goal here.
> 
> No, I think he intends for it to be lexical, but that there can only
> be one such declaration per compiled block.
> 
> It should work like 'strict':
> 
>     use strict;
>     use CGI;
> 
> Compiling CGI.pm doesn't die because of strict.

I don't see how that restriction is useful at all then. { use v5.16; use
v5.14; ... } could trivially be rewritten as { use v5.16; { use v5.14;
... } } and we're back where we started. What is restricting it to the
first statement of a block supposed to accomplish?

-doy

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