This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
db47d6f17f21711d2bff1c922f06051e95a274da
[perl5.git] / pod / perl5131delta.pod
1 =encoding utf8
2
3 =head1 NAME
4
5 [ this is a template for a new perldelta file. Any text flagged as
6 XXX needs to be processed before release. ]
7
8 perldelta - what is new for perl v5.13.1
9
10 =head1 DESCRIPTION
11
12 This document describes differences between the 5.13.0 release and
13 the 5.13.1 release.
14
15 If you are upgrading from an earlier release such as 5.10, first read
16 L<perl5120delta>, which describes differences between 5.10 and
17 5.12.
18
19 =head1 Notice
20
21 XXX Any important notices here
22
23 =head1 Incompatible Changes
24
25 =head2 "C<\cI<X>>"
26
27 The backslash-c construct was designed as a way of specifying
28 non-printable characters, but there were no restrictions (on ASCII
29 platforms) on what the character following the C<c> could be.  Now, that
30 character must be one of the ASCII characters.
31
32 =head2 localised tied hashes, arrays and scalars are no longed tied
33
34 In the following:
35
36     tie @a, ...;
37     {
38         local @a;
39         # here, @a is a now a new, untied array
40     }
41     # here, @a refers again to the old, tied array
42
43 The new local array used to be made tied too, which was fairly pointless,
44 and has now been fixed. This fix could however potentially cause a change
45 in behaviour of some code.
46
47 =head2 C<given> return values
48
49 Starting from this release, C<given> blocks returns the last evaluated
50 expression, or an empty list if the block was exited by C<break>. Thus you
51 can now write:
52
53     my $type = do {
54      given ($num) {
55       break     when undef;
56       'integer' when /^[+-]?[0-9]+$/;
57       'float'   when /^[+-]?[0-9]+(?:\.[0-9]+)?$/;
58       'unknown';
59      }
60     };
61
62 See L<perlsyn/Return value> for details.
63
64 =head1 Core Enhancements
65
66 XXX New core language features go here. Summarise user-visible core language
67 enhancements. Particularly prominent performance optimisations could go
68 here, but most should go in the L</Performance Enhancements> section.
69
70 =head2 Exception Handling Reliability
71
72 Several changes have been made to the way C<die>, C<warn>, and C<$@>
73 behave, in order to make them more reliable and consistent.
74
75 When an exception is thrown inside an C<eval>, the exception is no
76 longer at risk of being clobbered by code running during unwinding
77 (e.g., destructors).  Previously, the exception was written into C<$@>
78 early in the throwing process, and would be overwritten if C<eval> was
79 used internally in the destructor for an object that had to be freed
80 while exiting from the outer C<eval>.  Now the exception is written
81 into C<$@> last thing before exiting the outer C<eval>, so the code
82 running immediately thereafter can rely on the value in C<$@> correctly
83 corresponding to that C<eval>.
84
85 Likewise, a C<local $@> inside an C<eval> will no longer clobber any
86 exception thrown in its scope.  Previously, the restoration of C<$@> upon
87 unwinding would overwrite any exception being thrown.  Now the exception
88 gets to the C<eval> anyway.  So C<local $@> is safe inside an C<eval>,
89 albeit of rather limited use.
90
91 Exceptions thrown from object destructors no longer modify the C<$@>
92 of the surrounding context.  (If the surrounding context was exception
93 unwinding, this used to be another way to clobber the exception being
94 thrown.  Due to the above change it no longer has that significance,
95 but there are other situations where C<$@> is significant.)  Previously
96 such an exception was sometimes emitted as a warning, and then either
97 string-appended to the surrounding C<$@> or completely replaced the
98 surrounding C<$@>, depending on whether that exception and the surrounding
99 C<$@> were strings or objects.  Now, an exception in this situation is
100 always emitted as a warning, leaving the surrounding C<$@> untouched.
101 In addition to object destructors, this also affects any function call
102 performed by XS code using the C<G_KEEPERR> flag.
103
104 C<$@> is also no longer used as an internal temporary variable when
105 preparing to C<die>.  Previously it was internally necessary to put
106 any exception object (any non-string exception) into C<$@> first,
107 before it could be used as an exception.  (The C API still offers the
108 old option, so an XS module might still clobber C<$@> in the old way.)
109 This change together with the foregoing means that, in various places,
110 C<$@> may be observed to contain its previously-assigned value, rather
111 than having been overwritten by recent exception-related activity.
112
113 Warnings for C<warn> can now be objects, in the same way as exceptions
114 for C<die>.  If an object-based warning gets the default handling,
115 of writing to standard error, it will of course still be stringified
116 along the way.  But a C<$SIG{__WARN__}> handler will now receive an
117 object-based warning as an object, where previously it was passed the
118 result of stringifying the object.
119
120 =head1 New Platforms
121
122 XXX List any platforms that this version of perl compiles on, that previous
123 versions did not. These will either be enabled by new files in the F<hints/>
124 directories, or new subdirectories and F<README> files at the top level of the
125 source tree.
126
127 =head1 Modules and Pragmata
128
129 XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
130 go here.  If Module::CoreList is updated, generate an initial draft of the
131 following sections using F<Porting/corelist-perldelta.pl>, which prints stub
132 entries to STDOUT.  Results can be pasted in place of the '=head2' entries
133 below.  A paragraph summary for important changes should then be added by hand.
134 In an ideal world, dual-life modules would have a F<Changes> file that could be
135 cribbed.
136
137 =over
138
139 =item C<Errno>
140
141 The implementation of C<Errno> has been refactored to use about 55% less memory.
142 There should be no user-visible changes.
143
144 =back
145
146 =head2 New Modules and Pragmata
147
148 =head2 Pragmata Changes
149
150 =head2 Updated Modules
151
152 =over
153
154 =item Perl 4 C<.pl> libraries
155
156 These historical libraries have been minimally modified to avoid using
157 C<$[>.  This is to prepare them for the deprecation of C<$[>.
158
159 =item C<B::Deparse>
160
161 A bug has been fixed when deparsing a nextstate op that has both a
162 change of package (relative to the previous nextstate), or a change of
163 C<%^H> or other state, and a label.  Previously the label was emitted
164 first, leading to syntactically invalid output because a label is not
165 permitted immediately before a package declaration, B<BEGIN> block,
166 or some other things.  Now the label is emitted last.
167
168 =back
169
170 =head2 Removed Modules and Pragmata
171
172 The following modules have been removed from the core distribution, and if
173 needed should be installed from CPAN instead.
174
175 =over
176
177 =item C<Class::ISA>
178
179 =item C<Pod::Plainer>
180
181 =item C<Switch>
182
183 =back
184
185 The removal of C<Shell> has been deferred until after 5.14, as the
186 implementation of C<Shell> shipped with 5.12.0 did not correctly issue the
187 warning that it was to be removed from core.
188
189 =head1 Utility Changes
190
191 XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go
192 here. Most of these are built within the directories F<utils> and F<x2p>.
193
194 =over 4
195
196 =item F<XXX>
197
198 XXX
199
200 =back
201
202 =head1 New Documentation
203
204 XXX Changes which create B<new> files in F<pod/> go here.
205
206 =over 4
207
208 =item L<XXX>
209
210 XXX
211
212 =back
213
214 =head1 Changes to Existing Documentation
215
216 XXX Changes which significantly change existing files in F<pod/> go here.
217 Any changes to F<pod/perldiag.pod> should go in L</New or Changed Diagnostics>.
218
219
220 =head1 Performance Enhancements
221
222 XXX Changes which enhance performance without changing behaviour go here. There
223 may well be none in a stable release.
224
225 =over 4
226
227 =item *
228
229 XXX
230
231 =back
232
233 =head1 Installation and Configuration Improvements
234
235 XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
236 go here.
237
238 =head2 Configuration improvements
239
240 XXX
241
242 =head2 Compilation improvements
243
244 XXX
245
246 =head2 Platform Specific Changes
247
248 =over 4
249
250 =item XXX-some-platform
251
252 XXX
253
254 =back
255
256 =head1 Selected Bug Fixes
257
258 XXX Important bug fixes in the core language are summarised here.
259 Bug fixes in files in F<ext/> and F<lib/> are best summarised in
260 L</Modules and Pragmata>.
261
262 =over 4
263
264 =item *
265
266 XXX
267
268 =back
269
270 =head1 New or Changed Diagnostics
271
272 XXX New or changed warnings emitted by the core's C<C> code go here.
273
274 =over 4
275
276 =item C<XXX>
277
278 XXX
279
280 =back
281
282 =head1 Changed Internals
283
284 XXX Changes which affect the interface available to C<XS> code go here.
285
286 =over 4
287
288 =item *
289
290 The protocol for unwinding the C stack at the last stage of a C<die>
291 has changed how it identifies the target stack frame.  This now uses
292 a separate variable C<PL_restartjmpenv>, where previously it relied on
293 the C<blk_eval.cur_top_env> pointer in the C<eval> context frame that
294 has nominally just been discarded.  This change means that code running
295 during various stages of Perl-level unwinding no longer needs to take
296 care to avoid destroying the ghost frame.
297
298 =item *
299
300 The format of entries on the scope stack has been changed, resulting in a
301 reduction of memory usage of about 10%. In particular, the memory used by
302 the scope stack to record each active lexical variable has been halved.
303
304 =item *
305
306 Memory allocation for pointer tables has been changed. Previously
307 C<Perl_ptr_table_store> allocated memory from the same arena system as C<SV>
308 bodies and C<HE>s, with freed memory remaining bound to those arenas until
309 interpreter exit. Now it allocates memory from arenas private to the specific
310 pointer table, and that memory is returned to the system when
311 C<Perl_ptr_table_free> is called. Additionally, allocation and release are both
312 less CPU intensive.
313
314 =item *
315
316 XXX
317
318 =back
319
320 =head1 New Tests
321
322 XXX Changes which create B<new> files in F<t/> go here. Changes to
323 existing files in F<t/> aren't worth summarising, although the bugs that
324 they represent may be.
325
326 =over 4
327
328 =item F<XXX>
329
330 XXX
331
332 =back
333
334 =head1 Known Problems
335
336 XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any
337 tests that had to be C<TODO>ed for the release would be noted here, unless
338 they were specific to a particular platform (see below).
339
340 This is a list of some significant unfixed bugs, which are regressions
341 from either 5.XXX.XXX or 5.XXX.XXX.
342
343 =over 4
344
345 =item *
346
347 XXX
348
349 =back
350
351 =head1 Deprecations
352
353 XXX Add any new known deprecations here.
354
355 The following items are now deprecated.
356
357 =over 4
358
359 =item C<Perl_ptr_table_clear>
360
361 C<Perl_ptr_table_clear> is no longer part of Perl's public API. Calling it now
362 generates a deprecation warning, and it will be removed in a future
363 release.
364
365 =item *
366
367 XXX
368
369 =back
370
371 =head1 Platform Specific Notes
372
373 XXX Any changes specific to a particular platform. VMS and Win32 are the usual
374 stars here. It's probably best to group changes under the same section layout
375 as the main perldelta
376
377 =head1 Obituary
378
379 XXX If any significant core contributor has died, we've added a short obituary
380 here.
381
382 =head1 Acknowledgements
383
384 XXX The list of people to thank goes here.
385
386
387 =head1 Reporting Bugs
388
389 If you find what you think is a bug, you might check the articles
390 recently posted to the comp.lang.perl.misc newsgroup and the perl
391 bug database at http://rt.perl.org/perlbug/ .  There may also be
392 information at http://www.perl.org/ , the Perl Home Page.
393
394 If you believe you have an unreported bug, please run the B<perlbug>
395 program included with your release.  Be sure to trim your bug down
396 to a tiny but sufficient test case.  Your bug report, along with the
397 output of C<perl -V>, will be sent off to perlbug@perl.org to be
398 analysed by the Perl porting team.
399
400 If the bug you are reporting has security implications, which make it
401 inappropriate to send to a publicly archived mailing list, then please send
402 it to perl5-security-report@perl.org. This points to a closed subscription
403 unarchived mailing list, which includes all the core committers, who be able
404 to help assess the impact of issues, figure out a resolution, and help
405 co-ordinate the release of patches to mitigate or fix the problem across all
406 platforms on which Perl is supported. Please only use this address for
407 security issues in the Perl core, not for modules independently
408 distributed on CPAN.
409
410 =head1 SEE ALSO
411
412 The F<Changes> file for an explanation of how to view exhaustive details
413 on what changed.
414
415 The F<INSTALL> file for how to build Perl.
416
417 The F<README> file for general stuff.
418
419 The F<Artistic> and F<Copying> files for copyright information.
420
421 =cut