This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta for 412989c
[perl5.git] / pod / perldelta.pod
index d8e934f..e4fbc83 100644 (file)
@@ -27,6 +27,30 @@ here, but most should go in the L</Performance Enhancements> section.
 
 [ List each enhancement as a =head2 entry ]
 
+=head2 New double-diamond operator
+
+C<<< <<>> >>> is like C<< <> >> but uses three-argument C<open> to open
+each file in @ARGV.  So each element of @ARGV is an actual file name, and
+"|foo" won't be treated as a pipe open.
+
+=head2 Aliasing via reference
+
+Variables and subroutines can now be aliased by assigning to a reference:
+
+    \$c = \$d;
+    \&x = \&y;
+
+Or by using a backslash before a C<foreach> iterator variable, which is
+perhaps the most useful idiom this feature provides:
+
+    foreach \%hash (@array_of_hash_refs) { ... }
+
+This feature is experimental and must be enabled via C<use feature
+'refaliasing'>.  It will warn unless the C<experimental::refaliasing>
+warnings category is disabled.
+
+See L<perlref/Assigning to References>.
+
 =head2 Perl now supports POSIX 2008 locale currency additions.
 
 On platforms that are able to handle POSIX.1-2008, the
@@ -42,6 +66,16 @@ C<int_p_sep_by_space>,
 and
 C<int_p_sign_posn>.
 
+=head2 Packing infinity or not-a-number into a character is now fatal.
+
+Before, when trying to pack infinity or not-a-number into a
+(signed) character, Perl would warn, and assumed you tried to
+pack C<< 0xFF >>; if you gave it as an argument to C<< chr >>,
+C<< U+FFFD >> was returned. 
+
+But now, all such actions (C<< pack >>, C<< chr >>, and C<< print '%c' >>)
+result in a fatal error.
+
 =head1 Security
 
 =head2 Perl is now compiled with -fstack-protector-strong if available
@@ -129,6 +163,32 @@ Non-magical/non-tied scalars that contain only a floating point value and are
 on most Perl builds with 64 bit integers now use 8-32 less bytes of memory
 depending on OS.
 
+=item *
+
+In C<@array = split>, the assigment can be optimised away with C<split>
+writing directly to the array.  This optimisation was happening only for
+package arrays other than @_ and only
+sometimes.  Now this optimisation happens
+almost all the time.
+
+=item *
+
+C<join> is now subject to constant folding.  Moreover, C<join> with a
+scalar or constant for the separator and a single-item list to join is
+simplified to a stringification.  The separator doesn't even get evaluated.
+
+=item *
+
+C<qq(@array)> is implemented using two ops: a stringify op and a join op.
+If the qq contains nothing but a single array, the stringification is
+optimised away.
+
+=item *
+
+C<our $var> and C<our($s,@a,%h)> in void context are no longer evaluated at
+run time.  Even a whole sequence of C<our $foo;> statements will simply be
+skipped over.  The same applies to C<state> variables.
+
 =back
 
 =head1 Modules and Pragmata
