Commit | Line | Data |
---|---|---|
44691e6f AB |
1 | =encoding utf8 |
2 | ||
3 | =head1 NAME | |
4 | ||
0aaeb177 | 5 | perldelta - what is new for perl v5.15.6 |
062678b2 | 6 | |
0aaeb177 | 7 | =head1 DESCRIPTION |
ad32999b | 8 | |
a29933a3 DR |
9 | This document describes differences between the 5.15.5 release and the |
10 | 5.15.6 release. | |
ad32999b | 11 | |
0aaeb177 SH |
12 | If you are upgrading from an earlier release such as 5.15.4, first read |
13 | L<perl5155delta>, which describes differences between 5.15.4 and | |
14 | 5.15.5. | |
ad32999b | 15 | |
0aaeb177 | 16 | =head1 Core Enhancements |
a3f52e2e | 17 | |
61f966e7 FC |
18 | =head2 C<__SUB__> |
19 | ||
a29933a3 DR |
20 | The new C<__SUB__> token, available under the "current_sub" feature |
21 | (see L<feature>) or C<use v5.15>, returns a reference to the current | |
22 | subroutine, making it easier to write recursive closures. | |
61f966e7 | 23 | |
d1fb015b FC |
24 | =head2 New option for the debugger's B<t> command |
25 | ||
a29933a3 | 26 | The B<t> command in the debugger, which toggles tracing mode, now |
be9a5e16 | 27 | accepts a numeric argument that determines how many levels of |
a29933a3 | 28 | subroutine calls to trace. |
d1fb015b | 29 | |
7e7629fa FC |
30 | =head2 Return value of C<tied> |
31 | ||
a29933a3 DR |
32 | The value returned by C<tied> on a tied variable is now the actual |
33 | scalar that holds the object to which the variable is tied. This | |
34 | allows ties to be weakened with C<Scalar::Util::weaken(tied | |
35 | $tied_variable)>. | |
7e7629fa | 36 | |
e3c71926 | 37 | =head1 Security |
6d110ad0 | 38 | |
6d91e957 KW |
39 | =head2 C<is_utf8_char()> |
40 | ||
be9a5e16 DR |
41 | The XS-callable function C<is_utf8_char()>, when presented with |
42 | malformed UTF-8 input, can read up to 12 bytes beyond the end of the | |
a29933a3 | 43 | string. This cannot be fixed without changing its API. It is not |
be9a5e16 | 44 | called from CPAN. The documentation now describes how to use it |
a29933a3 | 45 | safely. |
6d91e957 KW |
46 | |
47 | =head2 Other C<is_utf8_foo()> functions, as well as C<utf8_to_foo()>, etc. | |
48 | ||
49 | Most of the other XS-callable functions that take UTF-8 encoded input | |
50 | implicitly assume that the UTF-8 is valid (not malformed) in regards to | |
51 | buffer length. Do not do things such as change a character's case or | |
52 | see if it is alphanumeric without first being sure that it is valid | |
53 | UTF-8. This can be safely done for a whole string by using one of the | |
54 | functions C<is_utf8_string()>, C<is_utf8_string_loc()>, and | |
55 | C<is_utf8_string_loclen()>. | |
6d110ad0 | 56 | |
7f28d7ed DR |
57 | =head2 C<use I<VERSION>> |
58 | ||
a29933a3 DR |
59 | As of this release, version declarations like C<use v5.16> now disable |
60 | all features before enabling the new feature bundle. This means that | |
61 | the following holds true: | |
7f28d7ed DR |
62 | |
63 | use 5.016; | |
64 | # 5.16 features enabled here | |
65 | use 5.014; | |
66 | # 5.16 features disabled here | |
67 | ||
a29933a3 DR |
68 | C<use v5.12> and higher continue to enable strict, but explicit C<use |
69 | strict> and C<no strict> now override the version declaration, even | |
7f28d7ed DR |
70 | when they come first: |
71 | ||
72 | no strict; | |
73 | use 5.012; | |
74 | # no strict here | |
75 | ||
be9a5e16 | 76 | There is a new ":default" feature bundle that represents the set of |
a29933a3 DR |
77 | features enabled before any version declaration or C<use feature> has |
78 | been seen. Version declarations below 5.10 now enable the ":default" | |
79 | feature set. This does not actually change the behaviour of C<use | |
80 | v5.8>, because features added to the ":default" set are those that were | |
81 | traditionally enabled by default, before they could be turned off. | |
7f28d7ed DR |
82 | |
83 | C<$[> is now disabled under C<use v5.16>. It is part of the default | |
a29933a3 DR |
84 | feature set and can be turned on or off explicitly with C<use feature |
85 | 'array_base'>. | |
7f28d7ed DR |
86 | |
87 | =head2 C<UNIVERSAL::VERSION> | |
88 | ||
a29933a3 DR |
89 | The change to C<UNIVERSAL::VERSION> in 5.15.2 has been reverted. It |
90 | now returns a stringified version object once more. | |
7f28d7ed | 91 | |
66008486 FC |
92 | =head2 C<substr> lvalue revamp |
93 | ||
a29933a3 DR |
94 | When C<substr> is called in lvalue or potential lvalue context with two |
95 | or three arguments, a special lvalue scalar is returned that modifies | |
96 | the original string (the first argument) when assigned to. | |
66008486 FC |
97 | |
98 | Previously, the offsets (the second and third arguments) passed to | |
99 | C<substr> would be converted immediately to match the string, negative | |
100 | offsets being translated to positive and offsets beyond the end of the | |
101 | string being truncated. | |
102 | ||
a29933a3 DR |
103 | Now, the offsets are recorded without modification in the special |
104 | lvalue scalar that is returned, and the original string is not even | |
105 | looked at by C<substr> itself, but only when the returned lvalue is | |
106 | read or modified. | |
66008486 FC |
107 | |
108 | These changes result in several incompatible changes and bug fixes: | |
109 | ||
110 | =over | |
111 | ||
112 | =item * | |
113 | ||
114 | If the original string changes length after the call to C<substr> but | |
115 | before assignment to its return value, negative offsets will remember | |
116 | their position from the end of the string, affecting code like this: | |
117 | ||
118 | my $string = "string"; | |
119 | my $lvalue = \substr $string, -4, 2; | |
120 | print $lvalue, "\n"; # prints "ri" | |
121 | $string = "bailing twine"; | |
122 | print $lvalue, "\n"; # prints "wi"; used to print "il" | |
123 | ||
a29933a3 DR |
124 | The same thing happens with an omitted third argument. The returned |
125 | lvalue will always extend to the end of the string, even if the string | |
126 | becomes longer. | |
66008486 FC |
127 | |
128 | =item * | |
129 | ||
130 | Tied (and otherwise magical) variables are no longer exempt from the | |
be9a5e16 | 131 | "Attempt to use reference as lvalue in substr" warning. |
66008486 FC |
132 | |
133 | =item * | |
134 | ||
a29933a3 DR |
135 | That warning now occurs when the returned lvalue is assigned to, not |
136 | when C<substr> itself is called. This only makes a difference if the | |
137 | return value of C<substr> is referenced and assigned to later. | |
66008486 FC |
138 | |
139 | =item * | |
140 | ||
141 | The order in which "uninitialized" warnings occur for arguments to | |
142 | C<substr> has changed. | |
143 | ||
144 | =item * | |
145 | ||
a29933a3 DR |
146 | Passing a substring of a read-only value or a typeglob to a function |
147 | (potential lvalue context) no longer causes an immediate "Can't coerce" | |
148 | or "Modification of a read-only value" error. That error only occurs | |
149 | if and when the value passed is assigned to. | |
66008486 | 150 | |
a29933a3 DR |
151 | The same thing happens with the "substr outside of string" error. If |
152 | the lvalue is only read, not written to, it is now just a warning, as | |
153 | with rvalue C<substr>. | |
66008486 FC |
154 | |
155 | =item * | |
156 | ||
a29933a3 | 157 | C<substr> assignments no longer call FETCH twice if the first argument |
be9a5e16 | 158 | is a tied variable, just once. |
66008486 FC |
159 | |
160 | =back | |
161 | ||
a29933a3 DR |
162 | It was impossible to fix all the bugs without an incompatible change, |
163 | and the behaviour of negative offsets was never specified, so the | |
164 | change was deemed acceptable. | |
66008486 | 165 | |
d6b99bf4 FC |
166 | =head2 Return value of C<eval> |
167 | ||
a29933a3 | 168 | C<eval> returns C<undef> in scalar context or an empty list in list |
be9a5e16 DR |
169 | context when there is a run-time error. When C<eval> was passed a |
170 | string in list context and a syntax error occurred, it used to return a | |
171 | list containing a single undefined element. Now it returns an empty | |
172 | list in list context for all errors [perl #80630]. | |
d6b99bf4 | 173 | |
7f28d7ed DR |
174 | =head2 Anonymous handles |
175 | ||
176 | Automatically generated file handles are now named __ANONIO__ when the | |
177 | variable name cannot be determined, rather than $__ANONIO__. | |
178 | ||
84b2a83e FC |
179 | =head2 Last-accessed filehandle |
180 | ||
181 | Perl has an internal variable that stores the last filehandle to be | |
a29933a3 DR |
182 | accessed. It is used by C<$.> and by C<tell> and C<eof> without |
183 | arguments. | |
84b2a83e | 184 | |
be9a5e16 DR |
185 | It used to be possible to set this internal variable to a glob copy and |
186 | then modify that glob copy to be something other than a glob, and still | |
187 | have the last-accessed filehandle associated with the variable after | |
188 | assigning a glob to it again: | |
84b2a83e FC |
189 | |
190 | my $foo = *STDOUT; # $foo is a glob copy | |
191 | <$foo>; # $foo is now the last-accessed handle | |
192 | $foo = 3; # no longer a glob | |
193 | $foo = *STDERR; # still the last-accessed handle | |
194 | ||
be9a5e16 | 195 | Now the C<$foo = 3> assignment unsets that internal variable, so there |
a29933a3 DR |
196 | is no last-accessed filehandle, just as if C<< <$foo> >> had never |
197 | happened. | |
84b2a83e | 198 | |
541cb22c FC |
199 | =head2 XS API tweak |
200 | ||
201 | The C<newCONSTSUB_flags> C-level function, added in 5.15.4, now has a | |
202 | C<len> parameter. | |
203 | ||
e3c71926 | 204 | =head1 Performance Enhancements |
6d110ad0 | 205 | |
e3c71926 | 206 | =over 4 |
6d110ad0 FC |
207 | |
208 | =item * | |
209 | ||
a29933a3 | 210 | Perl 5.12.0 sped up the destruction of objects whose classes define |
be9a5e16 | 211 | empty C<DESTROY> methods (to prevent autoloading), by simply not |
a29933a3 DR |
212 | calling such empty methods. This release takes this optimisation a |
213 | step further, by not calling any C<DESTROY> method that begins with a | |
be9a5e16 | 214 | C<return> statement. This can be useful for destructors that are only |
a29933a3 | 215 | used for debugging: |
679b54e7 FC |
216 | |
217 | use constant DEBUG => 1; | |
218 | sub DESTROY { return unless DEBUG; ... } | |
219 | ||
a29933a3 DR |
220 | Constant-folding will reduce the first statement to C<return;> if DEBUG |
221 | is set to 0, triggering this optimisation. | |
6d110ad0 | 222 | |
d1fb015b FC |
223 | =item * |
224 | ||
be9a5e16 DR |
225 | Assigning to a variable that holds a typeglob or copy-on-write scalar |
226 | is now much faster. Previously the typeglob would be stringified or | |
227 | the copy-on-write scalar would be copied before being clobbered. | |
d1fb015b | 228 | |
7e7629fa FC |
229 | =item * |
230 | ||
84b2a83e | 231 | Assignment to C<substr> in void context is now more than twice its |
a29933a3 DR |
232 | previous speed. Instead of creating and returning a special lvalue |
233 | scalar that is then assigned to, C<substr> modifies the original string | |
234 | itself. | |
7e7629fa | 235 | |
e3c71926 | 236 | =back |
6d110ad0 | 237 | |
e3c71926 | 238 | =head1 Modules and Pragmata |
6d110ad0 | 239 | |
e3c71926 | 240 | =head2 Updated Modules and Pragmata |
6d110ad0 | 241 | |
e3c71926 | 242 | =over 4 |
6d110ad0 FC |
243 | |
244 | =item * | |
245 | ||
f8c9502f CBW |
246 | L<Archive::Tar> has been upgraded from version 1.80 to version 1.82. |
247 | ||
a29933a3 DR |
248 | Adjustments to handle files >8gb (>0777777777777 octal) and a feature |
249 | to return the MD5SUM of files in the archive. | |
a3f52e2e | 250 | |
87b9431e CBW |
251 | =item * |
252 | ||
74c26f06 CBW |
253 | L<AutoLoader> has been upgraded from version 5.71 to version 5.72. |
254 | ||
255 | =item * | |
256 | ||
8cea0f87 CBW |
257 | L<B::Debug> has been upgraded from version 1.16 to version 1.17. |
258 | ||
259 | =item * | |
260 | ||
be4a9ab3 | 261 | L<B::Deparse> has been upgraded from version 1.09 to version 1.10. |
679b54e7 | 262 | |
a29933a3 DR |
263 | Various constructs that used to be deparsed incorrectly have been |
264 | fixed: | |
7f28d7ed DR |
265 | |
266 | =over | |
267 | ||
268 | =item C<sort(foo(bar))> | |
269 | ||
be9a5e16 DR |
270 | It used to deparse as C<sort foo(bar)>, which makes foo the sort |
271 | routine, rather than a regular function call. | |
7f28d7ed DR |
272 | |
273 | =item Keys and values in C<%^H> | |
274 | ||
275 | Undefined values in the hint hash were being deparsed as empty strings. | |
276 | Whenever the hint hash changed, all undefined values, even those | |
277 | unmodified, were being printed. | |
278 | ||
279 | Special characters, such as quotation marks, were not being escaped | |
280 | properly. | |
281 | ||
a29933a3 DR |
282 | Some values used to be omitted if, for instance, a key was the same as |
283 | a previous value and vice versa. | |
7f28d7ed DR |
284 | |
285 | =item "method BLOCK" syntax | |
286 | ||
a29933a3 DR |
287 | C<method { $expr }> used to be deparsed as something like C<< do{ $expr |
288 | }->method >>, but the latter puts the $expr in scalar context, whereas | |
289 | the former puts in list context. | |
7f28d7ed DR |
290 | |
291 | =item C<do +{}> and C<do({})> | |
292 | ||
293 | These are both variants of do-file syntax, but were being deparsed as | |
294 | do-blocks. | |
295 | ||
be9a5e16 | 296 | =item Keywords that do not follow the llaf rule |
7f28d7ed DR |
297 | |
298 | Keywords like C<return> and C<last> that do not follow the | |
a29933a3 DR |
299 | looks-like-a-function rule are now deparsed correctly with parentheses |
300 | in the right place. | |
7f28d7ed | 301 | |
be9a5e16 DR |
302 | Similarly, C<not>, which I<does> follow the llaf rule, was being |
303 | deparsed as though it does not. | |
7f28d7ed DR |
304 | |
305 | =item C<=~> | |
306 | ||
a29933a3 DR |
307 | In various cases, B::Deparse started adding a spurious C<$_ =~> before |
308 | the right-hand side in Perl 5.14; e.g., C<< "" =~ <$a> >> would become | |
7f28d7ed DR |
309 | C<< "" =~ ($_ =~ <$a>) >>. |
310 | ||
311 | =item C<open local *FH> | |
312 | ||
a29933a3 DR |
313 | C<open>, C<pipe> and other functions that autovivify handles used to |
314 | omit C<local *> from C<local *FH>. | |
7f28d7ed DR |
315 | |
316 | =item Negated single-letter subroutine calls | |
317 | ||
a29933a3 DR |
318 | Negated subroutine calls like C<- f()> and C<-(f())> were being |
319 | deparsed as file test operators. | |
7f28d7ed DR |
320 | |
321 | =item C<&{&}> | |
322 | ||
a29933a3 DR |
323 | C<&{&}> and C<& &>, which are calls to the subroutine named "&", |
324 | believe it or not, were being deparsed as C<&&>. | |
7f28d7ed | 325 | |
7f41f337 FC |
326 | =item C<require $this + $that> |
327 | ||
a29933a3 DR |
328 | In Perl 5.14, C<require> followed by any binary operator started |
329 | deparsing as C<no>. | |
7f41f337 | 330 | |
7f28d7ed | 331 | =back |
679b54e7 FC |
332 | |
333 | =item * | |
334 | ||
5dd80d85 FC |
335 | L<Carp> has been upgraded from version 1.23 to version 1.24. |
336 | ||
a29933a3 DR |
337 | It now tacks the last-accessed filehandle and line number on to the end |
338 | of the error message, just like C<die> [perl #96672]. | |
5dd80d85 FC |
339 | |
340 | =item * | |
341 | ||
a29933a3 DR |
342 | L<Compress::Raw::Zlib> has been upgraded from version 2.042 to version |
343 | 2.045. | |
87b9431e | 344 | |
7e700369 CBW |
345 | =item * |
346 | ||
a29933a3 DR |
347 | L<Compress::Raw::Bzip2> has been upgraded from version 2.042 to version |
348 | 2.045. | |
7e700369 | 349 | |
dc7edc5c CBW |
350 | =item * |
351 | ||
a29933a3 DR |
352 | L<CPAN::Meta::YAML> has been upgraded from version 0.004 to version |
353 | 0.005. | |
1d8dd5fc CBW |
354 | |
355 | =item * | |
356 | ||
db3e41d4 | 357 | L<CPANPLUS> has been upgraded from version 0.9112 to version 0.9114. |
9e87a279 CBW |
358 | |
359 | =item * | |
360 | ||
be4a9ab3 | 361 | L<Data::Dumper> has been upgraded from version 2.134 to version 2.135. |
61f966e7 | 362 | |
a29933a3 DR |
363 | The XS implementation has been updated to account for the Unicode |
364 | symbol changes in Perl 5.15.4. It also knows how to output typeglobs | |
365 | with nulls in their names. | |
61f966e7 FC |
366 | |
367 | =item * | |
368 | ||
ecf16f8c FC |
369 | L<diagnostics> has been upgraded from version 1.25 to version 1.26. |
370 | ||
a29933a3 DR |
371 | It now understands the "%X" format code, which some error messages |
372 | started using in Perl 5.14.0. | |
ecf16f8c FC |
373 | |
374 | =item * | |
375 | ||
e39652ea CBW |
376 | L<Digest::SHA> has been upgraded from version 5.63 to version 5.70. |
377 | ||
be9a5e16 DR |
378 | Added BITS mode to the addfile method and shasum. This makes |
379 | partial-byte inputs possible via files/STDIN and allows shasum to check | |
380 | all 8074 NIST Msg vectors, where previously special programming was | |
381 | required to do this. | |
e39652ea CBW |
382 | |
383 | =item * | |
384 | ||
7f28d7ed DR |
385 | L<Exporter> has been upgraded from version 5.65 to version 5.66. |
386 | ||
387 | It no longer tries to localise C<$_> unnecessarily. | |
388 | ||
389 | =item * | |
390 | ||
a29933a3 DR |
391 | L<ExtUtils::ParseXS> has been upgraded from version 3.05 to version |
392 | 3.07. | |
ac616993 CBW |
393 | |
394 | =item * | |
395 | ||
a29933a3 DR |
396 | L<IO::Compress::Base> has been upgraded from version 2.042 to version |
397 | 2.046. | |
08ad9465 CBW |
398 | |
399 | Added zipdetails utility. | |
dc7edc5c | 400 | |
7788a270 CBW |
401 | =item * |
402 | ||
4345d05b CBW |
403 | L<Locale::Codes> has been upgraded from version 3.18 to version 3.20. |
404 | ||
a29933a3 | 405 | The code2XXX, XXX2code, all_XXX_codes, and all_XXX_names functions now |
be9a5e16 DR |
406 | support retired codes. All codesets may be specified by a constant or |
407 | by their name now. Previously, they were specified only by a constant. | |
408 | ||
409 | The alias_code function exists for backward compatibility. It has been | |
410 | replaced by rename_country_code. The alias_code function will be | |
411 | removed some time after September, 2013. | |
412 | ||
413 | All work is now done in the central module (Locale::Codes). | |
414 | Previously, some was still done in the wrapper modules | |
415 | (Locale::Codes::*). Added Language Family codes (langfam) as defined | |
416 | in ISO 639-5. | |
4345d05b CBW |
417 | |
418 | =item * | |
419 | ||
3c7c5233 DR |
420 | L<Module::CoreList> has been upgraded from version 2.58 to version |
421 | 2.59. | |
422 | ||
423 | =item * | |
424 | ||
be9a5e16 | 425 | L<Module::Loaded> has been upgraded from version 0.06 to version 0.08. |
b42ff875 CBW |
426 | |
427 | =item * | |
428 | ||
a71d67b1 CBW |
429 | L<Pod::LaTeX> has been upgraded from version 0.59 to version 0.60. |
430 | ||
431 | Added another LaTeX escape: --- => -{}-{}- | |
432 | ||
433 | Pod::LaTeX doesn't handle -- in PODs specially, passing it directly to | |
be9a5e16 | 434 | LaTeX, which then proceeds to replace it with a single -. This patch |
a71d67b1 CBW |
435 | replaces ----- with -{}-{}-{}-{}- |
436 | ||
437 | =item * | |
438 | ||
be4a9ab3 | 439 | L<POSIX> has been upgraded from version 1.26 to version 1.27. |
7e7629fa | 440 | |
a29933a3 DR |
441 | It no longer produces a "Constant subroutine TCSANOW redefined" warning |
442 | on Windows. | |
7e7629fa | 443 | |
ae241e63 | 444 | This bug was introduced in Perl 5.15.3. |
7e7629fa FC |
445 | |
446 | =item * | |
447 | ||
37b1de1b | 448 | L<Socket> has been upgraded from version 1.94_02 to version 1.97. |
c2654555 CBW |
449 | |
450 | =item * | |
451 | ||
85ca3be7 CBW |
452 | L<threads> has been upgraded from version 1.85 to version 1.86. |
453 | ||
454 | =item * | |
455 | ||
a29933a3 DR |
456 | L<Unicode::Collate> has been upgraded from version 0.85 to version |
457 | 0.87. | |
7788a270 | 458 | |
a29933a3 DR |
459 | Tailored compatibility ideographs as well as unified ideographs for the |
460 | locales: ja, ko, zh__big5han, zh__gb2312han, zh__pinyin, zh__stroke. | |
7788a270 | 461 | |
be9a5e16 | 462 | Locale/*.pl files are now searched for in @INC. |
65ae8d99 | 463 | |
a3e88ad7 JP |
464 | =item * |
465 | ||
be4a9ab3 | 466 | L<UNIVERSAL> has been upgraded from version 1.10 to version 1.11. |
a3e88ad7 JP |
467 | |
468 | Documentation change clarifies return values from UNIVERSAL::VERSION. | |
469 | ||
0aaeb177 | 470 | =back |
6138a722 | 471 | |
0aaeb177 | 472 | =head2 Removed Modules and Pragmata |
6138a722 | 473 | |
0aaeb177 | 474 | =over 4 |
be539103 | 475 | |
a47fb3fe CBW |
476 | =item * |
477 | ||
7f28d7ed DR |
478 | Changing the case of a UTF-8 encoded string under C<use locale> now |
479 | gives better, but still imperfect, results. Previously, such a string | |
a29933a3 | 480 | would entirely lose locale semantics and silently be treated as |
be9a5e16 | 481 | Unicode. Now, the code points that are less than 256 are treated with |
a29933a3 DR |
482 | locale rules, while those above 255 are, of course, treated as Unicode. |
483 | See L<perlfunc/lc> for more details, including the deficiencies of | |
484 | this scheme. | |
a3f52e2e | 485 | |
0aaeb177 | 486 | =back |
a3f52e2e | 487 | |
0aaeb177 | 488 | =head1 Documentation |
a3f52e2e | 489 | |
0aaeb177 | 490 | =head2 Changes to Existing Documentation |
6138a722 | 491 | |
7687d286 | 492 | =head3 L<perlsec/Laundering and Detecting Tainted Data> |
a47fb3fe | 493 | |
0aaeb177 | 494 | =over 4 |
7ef25837 | 495 | |
6d110ad0 FC |
496 | =item * |
497 | ||
7687d286 KW |
498 | The example function for checking for taintedness contained a subtle |
499 | error. C<$@> needs to be localized to prevent its changing this | |
500 | global's value outside the function. The preferred method to check for | |
be9a5e16 | 501 | this remains L<Scalar::Util/tainted>. |
6d110ad0 FC |
502 | |
503 | =back | |
504 | ||
e3c71926 FR |
505 | =head1 Diagnostics |
506 | ||
0aaeb177 SH |
507 | =head2 Changes to Existing Diagnostics |
508 | ||
e3c71926 | 509 | =over 4 |
bd65daab | 510 | |
3f2cb5bf S |
511 | =item * |
512 | ||
a29933a3 DR |
513 | Redefinition warnings for constant subroutines used to be mandatory, |
514 | even occurring under C<no warnings>. Now they respect the L<warnings> | |
515 | pragma. | |
b420b12a | 516 | |
61f966e7 FC |
517 | =item * |
518 | ||
a29933a3 DR |
519 | The "Attempt to free non-existent shared string" has had the spelling |
520 | of "non-existent" corrected to "nonexistent". It was already listed | |
521 | with the correct spelling in L<perldiag>. | |
61f966e7 | 522 | |
66008486 FC |
523 | =item * |
524 | ||
525 | The 'Use of "foo" without parentheses is ambiguous' warning has been | |
a29933a3 DR |
526 | extended to apply also to user-defined subroutines with a (;$) |
527 | prototype, and not just to built-in functions. | |
66008486 | 528 | |
5dd80d85 FC |
529 | =item * |
530 | ||
531 | The error messages for using C<default> and C<when> outside of a | |
a29933a3 DR |
532 | topicalizer have been standardised to match the messages for |
533 | C<continue> and loop controls. They now read 'Can't "default" outside | |
534 | a topicalizer' and 'Can't "when" outside a topicalizer'. They both | |
535 | used to be 'Can't use when() outside a topicalizer' [perl #91514]. | |
5dd80d85 | 536 | |
3432e5a1 | 537 | =back |
b420b12a | 538 | |
0aaeb177 | 539 | =head1 Utility Changes |
9cfd094e | 540 | |
08ad9465 | 541 | =head3 L<zipdetails> |
d6cf2367 | 542 | |
e3c71926 | 543 | =over 4 |
b53e16ae FC |
544 | |
545 | =item * | |
546 | ||
a29933a3 | 547 | L<zipdetails> displays information about the internal record structure |
be9a5e16 DR |
548 | of the zip file. It is not concerned with displaying any details of |
549 | the compressed data stored in the zip file. | |
b53e16ae | 550 | |
3432e5a1 | 551 | =back |
60092ce4 | 552 | |
0aaeb177 SH |
553 | =head1 Configuration and Compilation |
554 | ||
e3c71926 | 555 | =over 4 |
b53e16ae FC |
556 | |
557 | =item * | |
558 | ||
bb79e02f | 559 | F<pod/roffitall> is now built by F<pod/buildtoc>, instead of being |
be9a5e16 DR |
560 | shipped with the distribution. Its list of manpages is now generated |
561 | (and therefore current). See also RT #103202 for an unresolved related | |
a29933a3 | 562 | issue. |
a3f52e2e | 563 | |
61f966e7 FC |
564 | =item * |
565 | ||
566 | Perl 5.15.5 had a bug in its installation script, which did not install | |
567 | F<unicore/Name.pm>. This has been corrected [perl #104226]. | |
568 | ||
f4912a50 DR |
569 | =item * |
570 | ||
be9a5e16 | 571 | The man page for C<XS::Typemap> is no longer installed. C<XS::Typemap> |
a29933a3 DR |
572 | is a test module which is not installed, hence installing its |
573 | documentation makes no sense. | |
ba91b4f3 NC |
574 | |
575 | =for 5.16.0 Merge this with the entry for "Stop installing XS::APItest*" | |
576 | ||
577 | =item * | |
578 | ||
a29933a3 DR |
579 | The man pages for the perl FAQ, L<perlxs>, L<perlxstut> and L<perldoc> |
580 | are once again correctly installed in F<man1>, not F<man3> | |
ba91b4f3 NC |
581 | |
582 | =for 5.16.0 This isn't a regression from 5.14.x, so don't mention this. | |
583 | ||
584 | =item * | |
585 | ||
a29933a3 DR |
586 | The -Dusesitecustomize and -Duserelocatableinc options now work |
587 | together properly. | |
f4912a50 | 588 | |
0aaeb177 | 589 | =back |
a3f52e2e | 590 | |
0aaeb177 | 591 | =head1 Testing |
a3f52e2e | 592 | |
0aaeb177 | 593 | =over 4 |
a3f52e2e FC |
594 | |
595 | =item * | |
596 | ||
a29933a3 DR |
597 | The F<substr.t> and F<substr_thr.t> scripts for testing C<substr> have |
598 | been moved under F<t/op/>, where they were originally. They had been | |
599 | moved under F<t/re/> along with the substitution tests when that | |
600 | directory was created. | |
a3f52e2e | 601 | |
0aaeb177 | 602 | =back |
a3f52e2e | 603 | |
0aaeb177 | 604 | =head1 Platform Support |
a3f52e2e | 605 | |
0aaeb177 | 606 | =head2 Platform-Specific Notes |
ad32999b | 607 | |
f4912a50 DR |
608 | =head3 VMS |
609 | ||
0aaeb177 | 610 | =over 4 |
ad32999b | 611 | |
f4912a50 | 612 | =item * |
ad32999b | 613 | |
a3ef9f5c CB |
614 | A link-time error on VMS versions without C<symlink> support was |
615 | introduced in 5.15.1, but has now been corrected. | |
f4912a50 DR |
616 | |
617 | =item * | |
618 | ||
a29933a3 DR |
619 | Explicit support for VMS versions prior to v7.0 and DEC C versions |
620 | prior to v6.0 has been removed. | |
a3ef9f5c CB |
621 | |
622 | =item * | |
623 | ||
624 | Since Perl 5.10.1, the home-grown C<stat> wrapper has been unable to | |
625 | distinguish between a directory name containing an underscore and an | |
626 | otherwise-identical filename containing a dot in the same position | |
be9a5e16 | 627 | (e.g., t/test_pl as a directory and t/test.pl as a file). This problem |
a3ef9f5c | 628 | has been corrected. |
c15f899f | 629 | |
7f28d7ed | 630 | =back |
ad32999b | 631 | |
0aaeb177 | 632 | =head1 Selected Bug Fixes |
9c7c1651 | 633 | |
0aaeb177 | 634 | =over 4 |
fce59cd4 | 635 | |
b9e83cd1 FC |
636 | =item * |
637 | ||
7402016d AB |
638 | RT #78266: The regex engine has been leaking memory when accessing |
639 | named captures that weren't matched as part of a regex ever since 5.10 | |
a29933a3 DR |
640 | when they were introduced, e.g. this would consume over a hundred MB of |
641 | memory: | |
7402016d | 642 | |
e46b6a32 | 643 | for (1..10_000_000) { |
be9a5e16 DR |
644 | if ("foo" =~ /(foo|(?<capture>bar))?/) { |
645 | my $capture = $+{capture} | |
646 | } | |
e46b6a32 FC |
647 | } |
648 | system "ps -o rss $$"' | |
7402016d AB |
649 | |
650 | =item * | |
651 | ||
a29933a3 DR |
652 | A constant subroutine assigned to a glob whose name contains a null |
653 | will no longer cause extra globs to pop into existence when the | |
654 | constant is referenced under its new name. | |
b9e83cd1 | 655 | |
679b54e7 FC |
656 | =item * |
657 | ||
a29933a3 DR |
658 | C<sort> was not treating C<sub {}> and C<sub {()}> as equivalent when |
659 | such a sub was provided as the comparison routine. It used to croak on | |
679b54e7 FC |
660 | C<sub {()}>. |
661 | ||
662 | =item * | |
663 | ||
664 | Subroutines from the C<autouse> namespace are once more exempt from | |
a29933a3 DR |
665 | redefinition warnings. This used to work in 5.005, but was broken in |
666 | 5.6 for most subroutines. For subs created via XS that redefine | |
667 | subroutines from the C<autouse> package, this stopped working in 5.10. | |
679b54e7 FC |
668 | |
669 | =item * | |
670 | ||
671 | New XSUBs now produce redefinition warnings if they overwrite existing | |
a29933a3 | 672 | subs, as they did in 5.8.x. (The C<autouse> logic was reversed in |
be9a5e16 DR |
673 | 5.10-14. Only subroutines from the C<autouse> namespace would warn |
674 | when clobbered.) | |
679b54e7 FC |
675 | |
676 | =item * | |
677 | ||
678 | Redefinition warnings triggered by the creation of XSUBs now respect | |
a29933a3 DR |
679 | Unicode glob names, instead of using the internal representation. This |
680 | was missed in 5.15.4, partly because this warning was so hard to | |
681 | trigger. (See the previous item.) | |
679b54e7 FC |
682 | |
683 | =item * | |
684 | ||
a29933a3 DR |
685 | C<newCONSTSUB> used to use compile-time warning hints, instead of |
686 | run-time hints. The following code should never produce a redefinition | |
be9a5e16 | 687 | warning, but it used to, if C<newCONSTSUB> redefined an existing |
a29933a3 | 688 | subroutine: |
679b54e7 FC |
689 | |
690 | use warnings; | |
691 | BEGIN { | |
be9a5e16 DR |
692 | no warnings; |
693 | some_XS_function_that_calls_new_CONSTSUB(); | |
679b54e7 FC |
694 | } |
695 | ||
61f966e7 FC |
696 | =item * |
697 | ||
a29933a3 DR |
698 | Redefinition warnings for constant subroutines are on by default (what |
699 | are known as severe warnings in L<perldiag>). This was only the case | |
700 | when it was a glob assignment or declaration of a Perl subroutine that | |
701 | caused the warning. If the creation of XSUBs triggered the warning, it | |
702 | was not a default warning. This has been corrected. | |
61f966e7 FC |
703 | |
704 | =item * | |
705 | ||
a29933a3 DR |
706 | The internal check to see whether a redefinition warning should occur |
707 | used to emit "uninitialized" warnings in cases like this: | |
61f966e7 FC |
708 | |
709 | use warnings "uninitialized"; | |
be9a5e16 DR |
710 | use constant {u => undef, v => undef}; |
711 | sub foo(){u} | |
712 | sub foo(){v} | |
61f966e7 FC |
713 | |
714 | =item * | |
715 | ||
716 | A bug fix in Perl 5.14 introduced a new bug, causing "uninitialized" | |
be9a5e16 DR |
717 | warnings to report the wrong variable if the operator in question had |
718 | two operands and one was C<%{...}> or C<@{...}>. This has been fixed | |
61f966e7 FC |
719 | [perl #103766]. |
720 | ||
721 | =item * | |
722 | ||
723 | C<< version->new("version") >> and C<printf "%vd", "version"> no longer | |
724 | crash [perl #102586]. | |
725 | ||
d1fb015b FC |
726 | =item * |
727 | ||
a29933a3 DR |
728 | C<$tied =~ y/a/b/>, C<chop $tied> and C<chomp $tied> now call FETCH |
729 | just once when $tied holds a reference. | |
d1fb015b FC |
730 | |
731 | =item * | |
732 | ||
a29933a3 DR |
733 | Four-argument C<select> now always calls FETCH on tied arguments. It |
734 | used to skip the call if the tied argument happened to hold C<undef> or | |
735 | a typeglob. | |
d1fb015b FC |
736 | |
737 | =item * | |
738 | ||
739 | Four-argument C<select> no longer produces its "Non-string passed as | |
740 | bitmask" warning on tied or tainted variables that are strings. | |
741 | ||
742 | =item * | |
743 | ||
be9a5e16 DR |
744 | C<sysread> now always calls FETCH on the buffer passed to it if the |
745 | buffer is tied. It used to skip the call if the tied variable happened | |
746 | to hold a typeglob. | |
d1fb015b FC |
747 | |
748 | =item * | |
749 | ||
a29933a3 DR |
750 | C<< $tied .= <> >> now calls FETCH once on C<$tied>. It used to call |
751 | it multiple times if the last value assigned to or returned from the | |
752 | tied variable was anything other than a string or typeglob. | |
d1fb015b | 753 | |
66008486 FC |
754 | =item * |
755 | ||
756 | The C<evalbytes> keyword added in 5.15.5 was respecting C<use utf8> | |
a29933a3 DR |
757 | declarations from the outer scope, when it should have been ignoring |
758 | them. | |
66008486 | 759 | |
7e7629fa FC |
760 | =item * |
761 | ||
be9a5e16 | 762 | C<goto &func> no longer crashes, but produces an error message, when |
a29933a3 | 763 | the unwinding of the current subroutine's scope fires a destructor that |
7e7629fa FC |
764 | undefines the subroutine being "goneto" [perl #99850]. |
765 | ||
73512201 DG |
766 | =item * |
767 | ||
a29933a3 DR |
768 | Arithmetic assignment (C<$left += $right>) involving overloaded objects |
769 | that rely on the 'nomethod' override no longer segfault when the left | |
770 | operand is not overloaded. | |
73512201 | 771 | |
a1f0e6ed FC |
772 | =item * |
773 | ||
774 | Assigning C<__PACKAGE__> or any other shared hash key scalar to a stash | |
775 | element no longer causes a double free. Regardless of this change, the | |
776 | results of such assignments are still undefined. | |
777 | ||
778 | =item * | |
779 | ||
a29933a3 DR |
780 | Assigning C<__PACKAGE__> or another shared hash key string to a |
781 | variable no longer stops that variable from being tied if it happens to | |
782 | be a PVMG or PVLV internally. | |
a1f0e6ed | 783 | |
ad790500 FC |
784 | =item * |
785 | ||
be9a5e16 DR |
786 | Creating a C<UNIVERSAL::AUTOLOAD> sub no longer stops C<%+>, C<%-> and |
787 | C<%!> from working some of the time [perl #105024]. | |
ad790500 | 788 | |
6d91e957 KW |
789 | =item * |
790 | ||
791 | When presented with malformed UTF-8 input, the XS-callable functions | |
792 | C<is_utf8_string()>, C<is_utf8_string_loc()>, and | |
793 | C<is_utf8_string_loclen()> could read beyond the end of the input | |
794 | string by up to 12 bytes. This no longer happens. [perl #32080]. | |
a29933a3 DR |
795 | However, currently, C<is_utf8_char()> still has this defect, see |
796 | L</is_utf8_char()> above. | |
6d91e957 | 797 | |
d6b99bf4 FC |
798 | =item * |
799 | ||
a29933a3 DR |
800 | Doing a substitution on a tied variable returning a copy-on-write |
801 | scalar used to cause an assertion failure or an "Attempt to free | |
802 | nonexistent shared string" warning. | |
d6b99bf4 FC |
803 | |
804 | =item * | |
805 | ||
a29933a3 DR |
806 | A change in perl 5.15.4 caused C<caller()> to produce malloc errors and |
807 | a crash with Perl's own malloc, and possibly with other malloc | |
d6b99bf4 FC |
808 | implementations, too [perl #104034]. |
809 | ||
810 | =item * | |
811 | ||
812 | A bug fix in 5.15.5 could sometimes result in assertion failures under | |
813 | debugging builds of perl for certain syntax errors in C<eval>, such as | |
be9a5e16 | 814 | C<eval q|""!=!~//|> |
d6b99bf4 | 815 | |
8aade7da DR |
816 | =item * |
817 | ||
a29933a3 | 818 | The "c [line num]" debugger command was broken by other debugger |
be9a5e16 | 819 | changes released in 5.15.3. This is now fixed. |
8aade7da | 820 | |
c7b728ca SF |
821 | =item * |
822 | ||
a29933a3 DR |
823 | Breakpoints were not properly restored after a debugger restart using |
824 | the "R" command. This was broken in 5.15.3. This is now fixed. | |
5dd80d85 FC |
825 | |
826 | =item * | |
827 | ||
be9a5e16 | 828 | The debugger prompt did not display the current line. This was broken |
5dd80d85 | 829 | in 5.15.3. This is now fixed. |
c7b728ca SF |
830 | |
831 | =item * | |
832 | ||
a29933a3 DR |
833 | Class method calls still suffered from the Unicode bug with Latin-1 |
834 | package names. This was missed in the Unicode package name cleanup in | |
835 | 5.15.4 [perl #105922]. | |
c7b728ca | 836 | |
84b2a83e FC |
837 | =item * |
838 | ||
839 | The debugger no longer tries to do C<local $_> when dumping data | |
840 | structures. | |
841 | ||
842 | =item * | |
843 | ||
a29933a3 DR |
844 | Calling C<readline($fh)> where $fh is a glob copy (e.g., after C<$fh = |
845 | *STDOUT>), assigning something other than a glob to $fh, and then | |
84b2a83e | 846 | freeing $fh (e.g., by leaving the scope where it is defined) no longer |
a29933a3 DR |
847 | causes the internal variable used by C<$.> (C<PL_last_in_gv>) to point |
848 | to a freed scalar, that could be reused for some other glob, causing | |
849 | C<$.> to use some unrelated filehandle [perl #97988]. | |
84b2a83e FC |
850 | |
851 | =item * | |
852 | ||
853 | A regression in 5.14 caused these statements not to set the internal | |
854 | variable that holds the handle used by C<$.>: | |
855 | ||
856 | my $fh = *STDOUT; | |
857 | tell $fh; | |
858 | eof $fh; | |
859 | seek $fh, 0,0; | |
860 | tell *$fh; | |
861 | eof *$fh; | |
862 | seek *$fh, 0,0; | |
863 | readline *$fh; | |
864 | ||
a29933a3 DR |
865 | This is now fixed, but C<tell *{ *$fh }> still has the problem, and it |
866 | is not clear how to fix it [perl #106536]. | |
84b2a83e FC |
867 | |
868 | =item * | |
869 | ||
a29933a3 DR |
870 | Version comparisons, such as those that happen implicitly with C<use |
871 | v5.43>, no longer cause locale settings to change [perl #105784]. | |
b53e16ae | 872 | |
7c864bb3 VP |
873 | =item * |
874 | ||
be9a5e16 DR |
875 | F<pod/buildtoc>, which generates L<perltoc>, put path names in the |
876 | L<perltoc> file. This bug was introduced in 5.15.1. | |
7c864bb3 | 877 | |
63ac71b9 | 878 | =back |
bbc28bfc | 879 | |
be9a5e16 | 880 | =head1 Acknowledgments |
7c864bb3 | 881 | |
a29933a3 DR |
882 | Perl 5.15.6 represents approximately 2 months of development since Perl |
883 | 5.15.5 and contains approximately 48,000 lines of changes across 560 | |
884 | files from 36 authors. | |
bbc28bfc | 885 | |
a29933a3 | 886 | Perl continues to flourish into its third decade thanks to a vibrant |
be9a5e16 | 887 | community of users and developers. The following people are known to |
a29933a3 | 888 | have contributed the improvements that became Perl 5.15.6: |
8fe05716 | 889 | |
a29933a3 DR |
890 | Aaron Crane, Abhijit Menon-Sen, Alexandr Ciornii, Brian Fraser, Carl |
891 | Hayter, Chris 'BinGOs' Williams, Craig A. Berry, Dave Rolsky, David | |
892 | Golden, David Mitchell, Dominic Hargreaves, Father Chrysostomos, James | |
893 | E Keenan, Johannes Plunien, John Peacock, Karl Williamson, Marc Green, | |
894 | Mark Dootson, Matthew Horsfall, Nicholas Clark, Paul Evans, Peter | |
895 | Martini, Peter Scott, Rafael Garcia-Suarez, Reini Urban, Ricardo | |
896 | Signes, Rodolfo Carvalho, Shlomi Fish, Steffen Müller, Steve Hay, | |
897 | Steve Peters, Thomas Sibley, Timothe Litt, Tony Cook, Vadim Konovalov, | |
898 | Ævar Arnfjörð Bjarmason. | |
8fe05716 | 899 | |
a29933a3 | 900 | The list above is almost certainly incomplete as it is automatically |
be9a5e16 | 901 | generated from version control history. In particular, it does not |
a29933a3 DR |
902 | include the names of the (very much appreciated) contributors who |
903 | reported issues to the Perl bug tracker. | |
8fe05716 | 904 | |
a29933a3 | 905 | Many of the changes included in this version originated in the CPAN |
be9a5e16 | 906 | modules included in Perl's core. We're grateful to the entire CPAN |
a29933a3 | 907 | community for helping Perl to flourish. |
8fe05716 | 908 | |
a29933a3 DR |
909 | For a more complete list of all of Perl's historical contributors, |
910 | please see the F<AUTHORS> file in the Perl source distribution. | |
29cf780c | 911 | |
44691e6f AB |
912 | =head1 Reporting Bugs |
913 | ||
914 | If you find what you think is a bug, you might check the articles | |
a29933a3 DR |
915 | recently posted to the comp.lang.perl.misc newsgroup and the perl bug |
916 | database at http://rt.perl.org/perlbug/ . There may also be | |
44691e6f AB |
917 | information at http://www.perl.org/ , the Perl Home Page. |
918 | ||
919 | If you believe you have an unreported bug, please run the L<perlbug> | |
a29933a3 DR |
920 | program included with your release. Be sure to trim your bug down to a |
921 | tiny but sufficient test case. Your bug report, along with the output | |
922 | of C<perl -V>, will be sent off to perlbug@perl.org to be analysed by | |
923 | the Perl porting team. | |
44691e6f AB |
924 | |
925 | If the bug you are reporting has security implications, which make it | |
a29933a3 | 926 | inappropriate to send to a publicly archived mailing list, then please |
be9a5e16 | 927 | send it to perl5-security-report@perl.org. This points to a closed |
a29933a3 DR |
928 | subscription unarchived mailing list, which includes all the core |
929 | committers, who will be able to help assess the impact of issues, | |
930 | figure out a resolution, and help co-ordinate the release of patches to | |
931 | mitigate or fix the problem across all platforms on which Perl is | |
be9a5e16 DR |
932 | supported. Please only use this address for security issues in the |
933 | Perl core, not for modules independently distributed on CPAN. | |
44691e6f AB |
934 | |
935 | =head1 SEE ALSO | |
936 | ||
a29933a3 DR |
937 | The F<Changes> file for an explanation of how to view exhaustive |
938 | details on what changed. | |
44691e6f AB |
939 | |
940 | The F<INSTALL> file for how to build Perl. | |
941 | ||
942 | The F<README> file for general stuff. | |
943 | ||
944 | The F<Artistic> and F<Copying> files for copyright information. | |
945 | ||
946 | =cut |