This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
No longer print experimental::isa warning (closes #18754)
[perl5.git] / pod / perldelta.pod
index 73440be..39261f9 100644 (file)
@@ -5,15 +5,15 @@
 [ this is a template for a new perldelta file.  Any text flagged as XXX needs
 to be processed before release. ]
 
-perldelta - what is new for perl v5.35.5
+perldelta - what is new for perl v5.35.9
 
 =head1 DESCRIPTION
 
-This document describes differences between the 5.35.4 release and the 5.35.5
+This document describes differences between the 5.35.8 release and the 5.35.9
 release.
 
-If you are upgrading from an earlier release such as 5.35.3, first read
-L<perl5354delta>, which describes differences between 5.35.3 and 5.35.4.
+If you are upgrading from an earlier release such as 5.35.7, first read
+L<perl5358delta>, which describes differences between 5.35.7 and 5.35.8.
 
 =head1 Notice
 
@@ -21,17 +21,46 @@ XXX Any important notices here
 
 =head1 Core Enhancements
 
-=head2 iterating over multiple values at a time
+XXX New core language features go here.  Summarize user-visible core language
+enhancements.  Particularly prominent performance optimisations could go
+here, but most should go in the L</Performance Enhancements> section.
 
-As of Perl 5.36, you can iterate over multiple values at a time by specifying
-a list of lexicals within parentheses. For example,
+[ List each enhancement as a =head2 entry ]
 
-    for my ($key, $value) (%hash) { ... }
-    for my ($left, $right, $gripping) (@moties) { ... }
+=head2 @_ is now experimental within signatured subs
 
-Attempting to specify a list after C<for my> was previously a syntax error.
+Even though subroutine signatures currently remain experimental, use of the
+default arguments array (C<@_>) with a subroutine that has a signature is
+specifically also experimental, with its own warning category.  Silencing the
+C<experimental::signatures> warning category is not sufficient to dismiss
+this.  The new warning is emitted with the category name
+C<experimental::args_array_with_signatures>.
 
-For more detail see L<perlsyn/Compound Statements>.
+Any subroutine that has a signature and tries to make use of the defaults
+argument array or an element thereof (C<@_> or C<$_[INDEX]>), either
+explicitly or implicitly (such as C<shift> or C<pop> with no argument) will
+provoke a warning at compile-time:
+
+    use experimental 'signatures';
+
+    sub f ($x, $y = 123) {
+      say "The first argument is $_[0]";
+    }
+
+Z<>
+
+    Use of @_ in array element with signatured subroutine is experimental
+    at file.pl line 4.
+
+The behaviour of code which attempts to do this is no longer specified, and
+may be subject to change in a future version.
+
+=head2 The C<isa> operator is no longer experimental
+
+Introduced in Perl version 5.32.0, this operator has remained unchanged
+since then. The operator is now considered a stable languauge feature.
+
+For more detail see L<perlop/Class Instance Operator>.
 
 =head1 Security
 
@@ -55,6 +84,39 @@ XXX For a release on a stable branch, this section aspires to be:
 
 XXX Any deprecated features, syntax, modules etc. should be listed here.
 
+=head2 Downgrading a C<use VERSION> statement to below v5.11
+
+Attempting to issue a second C<use VERSION> statement that requests a version
+lower than C<v5.11> when an earlier statement that requested a version at
+least C<v5.11> has already been seen, will now print a deprecation warning.
+
+For example:
+
+    use v5.14;
+    say "The say statement is permitted";
+    use v5.8;                               # This will print a warning
+    print "We must use print\n";
+
+This is because of an intended related change to the interaction between
+C<use VERSION> and C<use strict>. If you specify a version >= 5.11, strict is
+enabled implicitly. If you request a version < 5.11, strict will become
+disabled I<even if you had previously written> C<use strict>. This was not
+the previous behaviour of C<use VERSION>, which at present will track
+explicitly-enabled strictness flags independently.
+
+Code which wishes to mix versions in this manner should use lexical scoping
+with block syntax to ensure that the differently versioned regions remain
+lexically isolated.
+
+    {
+        use v5.14;
+        say "The say statement is permitted";
+    }
+    {
+        use v5.8;                           # No warning is emitted
+        print "We must use print\n";
+    }
+
 =head2 Module removals
 
 XXX Remove this section if not applicable.
@@ -224,7 +286,9 @@ XXX Changes (i.e. rewording) of diagnostic messages go here
 
 =item *
 
-XXX Describe change here
+L<Subroutine %s redefined|perldiag/"Subroutine %s redefined">
+
+Localized subroutine redefinitions no longer trigger this warning.
 
 =back
 
@@ -260,18 +324,7 @@ L</Platform Support> section, instead.
 
 =item *
 
-The Perl C source code now uses some C99 features, which we have verified are
-supported by all compilers we target. This means that Perl's headers now
-contain some code that is legal in C99 but not C89.
-
-This may cause problems for some XS modules that unconditionally add
-C<-Werror=declaration-after-statement> to their C compiler flags if compiling
-with gcc or clang. Earlier versions of Perl support long obsolete compilers
-that are strict in rejecting certain C99 features, particularly mixed
-declarations and code, and hence it makes sense for XS module authors to audit
-that their code does not violate this. However, doing this is now only
-possible on these earlier versions of Perl, hence these modules need to be
-changed to only add this flag for C<<$] < 5.035005>>.
+XXX
 
 =back
 
