4 23b7025ebc definitely needs to be summarised.
8 perldelta - what is new for perl v5.17.7
12 This document describes differences between the 5.17.6 release and the 5.17.7
15 If you are upgrading from an earlier release such as 5.17.5, first read
16 L<perl5176delta>, which describes differences between 5.17.5 and 5.17.6.
18 =head1 Core Enhancements
20 =head2 $&, $` and $' are no longer slow
22 These three infamous variables have been redeemed and no longer slow down
23 your program when used. Hence, the /p regular expression flag now does
28 =head2 C<Storable> security warning in documentation
30 The documentation for C<Storable> now includes a section which warns readers
31 of the danger of accepting Storable documents from untrusted sources. The
32 short version is that deserializing certain types of data can lead to loading
33 modules and other code execution. This is documented behavior and wanted
34 behavior, but this opens an attack vector for malicious entities.
36 =head2 C<Locale::Maketext> allowed code injection via a malicious template
38 If users could provide a translation string to Locale::Maketext, this could be
39 used to invoke arbitrary Perl subroutines available in the current process.
41 This has been fixed, but it is still possible to invoke any method provided by
42 C<Locale::Maketext> itself or a subclass that you are using. One of these
43 methods in turn will invoke the Perl core's C<sprintf> subroutine.
45 In summary, allowing users to provide translation strings without auditing
48 This vulnerability is documented in CVE-2012-6329.
50 =head1 Incompatible Changes
52 =head2 readline() with C<$/ = \N> now reads N characters, not N bytes
54 Previously, when reading from a stream with I/O layers such as
55 C<encoding>, the readline() function, otherwise known as the C<< <> >>
56 operator, would read I<N> bytes from the top-most layer. [perl #79960]
58 Now, I<N> characters are read instead.
60 There is no change in behaviour when reading from streams with no
61 extra layers, since bytes map exactly to characters.
63 =head2 Lexical subroutine warnings have moved
65 The warning about the use of an experimental feature emitted when lexical
66 subroutines (added in 5.17.4) are used now happens when the subroutine
67 itself is declared, not when the "lexical_subs" feature is activated via
70 This stops C<use feature ':all'> from warning, but causes
71 C<my sub foo; my sub bar> to warn twice.
73 =head2 Overridden C<glob> is now passed one argument
75 C<glob> overrides used to be passed a magical undocumented second argument
76 that identified the caller. Nothing on CPAN was using this, and it got in
77 the way of a bug fix, so it was removed. If you really need to identify
78 the caller, see L<Devel::Callsite> on CPAN.
82 =head2 Lexical $_ is now deprecated
84 Since it was introduced in Perl 5.10, it has caused much confusion with no
91 Various modules (e.g., List::Util) expect callback routines to use the
92 global $_. C<use List::Util 'first'; my $_; first { $_ == 1 } @list> does
93 not work as one would expect.
97 A C<my $_> declaration earlier in the same file can cause confusing closure
102 The "_" subroutine prototype character allows called subroutines to access
103 your lexical $_, so it is not really private after all.
107 Nevertheless, subroutines with a "(@)" prototype and methods cannot access
108 the caller's lexical $_, unless they are written in XS.
112 But even XS routines cannot access a lexical $_ declared, not in the
113 calling subroutine, but in an outer scope, iff that subroutine happened not
114 to mention $_ or use any operators that default to $_.
118 =head2 Various XS-callable functions are now deprecated
120 The following functions will be removed from a future version of Perl,
121 and should not be used. With participating C compilers (e.g., gcc),
122 compiling any file that uses any of these will generate a warning.
123 These were not intended for public use; there are equivalent, faster,
124 macros for most of them. See L<perlapi/Character classes>:
125 C<is_uni_ascii>, C<is_uni_ascii_lc>, C<is_uni_blank>, C<is_uni_blank_lc>,
126 C<is_uni_cntrl>, C<is_uni_cntrl_lc>, C<is_uni_idfirst_lc>, C<is_uni_space>,
127 C<is_uni_space_lc>, C<is_uni_xdigit>, C<is_uni_xdigit_lc>, C<is_utf8_ascii>,
128 C<is_utf8_blank>, C<is_utf8_cntrl>, C<is_utf8_idcont>, C<is_utf8_idfirst>,
129 C<is_utf8_perl_space>, C<is_utf8_perl_word>, C<is_utf8_posix_digit>,
130 C<is_utf8_space>, C<is_utf8_xdigit>. C<is_utf8_xidcont>, C<is_utf8_xidfirst>,
131 C<to_uni_lower_lc>, C<to_uni_title_lc>, and C<to_uni_upper_lc>.
133 =head1 Performance Enhancements
139 Perl has a new copy-on-write mechanism that avoids the need to copy the
140 internal string buffer when assigning from one scalar to another. This
141 makes copying large strings appear much faster. Modifying one of the two
142 (or more) strings after an assignment will force a copy internally. This
143 makes it unnecessary to pass strings by reference for efficiency.
147 =head1 Modules and Pragmata
149 =head2 Updated Modules and Pragmata
155 L<File::DosGlob> has been upgraded from version 1.08 to 1.09. The internal
156 cache of file names that it keeps for each caller is now freed when that
157 caller is freed. This means
158 C<< use File::DosGlob 'glob'; eval 'scalar <*>' >> no longer leaks memory.
162 L<File::Glob> has been upgraded from version 1.18 to 1.19. File::Glob has
163 had exactly the same fix as File::DosGlob. Since it is what Perl's own
164 C<glob> operator itself uses (except on VMS), this means
165 C<< eval 'scalar <*>' >> no longer leaks.
169 L<GDBM_File> has been upgraded from version 1.14 to 1.15. The undocumented
170 optional fifth parameter to C<TIEHASH> has been removed. This was intended
171 to provide control of the callback used by C<gdbm*> functions in case of
172 fatal errors (such as filesystem problems), but did not work (and could
173 never have worked). No code on CPAN even attempted to use it. The callback
174 is now always the previous default, C<croak>. Problems on some platforms with
175 how the C<C> C<croak> function is called have also been resolved.
181 =head2 Changes to Existing Documentation
183 =head3 L<perlapi/Character classes>
189 There are quite a few macros callable from XS modules that classify
190 characters into things like alphabetic, punctuation, etc. More of these
191 are now documented, including ones which work on characters whose code
192 points are outside the Latin-1 range.
198 The following additions or changes have been made to diagnostic output,
199 including warnings and fatal error messages. For the complete list of
200 diagnostic messages, see L<perldiag>.
202 =head2 Changes to Existing Diagnostics
208 L<Constant(%s): Call to &{$^H{%s}} did not return a defined value|perldiag/Constant(%s): Call to &{$^H{%s}} did not return a defined value>
210 Constant overloading that returns C<undef> results in this error message.
211 For numeric constants, it used to say "Constant(undef)". "undef" has been
212 replaced with the number itself.
216 =head1 Internal Changes
222 SvUPGRADE() is no longer an expression. Originally this macro (and its
223 underlying function, sv_upgrade()) were documented as boolean, although
224 in reality they always croaked on error and never returned false. In 2005
225 the documentation was updated to specify a void return value, but
226 SvUPGRADE() was left always returning 1 for backwards compatibility. This
227 has now been removed, and SvUPGRADE() is now a statement with no return
230 So this is now a syntax error:
232 if (!SvUPGRADE(sv)) { croak(...); }
234 If you have code like that, simply replace it with
238 or to to avoid compiler warnings with older perls, possibly
244 Perl has a new copy-on-write mechanism that allows any SvPOK scalar to be
245 upgraded to a copy-on-write scalar. A reference count on the string buffer
246 is stored in the string buffer itself.
248 This breaks a few XS modules by allowing copy-on-write scalars to go
249 through code paths that never encountered them before.
251 This behaviour can still be disabled by running F<Configure> with
252 B<-Accflags=-DPERL_NO_COW>. This option will probably be removed in Perl
257 Copy-on-write no longer uses the SvFAKE and SvREADONLY flags. Hence,
258 SvREADONLY indicates a true read-only SV.
260 Use the SvIsCOW macro (as before) to identify a copy-on-write scalar.
264 C<PL_sawampersand> is now a constant. The switch this variable provided
265 (to enable/disable the pre-match copy depending on whether C<$&> had been
266 seen) has been removed and replaced with copy-on-write, eliminating a few
269 The previous behaviour can still be enabled by running F<Configure> with
270 B<-Accflags=-DPERL_SAWAMPERSAND>.
274 PL_glob_index is gone.
278 =head1 Selected Bug Fixes
284 C<sort {undef} ...> under fatal warnings no longer crashes. It started
285 crashing in Perl 5.16.
289 Stashes blessed into each other
290 (C<bless \%Foo::, 'Bar'; bless \%Bar::, 'Foo'>) no longer result in double
291 frees. This bug started happening in Perl 5.16.
295 Numerous memory leaks have been fixed, mostly involving fatal warnings and
300 Lexical constants (C<my sub answer () { 42 }>) no longer cause double
305 Constant subroutine redefinition warns by default, but lexical constants
306 were accidentally exempt from default warnings. This has been corrected.
310 Some failed regular expression matches such as C<'f' =~ /../g> were not
311 resetting C<pos>. Also, "match-once" patterns (C<m?...?g>) failed to reset
312 it, too, when invoked a second time [perl #23180].
316 Accessing C<$&> after a pattern match now works if it had not been seen
317 before the match. I.e., this applies to C<${'&'}> (under C<no strict>) and
318 C<eval '$&'>. The same applies to C<$'> and C<$`> [perl #4289].
322 Several bugs involving C<local *ISA> and C<local *Foo::> causing stale
323 MRO caches have been fixed.
327 Defining a subroutine when its typeglob has been aliased no longer results
328 in stale method caches. This bug was introduced in Perl 5.10.
332 Localising a typeglob containing a subroutine when the typeglob's package
333 has been deleted from its parent stash no longer produces an error. This
334 bug was introduced in Perl 5.14.
338 Under some circumstances, C<local *method=...> would fail to reset method
339 caches upon scope exit.
343 C</[.foo.]/> is no longer an error, but produces a warning (as before) and
344 is treated as C</[.fo]/> [perl #115818].
348 C<goto $tied_var> now calls FETCH before deciding what type of goto
349 (subroutine or label) this is.
353 Renaming packages through glob assignment
354 (C<*Foo:: = *Bar::; *Bar:: = *Baz::>) in combination with C<m?...?> and
355 C<reset> no longer makes threaded builds crash.
359 An earlier release in the 5.17.x series could crash if user code prevented
360 _charnames from loading via C<$INC{'_charnames.pm'}++>.
364 A number of bugs related to hash assignment have been fixed:
370 The expression C<scalar(%h = (1, 1, 1, 1))> now returns C<4>, not C<2>.
374 Perl now issues the same warning on C<($s, %h) = (1, {})> as it does for
375 C<(%h) = ({})>, "Reference found where even-sized list expected".
379 The return value of C<%h = (1, 1, 1)> in list context was wrong.
383 A number of additional edge cases in list assignment to hashes were
384 corrected. For more details see commit 23b7025ebc.
390 =head1 Acknowledgements
392 Perl 5.17.7 represents approximately 4 weeks of development since Perl 5.17.6
393 and contains approximately 30,000 lines of changes across 490 files from 26
396 Perl continues to flourish into its third decade thanks to a vibrant community
397 of users and developers. The following people are known to have contributed the
398 improvements that became Perl 5.17.7:
400 Alexandr Ciornii, Bob Ernst, Brian Carlson, Chris 'BinGOs' Williams, Craig A.
401 Berry, Daniel Dragan, Dave Rolsky, David Mitchell, Father Chrysostomos, Hugo
402 van der Sanden, James E Keenan, Joel Berger, Karl Williamson, Lukas Mai, Martin
403 Hasch, Matthew Horsfall, Nicholas Clark, Ricardo Signes, Ruslan Zakirov, Sergey
404 Alekseev, Steffen Müller, Sullivan Beck, Sven Strickroth, Sébastien
405 Aperghis-Tramoni, Tony Cook, Yves Orton.
407 The list above is almost certainly incomplete as it is automatically generated
408 from version control history. In particular, it does not include the names of
409 the (very much appreciated) contributors who reported issues to the Perl bug
412 Many of the changes included in this version originated in the CPAN modules
413 included in Perl's core. We're grateful to the entire CPAN community for
414 helping Perl to flourish.
416 For a more complete list of all of Perl's historical contributors, please see
417 the F<AUTHORS> file in the Perl source distribution.
419 =head1 Reporting Bugs
421 If you find what you think is a bug, you might check the articles recently
422 posted to the comp.lang.perl.misc newsgroup and the perl bug database at
423 http://rt.perl.org/perlbug/ . There may also be information at
424 http://www.perl.org/ , the Perl Home Page.
426 If you believe you have an unreported bug, please run the L<perlbug> program
427 included with your release. Be sure to trim your bug down to a tiny but
428 sufficient test case. Your bug report, along with the output of C<perl -V>,
429 will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
431 If the bug you are reporting has security implications, which make it
432 inappropriate to send to a publicly archived mailing list, then please send it
433 to perl5-security-report@perl.org. This points to a closed subscription
434 unarchived mailing list, which includes all the core committers, who will be
435 able to help assess the impact of issues, figure out a resolution, and help
436 co-ordinate the release of patches to mitigate or fix the problem across all
437 platforms on which Perl is supported. Please only use this address for
438 security issues in the Perl core, not for modules independently distributed on
443 The F<Changes> file for an explanation of how to view exhaustive details on
446 The F<INSTALL> file for how to build Perl.
448 The F<README> file for general stuff.
450 The F<Artistic> and F<Copying> files for copyright information.