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

Re: Perl 5.16 and Beyond.

Thread Previous | Thread Next
From:
Johan Vromans
Date:
September 13, 2011 11:33
Subject:
Re: Perl 5.16 and Beyond.
Message ID:
m2aaa8gumy.fsf@phoenix.squirrel.nl
Abigail <abigail@abigail.be> writes:

> Here's an even simpler example:
>
>     use 5.18;

It would be nice if this would work as of 5.16...
(Note the absence of a smiley.)

> Normally, I would document that as "mylc returns the lowercase of its
> argument".

That would be:

  sub mylc { lc $_[0] }

However:

  use v5.18;
  sub mylc { lc $_[0] }

> But that should now be documented as "mylc returns the 5.18 lowercase
> version of its argument".

Because you *explicitly* require the v5.18 semantics.

More contrived:

  sub mylc { lc $_[0] }

  { use v5.16;
    sub mylc_5016 { lc $_[0] }
  }
  { use v5.18;
    sub mylc_5018 { lc $_[0] }
  }

Actually, I see more significant problems with Perl trying to carry all
old semantics into all new versions. You cannot simpy make a small
change to a built-in, you have to make a backup copy and keep it just in
case. This is a potential maintenance nightmare.

-- Johan



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