@@ -332,14 +385,9 @@ XXX List any platforms that this version of perl no longer compiles on.
 
 =over 4
 
-=item NetWare
-
-Support code for Novell NetWare has been removed.  NetWare was a
-server operating system by Novell.  The port was last updated in July
-2002, and the platform itself in May 2009.
+=item XXX-some-platform
 
-Unrelated changes accidentally broke the build for the NetWare port in
-September 2009, and in 12 years no-one has reported this.
+XXX
 
 =back
 
@@ -370,26 +418,10 @@ well.
 
 =item *
 
-Memory for hash iterator state (C<struct xpvhv_aux>) is now allocated as part
-of the hash body, instead of as part of the block of memory allocated for the
-main hash array.
-
-Nothing else changes - memory for this structure is still allocated only when
-needed, is still accessed via the C<HvAUX()> macro, and the macro should only
-be called when C<SvOOK()> is true. Hashes are still always of type C<SVt_PVHV>,
-hash bodies are still allocated from arenas, and the address of the hash
-doesn't change, because the address is the pointer to the head structure, which
-never moves.
-
-Internally, a second arena (the arena with index 1) is used to allocate larger
-bodies with space for C<struct xpvhv_aux>, the body "upgraded", and the "head"
-structure updated to reflect this (much the same way that the bodies of scalars
-are upgraded). We already re-purpose arenas - arena with index 0 is used for
-C<HE *>s.
-
-None of this affects documented public XS interfaces. The only code changes are
-in F<hv.c> and F<sv.c>. As the rest of the core itself uses these macros but
-needed no changes, likely no code on CPAN will be affected either.
+New equality-test functions C<sv_numeq> and C<sv_streq> have been added, along
+with C<..._flags>-suffixed variants.  These expose a simple and consistent API
+to perform numerical or string comparison which is aware of operator
+overloading.
 
 =back
 
@@ -404,44 +436,7 @@ files in F<ext/> and F<lib/> are best summarized in L</Modules and Pragmata>.
 
 =item *
 
-Calling C<untie> on a tied hash that is partway through iteration now frees the
-iteration state immediately.
-
-Iterating a tied hash causes perl to store a copy of the current hash key to
-track the iteration state, with this stored copy passed as the second parameter
-to C<NEXTKEY>. This internal state is freed immediately when tie hash iteration
-completes, or if the hash is destroyed, but due to an implementation oversight,
-it was not freed if the hash was untied. In that case, the internal copy of the
-key would persist until the earliest of
-
-=over 4
-
-=item 1
-
-C<tie> was called again on the same hash
-
-=item 2
-
-The (now untied) hash was iterated (ie passed to any of C<keys>, C<values> or
-C<each>)
-
-=item 3
-
-The hash was destroyed.
-
-=back
-
-This inconsistency is now fixed - the internal state is now freed immediately by
-C<untie>.
-
-As the precise timing of this behaviour can be observed with pure Perl code
-(the timing of C<DESTROY> on objects returned from C<FIRSTKEY> and C<NEXTKEY>)
-it's just possible that some code is sensitive to it.
-
-=item *
-
-The C<Internals::getcwd()> function added for bootstrapping miniperl
-in perl 5.30.0 is now only available in miniperl. [github #19122]
+XXX
 
 =back
 
@@ -481,7 +476,7 @@ died, add a short obituary here.
 
 XXX Generate this with:
 
-  perl Porting/acknowledgements.pl v5.35.4..HEAD
+  perl Porting/acknowledgements.pl v5.35.8..HEAD
 
 =head1 Reporting Bugs