remove empty perldelta section
[p5sagit/p5-mst-13.2.git] / pod / perl5131delta.pod
1 =encoding utf8
2
3 =head1 NAME
4
5 perldelta - what is new for perl v5.13.1
6
7 =head1 DESCRIPTION
8
9 This document describes differences between the 5.13.0 release and
10 the 5.13.1 release.
11
12 If you are upgrading from an earlier release such as 5.10, first read
13 L<perl5120delta>, which describes differences between 5.10 and
14 5.12.
15
16 =head1 Incompatible Changes
17
18 =head2 "C<\cI<X>>"
19
20 The backslash-c construct was designed as a way of specifying
21 non-printable characters, but there were no restrictions (on ASCII
22 platforms) on what the character following the C<c> could be.  Now, that
23 character must be one of the ASCII characters.
24
25 =head2 localised tied hashes, arrays and scalars are no longed tied
26
27 In the following:
28
29     tie @a, ...;
30     {
31         local @a;
32         # here, @a is a now a new, untied array
33     }
34     # here, @a refers again to the old, tied array
35
36 The new local array used to be made tied too, which was fairly pointless,
37 and has now been fixed. This fix could however potentially cause a change
38 in behaviour of some code.
39
40 =head2 C<given> return values
41
42 Starting from this release, C<given> blocks returns the last evaluated
43 expression, or an empty list if the block was exited by C<break>. Thus you
44 can now write:
45
46     my $type = do {
47      given ($num) {
48       break     when undef;
49       'integer' when /^[+-]?[0-9]+$/;
50       'float'   when /^[+-]?[0-9]+(?:\.[0-9]+)?$/;
51       'unknown';
52      }
53     };
54
55 See L<perlsyn/Return value> for details.
56
57 =head1 Core Enhancements
58
59 =head2 Exception Handling Reliability
60
61 Several changes have been made to the way C<die>, C<warn>, and C<$@>
62 behave, in order to make them more reliable and consistent.
63
64 When an exception is thrown inside an C<eval>, the exception is no
65 longer at risk of being clobbered by code running during unwinding
66 (e.g., destructors).  Previously, the exception was written into C<$@>
67 early in the throwing process, and would be overwritten if C<eval> was
68 used internally in the destructor for an object that had to be freed
69 while exiting from the outer C<eval>.  Now the exception is written
70 into C<$@> last thing before exiting the outer C<eval>, so the code
71 running immediately thereafter can rely on the value in C<$@> correctly
72 corresponding to that C<eval>.
73
74 Likewise, a C<local $@> inside an C<eval> will no longer clobber any
75 exception thrown in its scope.  Previously, the restoration of C<$@> upon
76 unwinding would overwrite any exception being thrown.  Now the exception
77 gets to the C<eval> anyway.  So C<local $@> is safe inside an C<eval>,
78 albeit of rather limited use.
79
80 Exceptions thrown from object destructors no longer modify the C<$@>
81 of the surrounding context.  (If the surrounding context was exception
82 unwinding, this used to be another way to clobber the exception being
83 thrown.  Due to the above change it no longer has that significance,
84 but there are other situations where C<$@> is significant.)  Previously
85 such an exception was sometimes emitted as a warning, and then either
86 string-appended to the surrounding C<$@> or completely replaced the
87 surrounding C<$@>, depending on whether that exception and the surrounding
88 C<$@> were strings or objects.  Now, an exception in this situation is
89 always emitted as a warning, leaving the surrounding C<$@> untouched.
90 In addition to object destructors, this also affects any function call
91 performed by XS code using the C<G_KEEPERR> flag.
92
93 C<$@> is also no longer used as an internal temporary variable when
94 preparing to C<die>.  Previously it was internally necessary to put
95 any exception object (any non-string exception) into C<$@> first,
96 before it could be used as an exception.  (The C API still offers the
97 old option, so an XS module might still clobber C<$@> in the old way.)
98 This change together with the foregoing means that, in various places,
99 C<$@> may be observed to contain its previously-assigned value, rather
100 than having been overwritten by recent exception-related activity.
101
102 Warnings for C<warn> can now be objects, in the same way as exceptions
103 for C<die>.  If an object-based warning gets the default handling,
104 of writing to standard error, it will of course still be stringified
105 along the way.  But a C<$SIG{__WARN__}> handler will now receive an
106 object-based warning as an object, where previously it was passed the
107 result of stringifying the object.
108
109 =head1 Modules and Pragmata
110
111 =head2 Updated Modules
112
113 =over
114
115 =item C<Errno>
116
117 The implementation of C<Errno> has been refactored to use about 55% less memory.
118 There should be no user-visible changes.
119
120 =item Perl 4 C<.pl> libraries
121
122 These historical libraries have been minimally modified to avoid using
123 C<$[>.  This is to prepare them for the deprecation of C<$[>.
124
125 =item C<B::Deparse>
126
127 A bug has been fixed when deparsing a nextstate op that has both a
128 change of package (relative to the previous nextstate), or a change of
129 C<%^H> or other state, and a label.  Previously the label was emitted
130 first, leading to syntactically invalid output because a label is not
131 permitted immediately before a package declaration, B<BEGIN> block,
132 or some other things.  Now the label is emitted last.
133
134 =back
135
136 =head2 Removed Modules and Pragmata
137
138 The following modules have been removed from the core distribution, and if
139 needed should be installed from CPAN instead.
140
141 =over
142
143 =item C<Class::ISA>
144
145 =item C<Pod::Plainer>
146
147 =item C<Switch>
148
149 =back
150
151 The removal of C<Shell> has been deferred until after 5.14, as the
152 implementation of C<Shell> shipped with 5.12.0 did not correctly issue the
153 warning that it was to be removed from core.
154
155 =head1 New Documentation
156
157 =over 4
158
159 =item perlepigraph
160
161 You can now find a list of the quotes issued with each release of perl in
162 F<Porting/perlepigraph.pod>.
163
164 =item perlgpl
165
166 L<perlgpl> has been updated to contain GPL version 1, as is included in the
167 F<README> distributed with perl.
168
169 =back
170
171 =head1 Selected Bug Fixes
172
173 =over 4
174
175 =item *
176
177 Naming a deprecated character in \N{...} will not leak memory.
178
179 =item *
180
181 FETCH is no longer called needlessly on some tied variables.
182
183 =item *
184
185 The trie runtime code should no longer allocate massive amounts of memory,
186 fixing #74484.
187
188 =back
189
190 =head1 Changed Internals
191
192 =over 4
193
194 =item *
195
196 The protocol for unwinding the C stack at the last stage of a C<die>
197 has changed how it identifies the target stack frame.  This now uses
198 a separate variable C<PL_restartjmpenv>, where previously it relied on
199 the C<blk_eval.cur_top_env> pointer in the C<eval> context frame that
200 has nominally just been discarded.  This change means that code running
201 during various stages of Perl-level unwinding no longer needs to take
202 care to avoid destroying the ghost frame.
203
204 =item *
205
206 The format of entries on the scope stack has been changed, resulting in a
207 reduction of memory usage of about 10%. In particular, the memory used by
208 the scope stack to record each active lexical variable has been halved.
209
210 =item *
211
212 Memory allocation for pointer tables has been changed. Previously
213 C<Perl_ptr_table_store> allocated memory from the same arena system as C<SV>
214 bodies and C<HE>s, with freed memory remaining bound to those arenas until
215 interpreter exit. Now it allocates memory from arenas private to the specific
216 pointer table, and that memory is returned to the system when
217 C<Perl_ptr_table_free> is called. Additionally, allocation and release are both
218 less CPU intensive.
219
220 =item *
221
222 A new function, Perl_magic_methcall has been added that wraps the setup needed
223 to call a magic method like FETCH (the existing S_magic_methcall function has
224 been renamed S_magic_methcall1).
225
226 =back
227
228 =head1 Deprecations
229
230 The following items are now deprecated.
231
232 =over 4
233
234 =item C<Perl_ptr_table_clear>
235
236 C<Perl_ptr_table_clear> is no longer part of Perl's public API. Calling it now
237 generates a deprecation warning, and it will be removed in a future
238 release.
239
240 =back
241
242 =head1 Acknowledgements
243
244 Perl 5.13.1 represents thirty days of development since Perl 5.13.0 and
245 contains 15390 lines of changes across 289 files from 34 authors and
246 committers.
247
248 Thank you to the following for contributing to this release:
249
250 Ævar Arnfjörð Bjarmason, Arkturuz, Chris 'BinGOs' Williams, Craig A. Berry,
251 Curtis Jewell, Dan Dascalescu, David Golden, David Mitchell, Father
252 Chrysostomos, Gene Sullivan, gfx, Gisle Aas, H.Merijn Brand, James E Keenan,
253 James Mastros, Jan Dubois, Jesse Vincent, Karl Williamson, Leon Brocard,
254 Lubomir Rintel (GoodData), Nicholas Clark, Philippe Bruhat (BooK), Rafael
255 Garcia-Suarez, Rainer Tammer, Ricardo Signes, Richard Soderberg, Robin Barker,
256 Ruslan Zakirov, Steffen Mueller, Todd Rinaldo, Tony Cook, Vincent Pit, Zefram
257
258 =head1 Reporting Bugs
259
260 If you find what you think is a bug, you might check the articles
261 recently posted to the comp.lang.perl.misc newsgroup and the perl
262 bug database at http://rt.perl.org/perlbug/ .  There may also be
263 information at http://www.perl.org/ , the Perl Home Page.
264
265 If you believe you have an unreported bug, please run the B<perlbug>
266 program included with your release.  Be sure to trim your bug down
267 to a tiny but sufficient test case.  Your bug report, along with the
268 output of C<perl -V>, will be sent off to perlbug@perl.org to be
269 analysed by the Perl porting team.
270
271 If the bug you are reporting has security implications, which make it
272 inappropriate to send to a publicly archived mailing list, then please send
273 it to perl5-security-report@perl.org. This points to a closed subscription
274 unarchived mailing list, which includes all the core committers, who be able
275 to help assess the impact of issues, figure out a resolution, and help
276 co-ordinate the release of patches to mitigate or fix the problem across all
277 platforms on which Perl is supported. Please only use this address for
278 security issues in the Perl core, not for modules independently
279 distributed on CPAN.
280
281 =head1 SEE ALSO
282
283 The F<Changes> file for an explanation of how to view exhaustive details
284 on what changed.
285
286 The F<INSTALL> file for how to build Perl.
287
288 The F<README> file for general stuff.
289
290 The F<Artistic> and F<Copying> files for copyright information.
291
292 =cut