develooper Front page | perl.perl5.porters | Postings from February 2009

Re: use 5.XXXYYY (was Re: ...st_birthtime...)

Thread Previous | Thread Next
From:
David Golden
Date:
February 28, 2009 08:32
Subject:
Re: use 5.XXXYYY (was Re: ...st_birthtime...)
Message ID:
5d4beb40902280832y65cd415fj8ce8da77bccfc4a6@mail.gmail.com
On Sat, Feb 28, 2009 at 10:25 AM, Rafael Garcia-Suarez
<rgarciasuarez@gmail.com> wrote:
> For ages, "use 5.XXXXYYY" has mean "I'm going to use features of
> behaviours that are only provided or tested from this perl version
> onwards". It has never meant "change the behaviour of an existing
> feature into a more useful albeit incompatible one". Changing behaviours
> has been traditionnally the domain of explicit pragmas. Or, of
> incompatible changes. (Like the suppression of pseudo-hashes)

I understand.  I'm suggesting (perhaps even arguing for, though mostly
to provoke conversation) to *change* that historical usage to
something else.

Rather than requiring multiple, explicit pragmas, I'm saying why *not*
have "use 5.XXXYYY" be a statement that the following code
intentionally wants *all* new behaviors, and then encourage explicit
pragmas to turn behaviors off.

I.e. replace this:

   use 5.012;
   use strict;
   use warnings;
   use some_new_foo;

With just this:

   use 5.012;

I don't see how that's really any different conceptually than replacing this:

  use 5.010;
  use feature ':5.10'

With this:

  use 5.010;

It's just shorthand for saying "Perl, turn it all on, because I know
what to expect".

>> Then "use pragmas ':5.12'" could, for example, do "use strict; use
>> warnings: use feature ':5.12'" and so on.
>
> OK, but I don't think such a pragmas.pm should be in the core. It
> doesn't need to.
>

It doesn't need to be for "use pragmas ..."  (c.f. ToolSet or
Modern::Perl), but for "use 5.XXXYYY" to trigger something like
"pragmas" the way 5.010 triggers feature then it would have to be, of
course.  That's all I meant.

-- David

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