Commit | Line | Data |
---|---|---|
4c793fe3 FR |
1 | =encoding utf8 |
2 | ||
3 | =head1 NAME | |
4 | ||
ee0887a9 | 5 | perldelta - what is new for perl v5.13.6 |
4c793fe3 | 6 | |
ee0887a9 | 7 | =head1 DESCRIPTION |
0c692eed | 8 | |
ee0887a9 SH |
9 | This document describes differences between the 5.13.5 release and |
10 | the 5.13.6 release. | |
0c692eed | 11 | |
ee0887a9 SH |
12 | If you are upgrading from an earlier release such as 5.13.4, first read |
13 | L<perl5135delta>, which describes differences between 5.13.4 and | |
14 | 5.13.5. | |
0c692eed | 15 | |
ee0887a9 | 16 | =head1 Core Enhancements |
85318b69 | 17 | |
fb85c044 KW |
18 | =head2 C<(?^...)> regex construct added to signify default modifiers |
19 | ||
20 | A caret (also called a "cirumflex accent") C<"^"> immediately following | |
21 | a C<"(?"> in a regular expression now means that the subexpression is to | |
22 | not inherit the surrounding modifiers such as C</i>, but to revert to the | |
23 | Perl defaults. Any modifiers following the caret override the defaults. | |
24 | ||
020fe755 AB |
25 | The stringification of regular expressions now uses this |
26 | notation. E.g., before, C<qr/hlagh/i> would be stringified as | |
27 | C<(?i-xsm:hlagh)>, but now it's stringified as C<(?^i:hlagh)>. | |
28 | ||
29 | The main purpose of this is to allow tests that rely on the | |
30 | stringification to not have to change when new modifiers are added. | |
31 | See L<perlre/Extended Patterns>. | |
fb85c044 | 32 | |
9de15fec KW |
33 | =head2 C<"d">, C<"l">, and C<"u"> regex modifiers added |
34 | ||
35 | These modifiers are currently only available within a C<(?...)> construct. | |
36 | ||
37 | The C<"l"> modifier says to compile the regular expression as if it were | |
38 | in the scope of C<use locale>, even if it is not. | |
39 | ||
a12cf05f KW |
40 | The C<"u"> modifier says to compile the regular expression as if it were |
41 | in the scope of a C<use feature "unicode_strings"> pragma. | |
9de15fec | 42 | |
a12cf05f KW |
43 | The C<"d"> modifier is used to override any C<use locale> and |
44 | C<use feature "unicode_strings"> pragmas that are in effect at the time | |
45 | of compiling the regular expression. | |
46 | ||
47 | See just below and L<perlre/(?dlupimsx-imsx)>. | |
48 | ||
49 | =head2 C<use feature "unicode_strings"> now applies to some regex matching | |
50 | ||
51 | Another chunk of the L<perlunicode/The "Unicode Bug"> is fixed in this | |
52 | release. Now, regular expressions compiled within the scope of the | |
53 | "unicode_strings" feature will match the same whether or not the target | |
54 | string is encoded in utf8, with regard to C<\s>, C<\w>, C<\b>, and their | |
55 | complements. Work is underway to add the C<[[:posix:]]> character | |
56 | classes and case sensitive matching to the control of this feature, but | |
57 | was not complete in time for this dot release. | |
9de15fec | 58 | |
fb121860 KW |
59 | =head2 C<\N{...}> now handles Unicode named character sequences |
60 | ||
61 | Unicode has a number of named character sequences, in which particular sequences | |
62 | of code points are given names. C<\N{...}> now recognizes these. | |
63 | See L<charnames>. | |
64 | ||
65 | =head2 New function C<charnames::string_vianame()> | |
66 | ||
67 | This function is a run-time version of C<\N{...}>, returning the string | |
68 | of characters whose Unicode name is its parameter. It can handle | |
69 | Unicode named character sequences, whereas the pre-existing | |
70 | C<charnames::vianame()> cannot, as the latter returns a single code | |
71 | point. | |
72 | See L<charnames>. | |
73 | ||
eb32ee41 FC |
74 | =head2 Reentrant regular expression engine |
75 | ||
76 | It is now safe to use regular expressions within C<(?{...})> and | |
77 | C<(??{...})> code blocks inside regular expressions. | |
78 | ||
79 | These block are still experimental, however, and still have problems with | |
40eff326 | 80 | lexical (C<my>) variables, lexical pragmata and abnormal exiting. |
eb32ee41 | 81 | |
5e26bbbe Z |
82 | =head2 Custom per-subroutine check hooks |
83 | ||
84 | XS code in an extension module can now annotate a subroutine (whether | |
85 | implemented in XS or in Perl) so that nominated XS code will be called | |
86 | at compile time (specifically as part of op checking) to change the op | |
87 | tree of that subroutine. The compile-time check function (supplied by | |
88 | the extension module) can implement argument processing that can't be | |
89 | expressed as a prototype, generate customised compile-time warnings, | |
90 | perform constant folding for a pure function, inline a subroutine | |
91 | consisting of sufficiently simple ops, replace the whole call with a | |
92 | custom op, and so on. This was previously all possible by hooking the | |
93 | C<entersub> op checker, but the new mechanism makes it easy to tie the | |
94 | hook to a specific subroutine. See L<perlapi/cv_set_call_checker>. | |
95 | ||
96 | To help in writing custom check hooks, several subtasks within standard | |
97 | C<entersub> op checking have been separated out and exposed in the API. | |
98 | ||
4f65bc30 FC |
99 | =head2 Return value of C<delete $+{...}> |
100 | ||
101 | Custom regular expression engines can now determine the return value of | |
102 | C<delete> on an entry of C<%+> or C<%->. | |
103 | ||
0eec0a4c ZA |
104 | =head2 C<keys>, C<values> work on arrays |
105 | ||
106 | You can now use the C<keys>, C<values>, C<each> builtin functions on arrays | |
107 | (previously you could only use them on hashes). See L<perlfunc> for details. | |
108 | This is actually a change introduced in perl 5.12.0, but it was missed from | |
109 | that release's perldelta. | |
110 | ||
4c793fe3 FR |
111 | =head1 Incompatible Changes |
112 | ||
fb85c044 KW |
113 | =head2 Stringification of regexes has changed |
114 | ||
115 | Default regular expression modifiers are now notated by using | |
116 | C<(?^...)>. Code relying on the old stringification will fail. The | |
117 | purpose of this is so that when new modifiers are added, such code will | |
8477b9ba KW |
118 | not have to change (after this one time), as the stringification will |
119 | automatically incorporate the new modifiers. | |
fb85c044 KW |
120 | |
121 | Code that needs to work properly with both old- and new-style regexes | |
e23837fb | 122 | can avoid the whole issue by using (for Perls since 5.9.5): |
8477b9ba KW |
123 | |
124 | use re qw(regexp_pattern); | |
125 | my ($pat, $mods) = regexp_pattern($re_ref); | |
126 | ||
127 | where C<$re_ref> is a reference to a compiled regular expression. Upon | |
128 | return, C<$mods> will be a string containing all the non-default | |
129 | modifiers used when the regular expression was compiled, and C<$pattern> | |
130 | the actual pattern. | |
131 | ||
e23837fb KW |
132 | If the actual stringification is important, or older Perls need to be |
133 | supported, you can use something like the following: | |
fb85c044 KW |
134 | |
135 | # Accept both old and new-style stringification | |
136 | my $modifiers = (qr/foobar/ =~ /\Q(?^/) ? '^' : '-xism'; | |
44428a46 | 137 | |
fb85c044 | 138 | And then use C<$modifiers> instead of C<-xism>. |
44428a46 | 139 | |
9de15fec KW |
140 | =head2 Regular expressions retain their localeness when interpolated |
141 | ||
142 | Regular expressions compiled under C<"use locale"> now retain this when | |
143 | interpolated into a new regular expression compiled outside a | |
144 | C<"use locale">, and vice-versa. | |
145 | ||
146 | Previously, a regular expression interpolated into another one inherited | |
147 | the localeness of the surrounding one, losing whatever state it | |
148 | originally had. This is considered a bug fix, but may trip up code that | |
149 | has come to rely on the incorrect behavior. | |
150 | ||
6904a83f FC |
151 | =head2 Directory handles not copied to threads |
152 | ||
153 | On systems that do not have a C<fchdir> function, newly-created threads no | |
154 | longer inherit directory handles from their parent threads. Such programs | |
155 | would probably have crashed anyway | |
156 | L<[perl #75154]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=75154>. | |
157 | ||
94824daa FC |
158 | =head2 Negation treats strings differently from before |
159 | ||
160 | The unary negation operator C<-> now treats strings that look like numbers | |
161 | as numbers | |
162 | L<[perl #57706]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=57706>. | |
163 | ||
afa74577 FC |
164 | =head2 Negative zero |
165 | ||
166 | Negative zero (-0.0), when converted to a string, now becomes "0" on all | |
167 | platforms. It used to become "-0" on some, but "0" on others. | |
168 | ||
169 | If you still need to determine whether a zero is negative, use | |
170 | C<sprintf("%g", $zero) =~ /^-/> or the L<Data::Float> module on CPAN. | |
171 | ||
4c793fe3 FR |
172 | =head1 Performance Enhancements |
173 | ||
ee0887a9 | 174 | =over 4 |
4c793fe3 | 175 | |
e2babdfb FR |
176 | =item * |
177 | ||
40eff326 FC |
178 | The bulk of the C<Tie::Hash::NamedCapture> module used to be in the perl |
179 | core. It has now been moved to an XS module, to reduce the overhead for | |
180 | programs that do not use C<%+> or C<%->. | |
e2babdfb | 181 | |
b141c43c FR |
182 | =item * |
183 | ||
184 | Eliminate C<PL_*> accessor functions under ithreads. | |
185 | ||
186 | When C<MULTIPLICITY> was first developed, and interpreter state moved into an | |
187 | interpreter struct, thread and interpreter local C<PL_*> variables were defined | |
188 | as macros that called accessor functions, returning the address of the value, | |
189 | outside of the perl core. The intent was to allow members within the interpreter | |
190 | struct to change size without breaking binary compatibility, so that bug fixes | |
191 | could be merged to a maintenance branch that necessitated such a size change. | |
192 | ||
193 | However, some non-core code defines C<PERL_CORE>, sometimes intentionally to | |
194 | bypass this mechanism for speed reasons, sometimes for other reasons but with | |
195 | the inadvertent side effect of bypassing this mechanism. As some of this code is | |
196 | widespread in production use, the result is that the core B<can't> change the | |
197 | size of members of the interpreter struct, as it will break such modules | |
198 | compiled against a previous release on that maintenance branch. The upshot is | |
199 | that this mechanism is redundant, and well-behaved code is penalised by | |
200 | it. Hence it can and should be removed. | |
201 | ||
4c793fe3 FR |
202 | =back |
203 | ||
204 | =head1 Modules and Pragmata | |
205 | ||
ee0887a9 | 206 | =head2 Updated Modules and Pragmata |
fc1418b7 | 207 | |
ee0887a9 | 208 | =over 4 |
fc1418b7 | 209 | |
ee0887a9 | 210 | =item * |
e2babdfb | 211 | |
a6696b92 CBW |
212 | C<Archive::Extract> has been upgraded from version 0.42 to 0.44 |
213 | ||
214 | =item * | |
215 | ||
75484d6b FC |
216 | C<Carp> has been upgraded from version 1.18 to 1.19. |
217 | ||
218 | It no longer autovivifies the C<*CORE::GLOBAL::caller> glob, something it | |
219 | started doing in 1.18, which was released with perl 5.13.4 | |
220 | L<[perl #78082]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=78082> | |
221 | ||
222 | =item * | |
223 | ||
daec2498 CBW |
224 | C<Compress::Raw::Bzip2> has been upgraded from version 2.030 to 2.031 |
225 | ||
226 | Updated to use bzip2 1.0.6 | |
227 | ||
228 | =item * | |
229 | ||
0f848f67 CBW |
230 | C<CPAN> has been upgraded from version 1.94_57 to 1.94_61 |
231 | ||
232 | =item * | |
233 | ||
e2941eb0 FC |
234 | C<Data::Dumper> has been upgraded from version 2.128 to 2.129. |
235 | ||
236 | C<Dumpxs> no longer crashes with globs returned by C<*$io_ref> | |
237 | L<[perl #72332]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=72332>. | |
238 | ||
239 | =item * | |
240 | ||
c059848d | 241 | C<Digest::MD5> has been upgraded from version 2.40 to 2.51. |
62d37bf0 FR |
242 | |
243 | It is now safe to use this module in combination with threads. | |
244 | ||
245 | =item * | |
246 | ||
f5b89942 FC |
247 | C<File::DosGlob> has been upgraded from version 1.02 to 1.03. |
248 | ||
249 | It allows patterns containing literal parentheses (they no longer need to | |
250 | be escaped). On Windows, it no longer adds an extra F<./> to the file names | |
251 | returned when the pattern is a relative glob with a drive specification, | |
6481ebaf FC |
252 | like F<c:*.pl> |
253 | L<[perl #71712]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=71712>. | |
f5b89942 FC |
254 | |
255 | =item * | |
256 | ||
4d1599c3 FC |
257 | C<File::Find> has been upgraded from version 1.17 to 1.18. |
258 | ||
259 | It improves handling of backslashes on Windows, so that paths such as | |
6481ebaf FC |
260 | F<c:\dir\/file> are no longer generated |
261 | L<[perl #71710]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=71710>. | |
4d1599c3 FC |
262 | |
263 | =item * | |
264 | ||
f1c82292 CBW |
265 | C<if> has been upgraded from version 0.05 to 0.06 |
266 | ||
267 | =item * | |
268 | ||
22737eb3 CBW |
269 | C<IPC::Cmd> has been upgraded from version 0.60 to 0.64 |
270 | ||
271 | =item * | |
272 | ||
25e68b8b FC |
273 | C<IPC::Open3> has been upgraded from version 1.06 to 1.07. |
274 | ||
275 | The internal C<xclose> routine now knows how to handle file descriptors, as | |
276 | documented, so duplicating STDIN in a child process using its file | |
277 | descriptor now works | |
278 | L<[perl #76474]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=71710>. | |
279 | ||
280 | =item * | |
281 | ||
eb32ee41 FC |
282 | C<Locale::Codes> has been upgraded from version 3.13 to 3.14. |
283 | ||
284 | =item * | |
285 | ||
9607a449 FC |
286 | C<Locale::Maketext> has been upgraded from version 1.15 to 1.16. |
287 | ||
288 | It fixes an infinite loop in C<Locale::Maketext::Guts::_compile()> when | |
289 | working with tainted values | |
290 | (L<CPAN RT #40727|https://rt.cpan.org/Public/Bug/Display.html?id=40727>). | |
291 | ||
edf72ff9 FC |
292 | C<< ->maketext >> calls will now backup and restore C<$@> so that error |
293 | messages are not supressed | |
294 | (L<CPAN RT #34182|https://rt.cpan.org/Public/Bug/Display.html?id=34182>). | |
295 | ||
9607a449 FC |
296 | =item * |
297 | ||
45029d2d FC |
298 | C<Math::BigInt> has been upgraded from version 1.95 to 1.97. |
299 | ||
300 | This prevents C<sqrt($int)> from crashing under C<use bigrat;> | |
301 | L<[perl #73534]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=73534>. | |
733e2929 FR |
302 | |
303 | =item * | |
304 | ||
de0e3ce7 FR |
305 | C<NEXT> has been upgraded from version 0.64 to 0.65. |
306 | ||
307 | =item * | |
308 | ||
56f08af2 FC |
309 | C<overload> has been upgraded from version 1.10 to 1.11. |
310 | ||
311 | C<overload::Method> can now handle subroutines that are themselves blessed | |
312 | into overloaded classes | |
313 | L<[perl #71998]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=71998>. | |
314 | ||
315 | =item * | |
316 | ||
f8a8dd49 | 317 | C<PathTools> has been upgraded from version 3.31_01 to 3.34. |
1c2dcb3e CBW |
318 | |
319 | =item * | |
320 | ||
463da0ac CBW |
321 | C<podlators> has been upgraded from version 2.3.1 to 2.4.0 |
322 | ||
323 | =item * | |
324 | ||
6481ebaf FC |
325 | C<sigtrap> has been upgraded from version 1.04 to 1.05. |
326 | ||
327 | It no longer tries to modify read-only arguments when generating a | |
328 | backtrace | |
329 | L<[perl #72340]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=72340>. | |
330 | ||
331 | =item * | |
332 | ||
97a3247a | 333 | C<threads> has been upgraded from version 1.77_03 to 1.81_01. |
ac4c9720 CBW |
334 | |
335 | =item * | |
336 | ||
337 | C<threads::shared> has been upgrade from version 1.33_03 to 1.34 | |
dfa4c013 JH |
338 | |
339 | =item * | |
340 | ||
aa7758f7 | 341 | C<Unicode::Collate> has been upgraded from version 0.59 to 0.63 |
c02ee425 | 342 | |
aa7758f7 CBW |
343 | U::C::Locale newly supports locales: ar, be, bg, de__phonebook, hu, hy, kk, mk, nso, om, |
344 | tn, vi, hr, ig, ru, sq, se, sr, to and uk | |
1393fe00 CBW |
345 | |
346 | =item * | |
347 | ||
1c2dcb3e | 348 | C<Unicode::Normalize> has been upgraded from version 1.06 to 1.07 |
c9a84c8b | 349 | |
918184d1 TM |
350 | =item * |
351 | ||
352 | C<B::Deparse> has been upgraded from version 0.98 to 0.99 | |
353 | ||
354 | B::Deparse now properly handles the code that applies a conditional | |
355 | pattern match against implicit C<$_> as it was fixed in | |
356 | L<[perl #20444]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=20444>. | |
357 | ||
dca41e57 TM |
358 | =item * |
359 | ||
360 | C<GDBM_File> has been upgraded from version 1.10 to 1.11 | |
361 | ||
ee0887a9 | 362 | =back |
c9a84c8b | 363 | |
4c793fe3 FR |
364 | =head1 Documentation |
365 | ||
ee0887a9 | 366 | =head2 Changes to Existing Documentation |
fc1418b7 | 367 | |
f53cc86a | 368 | =head3 L<perlapi> |
e2babdfb | 369 | |
7bc3efda SH |
370 | =over 4 |
371 | ||
372 | =item * | |
373 | ||
a7e93501 FC |
374 | The documentation for the C<SvTRUE> macro was simply wrong in stating that |
375 | get-magic is not processed. It has been corrected. | |
7bc3efda SH |
376 | |
377 | =back | |
e2babdfb | 378 | |
4c793fe3 FR |
379 | =head1 Diagnostics |
380 | ||
381 | The following additions or changes have been made to diagnostic output, | |
382 | including warnings and fatal error messages. For the complete list of | |
383 | diagnostic messages, see L<perldiag>. | |
384 | ||
ee0887a9 | 385 | =head2 Changes to Existing Diagnostics |
4c793fe3 | 386 | |
4c793fe3 FR |
387 | =over 4 |
388 | ||
389 | =item * | |
390 | ||
dc08898c FC |
391 | The 'Layer does not match this perl' error message has been replaced with |
392 | these more helpful messages: | |
393 | ||
394 | =over 4 | |
395 | ||
396 | =item * | |
397 | ||
398 | PerlIO layer function table size (%d) does not match size expected by this | |
399 | perl (%d) | |
400 | ||
401 | =item * | |
402 | ||
403 | PerlIO layer instance size (%d) does not match size expected by this perl | |
404 | (%d) | |
405 | ||
406 | =back | |
407 | ||
408 | L<[perl #73754]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=73754> | |
4c793fe3 FR |
409 | |
410 | =back | |
411 | ||
ee0887a9 | 412 | =head1 Testing |
0c692eed | 413 | |
ee0887a9 | 414 | =over 4 |
0c692eed FR |
415 | |
416 | =item * | |
417 | ||
bd6920d7 FC |
418 | The script F<t/op/threads-dirh.t> has been added, which tests interaction |
419 | of threads and directory handles. | |
4c793fe3 FR |
420 | |
421 | =back | |
422 | ||
ee0887a9 | 423 | =head1 Platform Support |
4c793fe3 | 424 | |
ee0887a9 | 425 | =head2 Platform-Specific Notes |
44428a46 | 426 | |
ee0887a9 | 427 | =over 4 |
f4beb78f | 428 | |
810f3b7c FC |
429 | =item IRIX |
430 | ||
431 | Conversion of strings to floating-point numbers is now more accurate on | |
432 | IRIX systems | |
433 | L<[perl #32380]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=32380>. | |
434 | ||
6034bceb FC |
435 | =item Mac OS X |
436 | ||
437 | Early versions of Mac OS X (Darwin) had buggy implementations of the | |
438 | C<setregid>, C<setreuid>, C<setrgid> and C<setruid> functions, so perl | |
439 | would pretend they did not exist. | |
440 | ||
441 | These functions are now recognised on Mac OS 10.5 (Leopard; Darwin 9) and | |
442 | higher, as they have been fixed | |
443 | L<[perl #72990]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=72990>. | |
444 | ||
810f3b7c FC |
445 | =item OpenVOS |
446 | ||
447 | perl now builds again with OpenVOS (formerly known as Stratus VOS) | |
448 | L<[perl #78132]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=78132>. | |
449 | ||
a9e68e41 CB |
450 | =item VMS |
451 | ||
452 | The shortening of symbols longer than 31 characters in the C sources is | |
453 | now done by the compiler rather than by xsubpp (which could only do so | |
454 | for generated symbols in XS code). | |
455 | ||
2ffefa5a | 456 | =item Windows |
ccb45ef4 | 457 | |
2ffefa5a FC |
458 | C<$Config{gccversion}> is now set correctly when perl is built using the |
459 | mingw64 compiler from L<http://mingw64.org> | |
460 | L<[perl #73754]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=73754>. | |
461 | ||
f8a8dd49 FC |
462 | The build process proceeds more smoothly with mingw and dmake when |
463 | F<C:\MSYS\bin> is in the PATH, due to a C<Cwd> fix. | |
464 | ||
2ffefa5a | 465 | =back |
ccb45ef4 | 466 | |
ee0887a9 | 467 | =head1 Internal Changes |
85318b69 | 468 | |
ee0887a9 | 469 | =over 4 |
80b6a949 | 470 | |
e2babdfb FR |
471 | =item * |
472 | ||
a5763045 FC |
473 | See L</Regular expressions retain their localeness when interpolated>, |
474 | above. | |
e2babdfb | 475 | |
a7e93501 FC |
476 | =item * |
477 | ||
478 | The C<sv_cmp_flags>, C<sv_cmp_locale_flags>, C<sv_eq_flags> and | |
479 | C<sv_collxfrm_flags> functions have been added. These are like their | |
480 | non-_flags counterparts, but allow one to specify whether get-magic is | |
481 | processed. | |
482 | ||
483 | The C<sv_cmp>, C<sv_cmp_locale>, C<sv_eq> and C<sv_collxfrm> functions have | |
484 | been replaced with wrappers around the new functions. | |
485 | ||
486 | =item * | |
487 | ||
488 | A new C<sv_2bool_flags> function has been added. | |
489 | ||
490 | This is like C<sv_2bool>, but it lets the calling code decide whether | |
491 | get-magic is handled. C<sv_2bool> is now a macro that calls the new | |
492 | function. | |
493 | ||
494 | =item * | |
495 | ||
496 | A new macro, C<SvTRUE_nomg>, has been added. | |
497 | ||
498 | This is like C<SvTRUE>, except that it does not process magic. It uses the | |
499 | new C<sv_2bool_flags> function. | |
500 | ||
501 | =item * | |
502 | ||
503 | C<sv_catsv_flags> no longer calls C<mg_get> on its second argument (the | |
504 | source string) if the flags passed to it do not include SV_GMAGIC. So it | |
07d5f7aa | 505 | now matches the documentation. |
a7e93501 | 506 | |
5e26bbbe Z |
507 | =item * |
508 | ||
509 | A new interface has been added for custom check hooks on subroutines. See | |
6b9ffeab | 510 | L</Custom per-subroutine check hooks>, above. |
5e26bbbe | 511 | |
a11a8547 Z |
512 | =item * |
513 | ||
514 | List op building functions have been added to the | |
515 | API. See L<op_append_elem|perlapi/op_append_elem>, | |
516 | L<op_append_list|perlapi/op_append_list>, and | |
517 | L<op_prepend_elem|perlapi/op_prepend_elem>. | |
518 | ||
519 | =item * | |
520 | ||
521 | The L<LINKLIST|perlapi/LINKLIST> macro, part of op building that | |
522 | constructs the execution-order op chain, has been added to the API. | |
523 | ||
eb32ee41 FC |
524 | =item * |
525 | ||
526 | Many functions ending with pvn now have equivalent pv/pvs/sv versions. | |
527 | ||
9ae8c3d9 FC |
528 | =item * |
529 | ||
647a6853 | 530 | The C<save_freeop>, C<save_op>, C<save_pushi32ptr> and C<save_pushptrptr> |
9ae8c3d9 FC |
531 | functions have been added to the API. |
532 | ||
533 | =item * | |
534 | ||
535 | The new API function C<parse_stmtseq()> parses a sequence of statements, up | |
536 | to closing brace or EOF. | |
537 | ||
ee0887a9 | 538 | =back |
e2babdfb | 539 | |
ee0887a9 | 540 | =head1 Selected Bug Fixes |
e2babdfb | 541 | |
ee0887a9 | 542 | =over 4 |
346e4e56 | 543 | |
78846812 FR |
544 | =item * |
545 | ||
4e9f151b FC |
546 | A regular expression match in the right-hand side of a global substitution |
547 | (C<s///g>) that is in the same scope will no longer cause match variables | |
548 | to have the wrong values on subsequent iterations. This can happen when an | |
e54f3f30 FC |
549 | array or hash subscript is interpolated in the right-hand side, as in |
550 | C<s|(.)|@a{ print($1), /./ }|g> | |
551 | L<[perl #19078]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=19078>. | |
552 | ||
553 | =item * | |
554 | ||
555 | Constant-folding used to cause | |
556 | ||
557 | $text =~ ( 1 ? /phoo/ : /bear/) | |
558 | ||
559 | to turn into | |
560 | ||
561 | $text =~ /phoo/ | |
562 | ||
563 | at compile time. Now it correctly matches against C<$_> | |
564 | L<[perl #20444]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=20444>. | |
78846812 | 565 | |
a5763045 FC |
566 | =item * |
567 | ||
568 | Parsing Perl code (either with string C<eval> or by loading modules) from | |
569 | within a C<UNITCHECK> block no longer causes the interpreter to crash | |
570 | L<[perl #70614]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=70614>. | |
571 | ||
5a9a79a4 FC |
572 | =item * |
573 | ||
574 | When C<-d> is used on the shebang (C<#!>) line, the debugger now has access | |
575 | to the lines of the main program. In the past, this sometimes worked and | |
576 | sometimes did not, depending on what order things happened to be arranged | |
b45e2413 FC |
577 | in memory |
578 | L<[perl #71806]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=71806>. | |
5a9a79a4 | 579 | |
a7e93501 FC |
580 | =item * |
581 | ||
582 | The C<y///> or C<tr///> operator now calls get-magic (e.g., the C<FETCH> | |
583 | method of a tie) on its left-hand side just once, not twice | |
584 | L<[perl #76814]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=76814>. | |
585 | ||
586 | =item * | |
587 | ||
588 | String comparison (C<eq>, C<ne>, C<lt>, C<gt>, C<le>, C<ge> and | |
589 | C<cmp>) and logical not (C<not> and C<!>) operators no longer call magic | |
590 | (e.g., tie methods) twice on their operands | |
591 | L<[perl #76814]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=76814>. | |
592 | ||
593 | This bug was introduced in an earlier 5.13 release, and does not affect | |
594 | perl 5.12. | |
595 | ||
596 | =item * | |
597 | ||
598 | When a tied (or other magic) variable is used as, or in, a regular | |
599 | expression, it no longer has its C<FETCH> method called twice | |
600 | L<[perl #76814]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=76814>. | |
601 | ||
602 | This bug was introduced in an earlier 5.13 release, and does not affect | |
603 | perl 5.12. | |
604 | ||
d4a59e54 FC |
605 | =item * |
606 | ||
8420a925 | 607 | The C<-C> command line option can now be followed by other options |
d4a59e54 FC |
608 | L<[perl #72434]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=72434>. |
609 | ||
dc08898c FC |
610 | =item * |
611 | ||
612 | Assigning a glob to a PVLV used to convert it to a plain string. Now it | |
613 | works correctly, and a PVLV can hold a glob. This would happen when a | |
614 | nonexistent hash or array element was passed to a subroutine: | |
615 | ||
616 | sub { $_[0] = *foo }->($hash{key}); | |
617 | # $_[0] would have been the string "*main::foo" | |
618 | ||
619 | It also happened when a glob was assigned to, or returned from, an element | |
620 | of a tied array or hash | |
621 | L<[perl #36051]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=36051>. | |
622 | ||
6904a83f FC |
623 | =item * |
624 | ||
625 | Creating a new thread when directory handles were open used to cause a | |
626 | crash, because the handles were not cloned, but simply passed to the new | |
627 | thread, resulting in a double free. | |
628 | ||
07d5f7aa | 629 | Now directory handles are cloned properly, on systems that have a C<fchdir> |
6904a83f FC |
630 | function. On other systems, new threads simply do not inherit directory |
631 | handles from their parent threads | |
632 | L<[perl #75154]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=75154>. | |
633 | ||
cffb3698 FC |
634 | =item * |
635 | ||
ab4c2c27 FC |
636 | The regular expression parser no longer hangs when parsing C<\18> and |
637 | C<\88>. | |
638 | ||
639 | This bug was introduced in version 5.13.5 and did not affect earlier | |
640 | versions | |
641 | L<[perl #78058]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78058>. | |
642 | ||
be1cc451 FC |
643 | =item * |
644 | ||
645 | Subroutine redefinition works once more in the debugger | |
646 | L<[perl #48332]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=48332>. | |
647 | ||
b20c4ee1 FC |
648 | =item * |
649 | ||
650 | The C<&> C<|> C<^> bitwise operators no longer coerce read-only arguments | |
651 | L<[perl #20661]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=20661>. | |
652 | ||
afa74577 FC |
653 | =item * |
654 | ||
655 | Stringifying a scalar containing -0.0 no longer has the affect of turning | |
656 | false into true | |
657 | L<[perl #45133]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=45133>. | |
658 | ||
c8bbf675 FC |
659 | =item * |
660 | ||
661 | Aliasing packages by assigning to globs or deleting packages by deleting | |
662 | their containing stash elements used to have erratic effects on method | |
663 | resolution, because the internal 'isa' caches were not reset. This has been | |
664 | fixed. | |
665 | ||
07d5f7aa FC |
666 | =item * |
667 | ||
668 | C<sort> with a custom sort routine could crash if too many nested | |
669 | subroutine calls occurrred from within the sort routine | |
670 | L<[perl #77930]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77930>. | |
671 | ||
672 | This bug was introduced in an earlier 5.13 release, and did not affect | |
673 | perl 5.12. | |
674 | ||
9ae8c3d9 FC |
675 | =item * |
676 | ||
677 | The C<eval_sv> and C<eval_pv> C functions now set C<$@> correctly when | |
678 | there is a syntax error and no C<G_KEEPERR> flag, and never set it if the | |
679 | C<G_KEEPERR> flag is present | |
680 | L<[perl #3719]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=3719>. | |
681 | ||
825563b9 FC |
682 | =item * |
683 | ||
684 | Nested C<map> and C<grep> blocks no longer leak memory when processing | |
685 | large lists | |
686 | L<[perl #48004]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=48004>. | |
687 | ||
688 | =item * | |
689 | ||
690 | Malformed C<version> objects no longer cause crashes | |
691 | L<[perl #78286]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78286>. | |
692 | ||
693 | =item * | |
694 | ||
695 | The interpreter no longer crashes when freeing deeply-nested arrays of | |
696 | arrays. Hashes have not been fixed yet | |
697 | L<[perl #44225]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=44225>. | |
698 | ||
020fe755 AB |
699 | =item * |
700 | ||
701 | The mechanism for freeing objects in globs used to leave dangling | |
702 | pointers to freed SVs, meaning Perl users could see corrupted state | |
703 | during destruction. | |
704 | ||
705 | Perl now only frees the affected slots of the GV, rather than freeing | |
706 | the GV itself. This makes sure that there are no dangling refs or | |
707 | corrupted state during destruction. | |
708 | ||
709 | =item * | |
710 | ||
557af69b DM |
711 | The typeglob C<*,>, which holds the scalar variable C<$,> (output field |
712 | separator), had the wrong reference count in child threads. | |
020fe755 | 713 | |
62ff64ce FC |
714 | =item * |
715 | ||
716 | C<splice> now calls set-magic. This means that, for instance, changes made | |
717 | by C<splice @ISA> are respected by method calls | |
718 | L<[perl #78400]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78400>. | |
719 | ||
720 | =item * | |
721 | ||
722 | C<use v5.8> no longer leaks memory | |
723 | L<[perl #78436]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78436>. | |
724 | ||
725 | =item * | |
726 | ||
727 | The XS multicall API no longer causes subroutines to lose reference counts | |
728 | if called via the multicall interface from within those very subroutines. | |
729 | This affects modules like List::Util. Calling one of its functions with an | |
730 | active subroutine as the first argument could cause a crash | |
731 | L<[perl #78070]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78070>. | |
732 | ||
4c793fe3 FR |
733 | =back |
734 | ||
405fd67e DG |
735 | =head1 Errata |
736 | ||
737 | =over 4 | |
738 | ||
739 | =item * | |
740 | ||
741 | Fixed a typo in L<perl5135delta> regarding array slices and smart matching | |
742 | ||
743 | =back | |
744 | ||
ee0887a9 | 745 | =head1 Acknowledgements |
0195fb5f | 746 | |
6304a40a TM |
747 | Perl 5.13.6 represents approximately one month of development since Perl |
748 | 5.13.5 and contains 67920 lines of changes across 566 files from 47 authors | |
749 | and committers: | |
750 | ||
751 | A. Sinan Unur, Aaron Crane, Alex Davies, Ali Polatel, Allen Smith, Andrew Rodland, | |
752 | Andy Dougherty, Ben Morrow, brian d foy, Casey West, Chip Salzenberg, Chris | |
753 | 'BinGOs' Williams, Craig A. Berry, David Golden, David Mitchell, Eric Brine, | |
754 | Father Chrysostomos, Florian Ragwitz, George Greer, gregor herrmann, Jan Dubois, | |
755 | Jerry D. Hedden, Jesse Vincent, Joshua Pritikin, Karl Williamson, kmx, Michael | |
756 | G Schwern, Mike Kelly, Nicholas Clark, Paul Green, Rafael Garcia-Suarez, Renee | |
757 | Baecker, Ricardo Signes, Sisyphus, Slaven Rezic, Steffen Müller, Steve Hay, | |
758 | Sullivan Beck, Tatsuhiko Miyagawa, Todd Rinaldo, Tony Cook, Tye McQueen, Vernon | |
759 | Lyon, Walt Mankowski, Zefram, Zsbán Ambrus, Ævar Arnfjörð Bjarmason. | |
760 | ||
761 | Many of the changes included in this version originated in the CPAN | |
762 | modules included in Perl's core. We're grateful to the entire CPAN | |
763 | community for helping Perl to flourish. | |
4c793fe3 FR |
764 | |
765 | =head1 Reporting Bugs | |
766 | ||
767 | If you find what you think is a bug, you might check the articles | |
768 | recently posted to the comp.lang.perl.misc newsgroup and the perl | |
769 | bug database at http://rt.perl.org/perlbug/ . There may also be | |
770 | information at http://www.perl.org/ , the Perl Home Page. | |
771 | ||
772 | If you believe you have an unreported bug, please run the B<perlbug> | |
773 | program included with your release. Be sure to trim your bug down | |
774 | to a tiny but sufficient test case. Your bug report, along with the | |
775 | output of C<perl -V>, will be sent off to perlbug@perl.org to be | |
776 | analysed by the Perl porting team. | |
777 | ||
778 | If the bug you are reporting has security implications, which make it | |
779 | inappropriate to send to a publicly archived mailing list, then please send | |
ee0887a9 | 780 | it to perl5-security-report@perl.org. This points to a closed subscription |
4c793fe3 FR |
781 | unarchived mailing list, which includes all the core committers, who be able |
782 | to help assess the impact of issues, figure out a resolution, and help | |
783 | co-ordinate the release of patches to mitigate or fix the problem across all | |
ee0887a9 | 784 | platforms on which Perl is supported. Please only use this address for |
4c793fe3 FR |
785 | security issues in the Perl core, not for modules independently |
786 | distributed on CPAN. | |
787 | ||
788 | =head1 SEE ALSO | |
789 | ||
790 | The F<Changes> file for an explanation of how to view exhaustive details | |
791 | on what changed. | |
792 | ||
793 | The F<INSTALL> file for how to build Perl. | |
794 | ||
795 | The F<README> file for general stuff. | |
796 | ||
797 | The F<Artistic> and F<Copying> files for copyright information. | |
798 | ||
799 | =cut |