This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
change this synopsis to something that actually works
[perl5.git] / pod / perldelta.pod
CommitLineData
44691e6f
AB
1=encoding utf8
2
e2f0c3bb 3=for todo
1f99886b 45204593b74eb sv.c: Make sv_pvn_force_flags guard against SV_UNDEF_RETURNS_NULL.
1f99886b
JL
528333232a1c7 Don’t localise CopSTASH(&PL_compiling) in newCONSTSUB
6c947b31cf142 Do away with stashpv_hvname_match
7d0279c7ce493 Fix bad assertions in pp_ctl.c:pp_caller
1f99886b 81db94eebfa93 Quieten B::Deparse warnings (fixes #113464).
1f99886b
JL
99a62b98f29d2 gv.c: Don’t ENTER/LEAVE unnecessarily
10ee1b3814fd18 gv.c: Remove mro_method_changed_in() from gv_init
11a3c74922a705 Rmv mro_method_changed_in call on stub upgraded to const
1f99886b 127ad40bcb0a19 Don’t call mro_method_changed_in after newCONSTSUB
e2f0c3bb 13
44691e6f
AB
14=head1 NAME
15
61174fb5 16perldelta - what is new for perl v5.17.1
27f00e3d 17
f9001595 18=head1 DESCRIPTION
2630d42b 19
61174fb5
Z
20This document describes differences between the 5.17.0 release and
21the 5.17.1 release.
7620cb10 22
f9001595 23If you are upgrading from an earlier release such as 5.16.0, first read
61174fb5
Z
24L<perl5170delta>, which describes differences between 5.16.0 and
255.17.0.
d7c042c9 26
61174fb5 27=head1 Core Enhancements
417a992d 28
028c8719
FC
29=head2 More CORE:: subs
30
31Several more built-in functions have been added as subroutines to the
32CORE:: namespace, namely, those non-overridable keywords that can be
33implemented without custom parsers: C<defined>, C<delete>, C<exists>,
f1303084 34C<glob>, C<pos>, C<protoytpe>, C<scalar>, C<split>, C<study>, and C<undef>.
028c8719
FC
35
36As some of these have prototypes, C<prototype('CORE::...')> has been
b1c9e38d 37changed to not make a distinction between overridable and non-overridable
028c8719
FC
38keywords. This is to make C<prototype('CORE::pos')> consistent with
39C<prototype(&CORE::pos)>.
40
61174fb5 41=head1 Incompatible Changes
30608892 42
e128ab2c
DM
43=head2 C</(?{})/> and C</(??{}> have been heavily reworked.
44
b1c9e38d
JL
45The implementation of this feature has been almost completely rewritten.
46Although its main intent is to fix bugs, some behaviours, especially
e128ab2c
DM
47related to the scope of lexical variables, will have changed. This is
48described more fully in the L</Selected Bug Fixes> section.
49
fe3193b5
KW
50=head2 C<\N{BELL}> now refers to U+1F514 instead of U+0007
51
52Unicode 6.0 reused the name "BELL" for a different code point than it
53traditionally had meant. Since Perl v5.14, use of this name still
54referred to U+0007, but would raise a deprecated warning. Now, "BELL"
55refers to U+1F514, and the name for U+0007 is "ALERT". All the
56functions in L<charnames> have been correspondingly updated.
05c8f9ed 57
0da72d5e 58=head2 Alphanumeric operators must now be separated from the closing
b1c9e38d 59delimiter of regular expressions
0da72d5e
KW
60
61You may no longer write something like:
62
63 m/a/and 1
64
65Instead you must write
66
67 m/a/ and 1
68
69with whitespace separating the operator from the closing delimiter of
70the regular expression. Not having whitespace has resulted in a
71deprecated warning since Perl v5.14.0.
72
e2f0c3bb
FC
73=head2 C<require> dies for unreadable files
74
75When C<require> encounters an unreadable file, it now dies. It used to
76ignore the file and continue searching the directories in @INC
77[perl #113422].
78
7d101ed1
JL
79=head2 Upgrade to the Unicode 6.2 beta
80
81Unicode 6.2 is proposing some changes that may very well break some CPAN
82modules. The timing of this nicely coincides with Perl's being early in the
83release cycle. This commit takes the current beta 6.2, adds the proposed
84changes that aren't yet in it, and subtracts the changes that would affect \X
85processing, as those turn out to have errors, and may have to be rethought.
86Unicode has been notified of these problems.
87
88This will allow us to gather data as to whether or not the proposed changes
89cause us problems. These will be presented to Unicode to aid in their final
90decision as to whether or not to go forward with the changes.
91
92These changes will be replaced by the final version of Unicode 6.2 before
935.18.0 is released.
94
61174fb5 95=head1 Performance Enhancements
95ce428c 96
f9001595 97=over 4
75ff5956 98
2630d42b 99=item *
c11980ad 100
e2f0c3bb
FC
101The C<x> repetition operator is now folded to a single constant at compile
102time if called in scalar context with constant operands and no parentheses
103around the left operand.
53de3ff0 104
61174fb5 105=back
ef7131e9 106
61174fb5 107=head1 Modules and Pragmata
ef7131e9 108
61174fb5 109=head2 Updated Modules and Pragmata
83fb037c 110
61174fb5 111=over 4
83fb037c
FC
112
113=item *
114
c01b3876
SH
115L<ExtUtils::CBuilder> has been upgraded from version 0.280206 to 0.280208.
116
117Manifest files are now correctly embedded for those versions of VC++ which
d5f3e957 118make use of them. [perl #111782, #111798].
c01b3876
SH
119
120=item *
121
5cefbec9
FC
122L<B> has been upgraded from version 1.35 to 1.36.
123
124C<B::COP::stashlen> has been replaced with C<B::COP::stashoff>.
125
18a66a2d 126C<B::COP::stashpv> now supports UTF8 package names and embedded NULs.
fbdb83f3 127
5cefbec9
FC
128=item *
129
e2f0c3bb
FC
130L<Class::Struct> has been upgraded from version 0.63 to 0.64.
131
132The constructor now respects overridden accessor methods [perl #29230].
133
134=item *
135
9331f04e
NC
136L<DynaLoader> has been upgraded from version 1.14 to 1.15.
137
138This is due to a minor code change in the XS for the VMS implementation.
139
140=item *
141
ff3f295c
NC
142L<File::DosGlob> has been upgraded from version 1.07 to 1.08.
143
144There are no visible changes, only minor internal refactorings.
145
146=item *
147
c506fc7e
FC
148L<File::Spec::Unix> has been upgraded from version 3.39_02 to 3.39_03.
149
150C<abs2rel> could produce incorrect results when given two relative paths or
151the root directory twice [perl #111510].
152
153=item *
154
d9661073 155L<IO> has been upgraded from version 1.25_06 to 1.25_07.
1c633914 156
d9661073 157C<sync()> can now be called on read-only file handles [perl #64772].
f558db2f 158
66aa79e2
KW
159=item *
160
99565752
NC
161L<Pod::Html> has been upgraded from version 1.15_02 to 1.16.
162
b1c9e38d 163The option C<--libpods> has been reinstated. It is deprecated, and its use
99565752
NC
164does nothing other than issue a warning that it is no longer supported.
165
7d101ed1
JL
166Since the HTML files generated by pod2html claim to have a utf-8 charset,
167actually write the files out using utf-8 [perl #111446].
168
99565752
NC
169=item *
170
d9661073
FC
171L<Unicode::UCD> has been upgraded from version 0.43 to 0.44.
172
66aa79e2
KW
173This adds a function L<all_casefolds()|Unicode::UCD/all_casefolds()>
174that returns all the casefolds.
175
3630f57e
CBW
176=item *
177
178L<Scalar::Util> has been upgraded from version 1.23 to version 1.25.
179
61174fb5 180=back
f558db2f 181
61174fb5 182=head1 Documentation
80b8b050 183
61174fb5 184=head2 Changes to Existing Documentation
30608892 185
c7166200 186=head3 L<perlfaq>
ecd144ea 187
f9001595 188=over 4
05c8f9ed
RS
189
190=item *
191
c7166200 192L<perlfaq> has been synchronised with version 5.0150040 from C<CPAN>.
9dea6244 193
204b72a4 194=back
9dea6244 195
7d101ed1
JL
196=head3 L<perlcheat>
197
198=over 4
199
200=item *
201
202L<perlcheat> has been reorganized, and a few new sections were added.
203
204=back
205
61174fb5 206=head1 Diagnostics
ef7131e9 207
4a301309
FC
208=head2 Removals of Diagnostics
209
210=over 4
211
a1d2df36
FC
212=item *
213
4a301309
FC
214The "Runaway prototype" warning that occurs in bizarre cases has been
215removed as being unhelpful and inconsistent.
216
8dffc0ab
FC
217=item *
218
219The "Not a format reference" error has been removed, as the only case in
220which it could be triggered was a bug.
221
dbc84d79
FC
222=item *
223
224The "Unable to create sub named %s" error has been removed for the same
225reason.
226
4a301309
FC
227=back
228
61174fb5 229=head1 Platform Support
05c8f9ed 230
61174fb5 231=head2 Platform-Specific Notes
ceb0881c 232
823a90db 233XXX note fails on win2k and vms
89cbc6b8 234
61174fb5 235=over 4
89cbc6b8 236
4aa4c0a5 237=item Win32
c6b15a5a 238
4aa4c0a5
TC
239C<link> on Win32 now attempts to set C<$!> to more appropriate values
240based on the Win32 API error code. [perl #112272]
c6b15a5a 241
0998713f
SH
242Perl no longer mangles the environment block, e.g. when launching a new
243sub-process, when the environment contains non-ASCII characters. Known
244problems still remain, however, when the environment contains characters
245outside of the current ANSI codepage (e.g. see the item about Unicode in
246C<%ENV> in L<http://perl5.git.perl.org/perl.git/blob/HEAD:/Porting/todo.pod>).
247[perl #113536]
248
61174fb5 249=back
8e125188 250
61174fb5 251=head1 Internal Changes
8e125188 252
61174fb5 253=over 4
c4643160 254
422287bf
FC
255=item *
256
b7e9bef4
FC
257The C<study> function was made a no-op in 5.16. It was simply disabled via
258a C<return> statement; the code was left in place. Now the code supporting
259what C<study> used to do has been removed.
53de3ff0 260
f8ef51fd
FC
261=item *
262
263Under threaded perls, there is no longer a separate PV allocated for every
264COP to store its package name (C<< cop->stashpv >>). Instead, there is an
265offset (C<< cop->stashoff >>) into the new C<PL_stashpad> array, which
266holds stash pointers.
267
e128ab2c
DM
268=item *
269
270In the pluggable regex API, the C<regexp_engine> struct has acquired a new
271field C<op_comp>, which is currently just for perl's internal use, and
b1c9e38d 272should be initialised to NULL by other regex plugin modules.
e128ab2c 273
e2f0c3bb
FC
274=item *
275
276A new function C<alloccoptash> has been added to the API, but is considered
277experimental. See L<perlapi>.
278
61174fb5 279=back
422287bf 280
61174fb5 281=head1 Selected Bug Fixes
2de6ba8d 282
61174fb5 283=over 4
52c4b146 284
9aa9a888
KW
285=item *
286
e128ab2c
DM
287The implementation of code blocks in regular expressions, such as C<(?{})>
288and C<(??{})> has been heavily reworked to eliminate a whole slew of bugs.
289The main user-visible changes are:
290
291=over 4
292
293=item *
294
295Code blocks within patterns are now parsed in the same pass as the
296surrounding code; in particular it is no longer necessary to have balanced
297braces: this now works:
298
299 /(?{ $x='{' })/
300
301This means that this error message is longer generated:
302
303 Sequence (?{...}) not terminated or not {}-balanced in regex
304
305but a new error may be seen:
306
307 Sequence (?{...}) not terminated with ')'
308
309In addition, literal code blocks within run-time patterns are only
310compiled once, at perl compile-time:
311
312 for my $p (...) {
313 # this 'FOO' block of code is compiled once,
314 # at the same time as the surrounding 'for' loop
315 /$p{(?{FOO;})/;
316 }
317
318=item *
319
320Lexical variables are now sane as regards scope, recursion and closure
321behaviour. In particular, C</A(?{B})C/> behaves (from a closure viewpoint)
322exactly like C</A/ && do { B } && /C/>, while C<qr/A(?{B})C/> is like
323C<sub {/A/ && do { B } && /C/}>. So this code now works how you might
be722aee 324expect, creating three regexes that match 0, 1, and 2:
e128ab2c
DM
325
326 for my $i (0..2) {
327 push @r, qr/^(??{$i})$/;
328 }
329 "1" =~ $r[1]; # matches
330
331=item *
332
b1c9e38d
JL
333The C<use re 'eval'> pragma is now only required for code blocks defined
334at runtime; in particular in the following, the text of the C<$r> pattern is
e128ab2c 335still interpolated into the new pattern and recompiled, but the individual
b1c9e38d 336compiled code-blocks within C<$r> are reused rather than being recompiled,
e128ab2c
DM
337and C<use re 'eval'> isn't needed any more:
338
339 my $r = qr/abc(?{....})def/;
340 /xyz$r/;
341
342=item *
343
344Flow control operators no longer crash. Each code block runs in a new
345dynamic scope, so C<next> etc. will not see any enclosing loops and
346C<caller> will not see any calling subroutines. C<return> returns a value
347from the code block, not from any enclosing subroutine.
348
349=item *
350
351Perl normally caches the compilation of run-time patterns, and doesn't
352recompile if the pattern hasn't changed; but this is now disabled if
353required for the correct behaviour of closures; for example:
354
355 my $code = '(??{$x})';
356 for my $x (1..3) {
357 # recompile to see fresh value of $x each time
358 $x =~ /$code/;
359 }
360
361
362=item *
363
364The C</msix> and C<(?msix)> etc. flags are now propagated into the return
365value from C<(??{})>; this now works:
366
367 "AB" =~ /a(??{'b'})/i;
368
369=item *
370
371Warnings and errors will appear to come from the surrounding code (or for
372run-time code blocks, from an eval) rather than from an C<re_eval>:
373
374 use re 'eval'; $c = '(?{ warn "foo" })'; /$c/;
375 /(?{ warn "foo" })/;
376
377formerly gave:
378
379 foo at (re_eval 1) line 1.
380 foo at (re_eval 2) line 1.
381
382and now gives:
383
384 foo at (eval 1) line 1.
385 foo at /some/prog line 2.
386
387=back
388
389=item *
390
7ade940c
KW
391Perl now works as well as can be expected on all releases of Unicode so
392far. In v5.16, it worked on Unicodes 6.0 and 6.1, but there were
393various bugs for earlier releases; the older the release the more
394problems.
9aa9a888 395
701da2e9
FC
396=item *
397
398C<vec> no longer produces "uninitialized" warnings in lvalue context
399[perl #9423].
400
d67d4c0e
FC
401=item *
402
d9661073 403An optimisation involving fixed strings in regular expressions could cause
d67d4c0e
FC
404a severe performance penalty in edge cases. This has been fixed
405[perl #76546].
406
b9dc63e8
FC
407=item *
408
7d101ed1
JL
409In certain cases, including empty subpatterns within a regular expression (such
410as C<(?:)> or C<(?:|)>) could disable some optimizations. This has been fixed.
411
412=item *
413
b9dc63e8 414The "Can't find an opnumber" message that C<prototype> produces when passed
b1c9e38d 415a string like "CORE::nonexistent_keyword" now passes UTF8 and embedded
18a66a2d 416NULs through unchanged [perl #97478].
b9dc63e8 417
b6d5888c
FC
418=item *
419
c0df136d
FC
420C<prototype> now treats magical variables like C<$1> the same way as
421non-magical variables when checking for the CORE:: prefix, instead of
422treating them as subroutine names.
423
424=item *
425
b1c9e38d 426Under threaded perls, a runtime code block in a regular expression could
b6d5888c
FC
427corrupt the package name stored in the op tree, resulting in bad reads
428in C<caller>, and possibly crashes [perl #113060].
429
d8816adc
FC
430=item *
431
432Referencing a closure prototype (C<\&{$_[1]}> in an attribute handler for a
433closure) no longer results in a copy of the subroutine (or assertion
434failures on debugging builds).
435
9b9df0bb
FC
436=item *
437
438C<eval '__PACKAGE__'> now returns the right answer on threaded builds if
439the current package has been assigned over (as in
440C<*ThisPackage:: = *ThatPackage::>) [perl #78742].
441
b16ca463
FC
442=item *
443
444If a package is deleted by code that it calls, it is possible for C<caller>
445to see a stack frame belonging to that deleted package. C<caller> could
446crash if the stash's memory address was reused for a scalar and a
447substitution was performed on the same scalar [perl #113486].
448
6fe02df8
FC
449=item *
450
451C<UNIVERSAL::can> no longer treats its first argument differently
452depending on whether it is a string or number internally.
453
2aab098d
FC
454=item *
455
456C<open> with "<&" for the mode checks to see whether the third argument is
457a number, in determining whether to treat it as a file descriptor or a
458handle name. Magical variables like C<$1> were always failing the numeric
459check and being treated as handle names.
460
38d77b7f
FC
461=item *
462
463C<warn>'s handling of magical variables (C<$1>, ties) has undergone several
464fixes. FETCH is only called once now on a tied argument or a tied C<$@>
465[perl #97480]. Tied variables returning objects that stringify as "" are
466no longer ignored. A tied C<$@> that happened to return a reference the
467I<previous> time is was used is no longer ignored.
468
e811dbaa
FC
469=item *
470
8b9712e0
FC
471C<warn ""> now treats C<$@> with a number in it the same way, regardless of
472whether it happened via C<$@=3> or C<$@="3">. It used to ignore the
473former. Now it appends "\t...caught", as it has always done with
474C<$@="3">.
475
476=item *
477
e811dbaa 478Numeric operators on magical variables (e.g., S<C<$1 + 1>>) used to use
0998713f
SH
479floating point operations even where integer operations were more appropriate,
480resulting in loss of accuracy on 64-bit platforms [perl #109542].
e811dbaa 481
844115ec
FC
482=item *
483
484Unary negation no longer treats a string as a number if the string happened
b1c9e38d 485to be used as a number at some point. So, if C<$x> contains the string "dogs",
844115ec
FC
486C<-$x> returns "-dogs" even if C<$y=0+$x> has happened at some point.
487
a7143705
FC
488=item *
489
490In Perl 5.14, C<-'-10'> was fixed to return "10", not "+10". But magical
491variables (C<$1>, ties) were not fixed till now [perl #57706].
492
9c308096
FC
493=item *
494
495Unary negation now treats strings consistently, regardless of the internal
496UTF8 flag.
497
fc67deb3
KW
498=item *
499
500A regression introduced in Perl v5.16.0 involving
501C<tr/I<SEARCHLIST>/I<REPLACEMENTLIST>/> has been fixed. Only the first
502instance is supposed to be meaningful if a character appears more than
503once in C<I<SEARCHLIST>>. Under some circumstances, the final instance
504was overriding all earlier ones. [perl #113584]
505
45e0f58a
KW
506=item *
507
508Regular expressions like C<qr/\87/> previously silently inserted a NUL
509character, thus matching as if it had been written C<qr/\00087/>. Now it
b1c9e38d 510matches as if it had been written as C<qr/87/>, with a message that the
45e0f58a
KW
511sequence C<"\8"> is unrecognized.
512
e2f0c3bb
FC
513=item *
514
515C<__SUB__> now works in special blocks (BEGIN, END, etc.).
516
517=item *
518
519Thread creation on Windows could theoretically result in a crash if done
520inside a BEGIN block. It still does not work properly, but it no longer
521crashes [perl #111610].
522
dbc84d79
FC
523=item *
524
525C<\&{''}> (with the empty string) now autovivifies a stub like any other
526sub name, and no longer produces the "Unable to create sub" error
527[perl #94476].
528
61174fb5 529=back
53de3ff0 530
233bba44
JL
531=head1 Known Problems
532
533=over 4
534
535=item *
536
537On VMS, Module::Build still fails its test suite.
538
539=item *
540
541On Win32, several tests fail intermittently, and may hang unless STDERR is
542redirected.
543
544=back
545
61174fb5 546=head1 Acknowledgements
d5dc7001 547
61174fb5 548XXX Generate this with:
f9001595 549
61174fb5 550 perl Porting/acknowledgements.pl v5.17.0..HEAD
29cf780c 551
44691e6f
AB
552=head1 Reporting Bugs
553
554If you find what you think is a bug, you might check the articles
52deee2e 555recently posted to the comp.lang.perl.misc newsgroup and the perl
f9001595
RS
556bug database at http://rt.perl.org/perlbug/ . There may also be
557information at http://www.perl.org/ , the Perl Home Page.
44691e6f
AB
558
559If you believe you have an unreported bug, please run the L<perlbug>
52deee2e
DR
560program included with your release. Be sure to trim your bug down
561to a tiny but sufficient test case. Your bug report, along with the
562output of C<perl -V>, will be sent off to perlbug@perl.org to be
563analysed by the Perl porting team.
44691e6f
AB
564
565If the bug you are reporting has security implications, which make it
f9001595
RS
566inappropriate to send to a publicly archived mailing list, then please send
567it to perl5-security-report@perl.org. This points to a closed subscription
568unarchived mailing list, which includes
569all the core committers, who will be able
570to help assess the impact of issues, figure out a resolution, and help
571co-ordinate the release of patches to mitigate or fix the problem across all
572platforms on which Perl is supported. Please only use this address for
573security issues in the Perl core, not for modules independently
574distributed on CPAN.
44691e6f
AB
575
576=head1 SEE ALSO
577
52deee2e
DR
578The F<Changes> file for an explanation of how to view exhaustive details
579on what changed.
44691e6f
AB
580
581The F<INSTALL> file for how to build Perl.
582
583The F<README> file for general stuff.
584
585The F<Artistic> and F<Copying> files for copyright information.
586
587=cut