4 5204593b74eb sv.c: Make sv_pvn_force_flags guard against SV_UNDEF_RETURNS_NULL.
5 dad26a174010 Since the HTML files generated by pod2html claim to have a utf-8 charset, actually write the files out using utf-8. This is a fix for RT #111446.
6 28333232a1c7 Don’t localise CopSTASH(&PL_compiling) in newCONSTSUB
7 c947b31cf142 Do away with stashpv_hvname_match
8 d0279c7ce493 Fix bad assertions in pp_ctl.c:pp_caller
9 df826430da0d make TRIE nodes "absorb" NOTHING->EXACT sequences
10 3b6759a6b102 optimise (?:|) and related NOTHING like constructs out of the compiled optree
11 5435c3759c45 Experimentally Use Unicode 6.2 beta
12 4a808ed163df [perl #111610] Trouble with XS-APItest/t/clone-with-stack.t
13 1db94eebfa93 Quieten B::Deparse warnings (fixes #113464).
14 72a866183393 reorganize perlcheat
15 9a62b98f29d2 gv.c: Don’t ENTER/LEAVE unnecessarily
16 ee1b3814fd18 gv.c: Remove mro_method_changed_in() from gv_init
17 a3c74922a705 Rmv mro_method_changed_in call on stub upgraded to const
18 186a5ba82d58 Don’t create pads for sub stubs
19 7ad40bcb0a19 Don’t call mro_method_changed_in after newCONSTSUB
20 83b195e49dd1 ensure correctness if sv_2mortal modifies errno
24 perldelta - what is new for perl v5.17.1
28 This document describes differences between the 5.17.0 release and
31 If you are upgrading from an earlier release such as 5.16.0, first read
32 L<perl5170delta>, which describes differences between 5.16.0 and
35 =head1 Core Enhancements
37 =head2 More CORE:: subs
39 Several more built-in functions have been added as subroutines to the
40 CORE:: namespace, namely, those non-overridable keywords that can be
41 implemented without custom parsers: C<defined>, C<delete>, C<exists>,
42 C<glob>, C<pos>, C<protoytpe>, C<scalar>, C<split>, C<study>, and C<undef>.
44 As some of these have prototypes, C<prototype('CORE::...')> has been
45 changed to not make a distinction between overridable and non-overridable
46 keywords. This is to make C<prototype('CORE::pos')> consistent with
47 C<prototype(&CORE::pos)>.
49 =head1 Incompatible Changes
51 =head2 C</(?{})/> and C</(??{}> have been heavily reworked.
53 The implementation of this feature has been almost completely rewritten.
54 Although its main intent is to fix bugs, some behaviours, especially
55 related to the scope of lexical variables, will have changed. This is
56 described more fully in the L</Selected Bug Fixes> section.
58 =head2 C<\N{BELL}> now refers to U+1F514 instead of U+0007
60 Unicode 6.0 reused the name "BELL" for a different code point than it
61 traditionally had meant. Since Perl v5.14, use of this name still
62 referred to U+0007, but would raise a deprecated warning. Now, "BELL"
63 refers to U+1F514, and the name for U+0007 is "ALERT". All the
64 functions in L<charnames> have been correspondingly updated.
66 =head2 Alphanumeric operators must now be separated from the closing
67 delimiter of regular expressions
69 You may no longer write something like:
73 Instead you must write
77 with whitespace separating the operator from the closing delimiter of
78 the regular expression. Not having whitespace has resulted in a
79 deprecated warning since Perl v5.14.0.
81 =head2 C<require> dies for unreadable files
83 When C<require> encounters an unreadable file, it now dies. It used to
84 ignore the file and continue searching the directories in @INC
87 =head1 Performance Enhancements
93 The C<x> repetition operator is now folded to a single constant at compile
94 time if called in scalar context with constant operands and no parentheses
95 around the left operand.
99 =head1 Modules and Pragmata
101 =head2 Updated Modules and Pragmata
107 L<ExtUtils::CBuilder> has been upgraded from version 0.280206 to 0.280208.
109 Manifest files are now correctly embedded for those versions of VC++ which
110 make use of them. [perl #111782, #111798].
114 L<B> has been upgraded from version 1.35 to 1.36.
116 C<B::COP::stashlen> has been replaced with C<B::COP::stashoff>.
118 C<B::COP::stashpv> now supports UTF8 package names and embedded NULs.
122 L<Class::Struct> has been upgraded from version 0.63 to 0.64.
124 The constructor now respects overridden accessor methods [perl #29230].
128 L<DynaLoader> has been upgraded from version 1.14 to 1.15.
130 This is due to a minor code change in the XS for the VMS implementation.
134 L<File::DosGlob> has been upgraded from version 1.07 to 1.08.
136 There are no visible changes, only minor internal refactorings.
140 L<File::Spec::Unix> has been upgraded from version 3.39_02 to 3.39_03.
142 C<abs2rel> could produce incorrect results when given two relative paths or
143 the root directory twice [perl #111510].
147 L<IO> has been upgraded from version 1.25_06 to 1.25_07.
149 C<sync()> can now be called on read-only file handles [perl #64772].
153 L<Pod::Html> has been upgraded from version 1.15_02 to 1.16.
155 The option C<--libpods> has been reinstated. It is deprecated, and its use
156 does nothing other than issue a warning that it is no longer supported.
160 L<Unicode::UCD> has been upgraded from version 0.43 to 0.44.
162 This adds a function L<all_casefolds()|Unicode::UCD/all_casefolds()>
163 that returns all the casefolds.
167 L<Scalar::Util> has been upgraded from version 1.23 to version 1.25.
173 =head2 Changes to Existing Documentation
181 L<perlfaq> has been synchronised with version 5.0150040 from C<CPAN>.
187 =head2 Removals of Diagnostics
193 The "Runaway prototype" warning that occurs in bizarre cases has been
194 removed as being unhelpful and inconsistent.
198 The "Not a format reference" error has been removed, as the only case in
199 which it could be triggered was a bug.
203 =head1 Platform Support
205 =head2 Platform-Specific Notes
207 XXX note fails on win2k and vms
213 C<link> on Win32 now attempts to set C<$!> to more appropriate values
214 based on the Win32 API error code. [perl #112272]
216 Perl no longer mangles the environment block, e.g. when launching a new
217 sub-process, when the environment contains non-ASCII characters. Known
218 problems still remain, however, when the environment contains characters
219 outside of the current ANSI codepage (e.g. see the item about Unicode in
220 C<%ENV> in L<http://perl5.git.perl.org/perl.git/blob/HEAD:/Porting/todo.pod>).
225 =head1 Internal Changes
231 The C<study> function was made a no-op in 5.16. It was simply disabled via
232 a C<return> statement; the code was left in place. Now the code supporting
233 what C<study> used to do has been removed.
237 Under threaded perls, there is no longer a separate PV allocated for every
238 COP to store its package name (C<< cop->stashpv >>). Instead, there is an
239 offset (C<< cop->stashoff >>) into the new C<PL_stashpad> array, which
240 holds stash pointers.
244 In the pluggable regex API, the C<regexp_engine> struct has acquired a new
245 field C<op_comp>, which is currently just for perl's internal use, and
246 should be initialised to NULL by other regex plugin modules.
250 A new function C<alloccoptash> has been added to the API, but is considered
251 experimental. See L<perlapi>.
255 =head1 Selected Bug Fixes
261 The implementation of code blocks in regular expressions, such as C<(?{})>
262 and C<(??{})> has been heavily reworked to eliminate a whole slew of bugs.
263 The main user-visible changes are:
269 Code blocks within patterns are now parsed in the same pass as the
270 surrounding code; in particular it is no longer necessary to have balanced
271 braces: this now works:
275 This means that this error message is longer generated:
277 Sequence (?{...}) not terminated or not {}-balanced in regex
279 but a new error may be seen:
281 Sequence (?{...}) not terminated with ')'
283 In addition, literal code blocks within run-time patterns are only
284 compiled once, at perl compile-time:
287 # this 'FOO' block of code is compiled once,
288 # at the same time as the surrounding 'for' loop
294 Lexical variables are now sane as regards scope, recursion and closure
295 behaviour. In particular, C</A(?{B})C/> behaves (from a closure viewpoint)
296 exactly like C</A/ && do { B } && /C/>, while C<qr/A(?{B})C/> is like
297 C<sub {/A/ && do { B } && /C/}>. So this code now works how you might
298 expect, creating three regexes that match 0, 1, and 2:
301 push @r, qr/^(??{$i})$/;
303 "1" =~ $r[1]; # matches
307 The C<use re 'eval'> pragma is now only required for code blocks defined
308 at runtime; in particular in the following, the text of the C<$r> pattern is
309 still interpolated into the new pattern and recompiled, but the individual
310 compiled code-blocks within C<$r> are reused rather than being recompiled,
311 and C<use re 'eval'> isn't needed any more:
313 my $r = qr/abc(?{....})def/;
318 Flow control operators no longer crash. Each code block runs in a new
319 dynamic scope, so C<next> etc. will not see any enclosing loops and
320 C<caller> will not see any calling subroutines. C<return> returns a value
321 from the code block, not from any enclosing subroutine.
325 Perl normally caches the compilation of run-time patterns, and doesn't
326 recompile if the pattern hasn't changed; but this is now disabled if
327 required for the correct behaviour of closures; for example:
329 my $code = '(??{$x})';
331 # recompile to see fresh value of $x each time
338 The C</msix> and C<(?msix)> etc. flags are now propagated into the return
339 value from C<(??{})>; this now works:
341 "AB" =~ /a(??{'b'})/i;
345 Warnings and errors will appear to come from the surrounding code (or for
346 run-time code blocks, from an eval) rather than from an C<re_eval>:
348 use re 'eval'; $c = '(?{ warn "foo" })'; /$c/;
353 foo at (re_eval 1) line 1.
354 foo at (re_eval 2) line 1.
358 foo at (eval 1) line 1.
359 foo at /some/prog line 2.
365 Perl now works as well as can be expected on all releases of Unicode so
366 far. In v5.16, it worked on Unicodes 6.0 and 6.1, but there were
367 various bugs for earlier releases; the older the release the more
372 C<vec> no longer produces "uninitialized" warnings in lvalue context
377 An optimisation involving fixed strings in regular expressions could cause
378 a severe performance penalty in edge cases. This has been fixed
383 The "Can't find an opnumber" message that C<prototype> produces when passed
384 a string like "CORE::nonexistent_keyword" now passes UTF8 and embedded
385 NULs through unchanged [perl #97478].
389 C<prototype> now treats magical variables like C<$1> the same way as
390 non-magical variables when checking for the CORE:: prefix, instead of
391 treating them as subroutine names.
395 Under threaded perls, a runtime code block in a regular expression could
396 corrupt the package name stored in the op tree, resulting in bad reads
397 in C<caller>, and possibly crashes [perl #113060].
401 Referencing a closure prototype (C<\&{$_[1]}> in an attribute handler for a
402 closure) no longer results in a copy of the subroutine (or assertion
403 failures on debugging builds).
407 C<eval '__PACKAGE__'> now returns the right answer on threaded builds if
408 the current package has been assigned over (as in
409 C<*ThisPackage:: = *ThatPackage::>) [perl #78742].
413 If a package is deleted by code that it calls, it is possible for C<caller>
414 to see a stack frame belonging to that deleted package. C<caller> could
415 crash if the stash's memory address was reused for a scalar and a
416 substitution was performed on the same scalar [perl #113486].
420 C<UNIVERSAL::can> no longer treats its first argument differently
421 depending on whether it is a string or number internally.
425 C<open> with "<&" for the mode checks to see whether the third argument is
426 a number, in determining whether to treat it as a file descriptor or a
427 handle name. Magical variables like C<$1> were always failing the numeric
428 check and being treated as handle names.
432 C<warn>'s handling of magical variables (C<$1>, ties) has undergone several
433 fixes. FETCH is only called once now on a tied argument or a tied C<$@>
434 [perl #97480]. Tied variables returning objects that stringify as "" are
435 no longer ignored. A tied C<$@> that happened to return a reference the
436 I<previous> time is was used is no longer ignored.
440 C<warn ""> now treats C<$@> with a number in it the same way, regardless of
441 whether it happened via C<$@=3> or C<$@="3">. It used to ignore the
442 former. Now it appends "\t...caught", as it has always done with
447 Numeric operators on magical variables (e.g., S<C<$1 + 1>>) used to use
448 floating point operations even where integer operations were more appropriate,
449 resulting in loss of accuracy on 64-bit platforms [perl #109542].
453 Unary negation no longer treats a string as a number if the string happened
454 to be used as a number at some point. So, if C<$x> contains the string "dogs",
455 C<-$x> returns "-dogs" even if C<$y=0+$x> has happened at some point.
459 In Perl 5.14, C<-'-10'> was fixed to return "10", not "+10". But magical
460 variables (C<$1>, ties) were not fixed till now [perl #57706].
464 Unary negation now treats strings consistently, regardless of the internal
469 A regression introduced in Perl v5.16.0 involving
470 C<tr/I<SEARCHLIST>/I<REPLACEMENTLIST>/> has been fixed. Only the first
471 instance is supposed to be meaningful if a character appears more than
472 once in C<I<SEARCHLIST>>. Under some circumstances, the final instance
473 was overriding all earlier ones. [perl #113584]
477 Regular expressions like C<qr/\87/> previously silently inserted a NUL
478 character, thus matching as if it had been written C<qr/\00087/>. Now it
479 matches as if it had been written as C<qr/87/>, with a message that the
480 sequence C<"\8"> is unrecognized.
484 C<__SUB__> now works in special blocks (BEGIN, END, etc.).
488 Thread creation on Windows could theoretically result in a crash if done
489 inside a BEGIN block. It still does not work properly, but it no longer
490 crashes [perl #111610].
494 =head1 Acknowledgements
496 XXX Generate this with:
498 perl Porting/acknowledgements.pl v5.17.0..HEAD
500 =head1 Reporting Bugs
502 If you find what you think is a bug, you might check the articles
503 recently posted to the comp.lang.perl.misc newsgroup and the perl
504 bug database at http://rt.perl.org/perlbug/ . There may also be
505 information at http://www.perl.org/ , the Perl Home Page.
507 If you believe you have an unreported bug, please run the L<perlbug>
508 program included with your release. Be sure to trim your bug down
509 to a tiny but sufficient test case. Your bug report, along with the
510 output of C<perl -V>, will be sent off to perlbug@perl.org to be
511 analysed by the Perl porting team.
513 If the bug you are reporting has security implications, which make it
514 inappropriate to send to a publicly archived mailing list, then please send
515 it to perl5-security-report@perl.org. This points to a closed subscription
516 unarchived mailing list, which includes
517 all the core committers, who will be able
518 to help assess the impact of issues, figure out a resolution, and help
519 co-ordinate the release of patches to mitigate or fix the problem across all
520 platforms on which Perl is supported. Please only use this address for
521 security issues in the Perl core, not for modules independently
526 The F<Changes> file for an explanation of how to view exhaustive details
529 The F<INSTALL> file for how to build Perl.
531 The F<README> file for general stuff.
533 The F<Artistic> and F<Copying> files for copyright information.