@@ -163,12 +223,73 @@ Avoid reading beyond the end of a buffer. [perl #122629]
 
 =item *
 
+L<B::Concise> has been upgraded from version 0.993 to 0.994.
+
+Null ops that are part of the execution chain are now given sequence
+numbers.
+
+Private flags for nulled ops are now dumped with mnemonics as they would be
+for the non-nulled counterparts.
+
+L<B::Deparse> has been upgraded from version 1.28 to 1.29.
+
+Parenthesised arrays in lists passed to C<\> are now correctly deparsed
+with parentheses (e.g., C<\(@a, (@b), @c)> now retains the parentheses
+around @b), this preserving the flattening behaviour of referenced
+parenthesised arrays.  Formerly, it only worked for one array: C<\(@a)>.
+
+C<local our> is now deparsed correctly, with the C<our> included.
+
+C<for($foo; !$bar; $baz) {...}> was deparsed without the C<!> (or C<not>).
+This has been fixed.
+
+Core keywords that conflict with lexical subroutines are now deparsed with
+the C<CORE::> prefix.
+
+C<foreach state $x (...) {...}> now deparses correctly with C<state> and
+not C<my>.
+
+C<our @array = split(...)> now deparses correctly with C<our> in those
+cases where the assignment is optimised away.
+
+=item *
+
+L<DynaLoader> has been upgraded from version 1.26 to 1.27.
+
+Remove dl_nonlazy global if unused in Dynaloader. [perl #122926]
+
+=item *
+
+L<Fcntl> has been upgraded from version 1.12 to 1.13.
+
+Add support for the Linux pipe buffer size fcntl() commands.
+
+=item *
+
+L<File::Find> has been upgraded from version 1.28 to 1.29.
+
+Slightly faster module loading time.
+
+=item *
+
 L<Module::CoreList> has been upgraded from version 5.20140920 to 5.20141020.
 
 Updated to cover the latest releases of Perl.
 
 =item *
 
+The PathTools module collection has been upgraded from version 3.50 to 3.51.
+
+Slightly faster module loading time.
+
+=item *
+
+L<POSIX> has been upgraded from version 1.44 to 1.45.
+
+POSIX::tmpnam() now produces a deprecation warning.  [perl #122005]
+
+=item *
+
 L<XSLoader> has been upgraded from version 0.17 to 0.18.
 
 Allow XSLoader to load modules from a different namespace.
@@ -240,7 +361,19 @@ and New Warnings
 
 =item *
 
-XXX L<message|perldiag/"message">
+L<message|perldiag/"Cannot chr %f">
+
+=item *
+
+L<message|perldiag/"Cannot compress %f in pack">
+
+=item *
+
+L<message|perldiag/"Cannot pack %f with '%c'">
+
+=item *
+
+L<message|perldiag/"Cannot printf %f with '%c'">
 
 =back
 
@@ -262,7 +395,8 @@ XXX Changes (i.e. rewording) of diagnostic messages go here
 
 =item *
 
-XXX Describe change here
+'"my" variable &foo::bar can't be in a package' has been reworded to say
+'subroutine' instead of 'variable'.
 
 =back
 
@@ -316,7 +450,10 @@ that they represent may be covered elsewhere.
 
 =item *
 
-XXX
+Some regular expression tests are written in such a way that they will
+run very slowly if certain optimizations break. These tests have been
+moved into new files, F<< t/re/speed.t >> and F<< t/re/speed_thr.t >>,
+and are run with a C<< watchdog() >>.
 
 =back
 
@@ -400,6 +537,40 @@ testing their values in C<pp_dbstate>.  This prevents perl from
 recursing infinity if an overloaded object is assigned to any of those
 variables. [perl #122445]
 
+=item *
+
+C<Perl_tmps_grow> which is marked as public API but undocumented has been
+removed from public API. If you use C<EXTEND_MORTAL> macro in your XS code to
+preextend the mortal stack, you are unaffected by this change.
+
+=item *
+
+C<cv_name>, which was introduced in 5.21.4, has been changed incompatibly.
+It now has a flags field that allows the caller to specify whether the name
+should be fully qualified.  See L<perlapi/cv_name>.
+
+=item *
+
+Internally Perl no longer uses the C<SVs_PADMY> flag.  C<SvPADMY()> now
+returns a true value for anything not marked PADTMP.  C<SVs_PADMY> is now
+defined as 0.
+
+=item *
+
+The macros SETsv and SETsvUN have been removed. They were no longer used
+in the core since commit 6f1401dc2a, and have not been found present on
+CPAN.
+
+=item *
+
+The C<< SvFAKE >> bit (unused on HVs) got informally reserved by
+David Mitchell for future work on vtables.
+
+=item *
+The C<sv_catpvn_flags> function accepts C<SV_CATBYTES> and C<SV_CATUTF8>
+flags, which specify whether the appended string is bytes or utf8,
+respectively.
+
 =back
 
 =head1 Selected Bug Fixes
@@ -413,7 +584,84 @@ files in F<ext/> and F<lib/> are best summarized in L</Modules and Pragmata>.
 
 =item *
 
-XXX
+Locking and unlocking values via L<Hash::Util> or C<Internals::SvREADONLY>
+no longer has any affect on values that are read-only to begin.  Unlocking
+such values could result in crashes, hangs or other erratic behaviour.
+
+=item *
+
+The internal C<looks_like_number> function (which L<Scalar::Util> provides
+access to) began erroneously to return true for "-e1" in 5.21.4, affecting
+also C<-'-e1'>.  This has been fixed.
+
+=item *
+
+The flip-flop operator (C<..> in scalar context) would return the same
+scalar each time, unless the containing subroutine was called recursively.
+Now it always returns a new scalar.  [perl #122829]
+
+=item *
+
+Some unterminated C<(?(...)...)> constructs in regular expressions would
+either crash or give erroneous error messages.  C</(?(1)/> is one such
+example.
+
+=item *
+
+C<pack "w", $tied> no longer calls FETCH twice.
+
+=item *
+
+List assignments like C<($x, $z) = (1, $y)> now work correctly if $x and $y
+have been aliased by C<foreach>.
+
+=item *
+
+Some patterns including code blocks with syntax errors, such as
+C</ (?{(^{})/>, would hang or fail assertions on debugging builds.  Now
+they produce errors.
+
+=item *
+
+An assertion failure when parsing C<sort> with debugging enabled has been
+fixed.  [perl #122771]
+
+=item *
+
+C<*a = *b; @a = split //, $b[1]> could do a bad read and produce junk
+results.
+
+=item *
+
+In C<() = @array = split>, the C<() => at the beginning no longer confuses
+the optimiser, making it assume a limit of 1.
+
+=item *
+
+Fatal warnings no longer prevent the output of syntax errors.
+[perl #122966]
+
+=item *
+
+Fixed a NaN double to long double conversion error on VMS. For quiet NaNs
+(and only on Itanium, not Alpha) negative infinity instead of NaN was
+produced. 
+
+=item *
+
+Fixed the issue that caused C<< make distclean >> to leave files behind
+that shouldn't. [perl #122820]
+
+=item *
+
+AIX now sets the length in C<< getsockopt >> correctly. [perl #120835],
+[rt #91183], [rt #85570].
+
+=item *
+
+During the pattern optimization phase, we no longer recurse into
+GOSUB/GOSTART when not SCF_DO_SUBSTR. This prevents the optimizer
+to run "forever" and exhaust all memory. [perl #122283]
 
 =back