Commit | Line | Data |
---|---|---|
30682cc3 RS |
1 | =encoding utf8 |
2 | ||
3 | =head1 NAME | |
4 | ||
92221470 | 5 | perl5160delta - what is new for perl v5.16.0 |
30682cc3 RS |
6 | |
7 | =head1 DESCRIPTION | |
8 | ||
9 | This document describes differences between the 5.14.0 release and | |
10 | the 5.16.0 release. | |
11 | ||
12 | If you are upgrading from an earlier release such as 5.12.0, first read | |
13 | L<perl5140delta>, which describes differences between 5.12.0 and | |
14 | 5.14.0. | |
15 | ||
16 | =head1 Notice | |
17 | ||
18 | XXX Any important notices here | |
19 | ||
20 | =head1 Core Enhancements | |
21 | ||
412912b6 RS |
22 | =head2 C<use I<VERSION>> |
23 | ||
24 | As of this release, version declarations like C<use v5.16> now disable | |
25 | all features before enabling the new feature bundle. This means that | |
26 | the following holds true: | |
27 | ||
28 | use 5.016; | |
a4574d2e | 29 | # only 5.16 features enabled here |
412912b6 | 30 | use 5.014; |
a4574d2e | 31 | # only 5.14 features enabled here (not 5.16) |
412912b6 RS |
32 | |
33 | C<use v5.12> and higher continue to enable strict, but explicit C<use | |
34 | strict> and C<no strict> now override the version declaration, even | |
35 | when they come first: | |
36 | ||
37 | no strict; | |
38 | use 5.012; | |
39 | # no strict here | |
40 | ||
41 | There is a new ":default" feature bundle that represents the set of | |
42 | features enabled before any version declaration or C<use feature> has | |
43 | been seen. Version declarations below 5.10 now enable the ":default" | |
44 | feature set. This does not actually change the behaviour of C<use | |
45 | v5.8>, because features added to the ":default" set are those that were | |
46 | traditionally enabled by default, before they could be turned off. | |
47 | ||
6c0587ef FC |
48 | C<< no feature >> now resets to the default feature set. To disable all |
49 | features (which is likely to be a pretty special-purpose request, since | |
50 | it presumably won't match any named set of semantics) you can now | |
51 | write C<< no feature ':all' >>. | |
52 | ||
412912b6 RS |
53 | C<$[> is now disabled under C<use v5.16>. It is part of the default |
54 | feature set and can be turned on or off explicitly with C<use feature | |
55 | 'array_base'>. | |
56 | ||
a4574d2e RS |
57 | =head2 C<__SUB__> |
58 | ||
59 | The new C<__SUB__> token, available under the C<current_sub> feature | |
021c503d | 60 | (see L<feature>) or C<use v5.16>, returns a reference to the current |
a4574d2e | 61 | subroutine, making it easier to write recursive closures. |
412912b6 | 62 | |
a4574d2e | 63 | =head2 New and Improved Built-ins |
412912b6 | 64 | |
a4574d2e RS |
65 | =head3 More consistent C<eval> |
66 | ||
67 | The C<eval> operator sometimes treats a string argument as a sequence of | |
68 | characters and sometimes as a sequence of bytes, depending on the | |
69 | internal encoding. The internal encoding is not supposed to make any | |
70 | difference, but there is code that relies on this inconsistency. | |
71 | ||
72 | The new C<unicode_eval> and C<evalbytes> features (enabled under C<use | |
da7ea579 | 73 | 5.16.0>) resolve this. The C<unicode_eval> feature causes C<eval |
a4574d2e RS |
74 | $string> to treat the string always as Unicode. The C<evalbytes> |
75 | features provides a function, itself called C<evalbytes>, which | |
76 | evaluates its argument always as a string of bytes. | |
77 | ||
78 | These features also fix oddities with source filters leaking to outer | |
79 | dynamic scopes. | |
80 | ||
81 | See L<feature> for more detail. | |
82 | ||
83 | =head3 C<substr> lvalue revamp | |
84 | ||
85 | =for comment Can this be compacted some? -- rjbs, 2012-02-20 | |
412912b6 RS |
86 | |
87 | When C<substr> is called in lvalue or potential lvalue context with two | |
88 | or three arguments, a special lvalue scalar is returned that modifies | |
89 | the original string (the first argument) when assigned to. | |
90 | ||
91 | Previously, the offsets (the second and third arguments) passed to | |
92 | C<substr> would be converted immediately to match the string, negative | |
93 | offsets being translated to positive and offsets beyond the end of the | |
94 | string being truncated. | |
95 | ||
96 | Now, the offsets are recorded without modification in the special | |
97 | lvalue scalar that is returned, and the original string is not even | |
98 | looked at by C<substr> itself, but only when the returned lvalue is | |
99 | read or modified. | |
100 | ||
101 | These changes result in several incompatible changes and bug fixes: | |
102 | ||
103 | =over | |
104 | ||
105 | =item * | |
106 | ||
107 | If the original string changes length after the call to C<substr> but | |
108 | before assignment to its return value, negative offsets will remember | |
109 | their position from the end of the string, affecting code like this: | |
110 | ||
111 | my $string = "string"; | |
112 | my $lvalue = \substr $string, -4, 2; | |
113 | print $lvalue, "\n"; # prints "ri" | |
114 | $string = "bailing twine"; | |
115 | print $lvalue, "\n"; # prints "wi"; used to print "il" | |
116 | ||
117 | The same thing happens with an omitted third argument. The returned | |
118 | lvalue will always extend to the end of the string, even if the string | |
119 | becomes longer. | |
120 | ||
121 | =item * | |
122 | ||
123 | Tied (and otherwise magical) variables are no longer exempt from the | |
124 | "Attempt to use reference as lvalue in substr" warning. | |
125 | ||
126 | =item * | |
127 | ||
128 | That warning now occurs when the returned lvalue is assigned to, not | |
129 | when C<substr> itself is called. This only makes a difference if the | |
130 | return value of C<substr> is referenced and assigned to later. | |
131 | ||
132 | =item * | |
133 | ||
134 | The order in which "uninitialized" warnings occur for arguments to | |
135 | C<substr> has changed. | |
136 | ||
137 | =item * | |
138 | ||
139 | Passing a substring of a read-only value or a typeglob to a function | |
140 | (potential lvalue context) no longer causes an immediate "Can't coerce" | |
141 | or "Modification of a read-only value" error. That error only occurs | |
142 | if and when the value passed is assigned to. | |
143 | ||
144 | The same thing happens with the "substr outside of string" error. If | |
145 | the lvalue is only read, not written to, it is now just a warning, as | |
146 | with rvalue C<substr>. | |
147 | ||
148 | =item * | |
149 | ||
150 | C<substr> assignments no longer call FETCH twice if the first argument | |
151 | is a tied variable, just once. | |
152 | ||
153 | =back | |
154 | ||
155 | It was impossible to fix all the bugs without an incompatible change, | |
156 | and the behaviour of negative offsets was never specified, so the | |
157 | change was deemed acceptable. | |
158 | ||
a4574d2e | 159 | =head3 Return value of C<tied> |
412912b6 RS |
160 | |
161 | The value returned by C<tied> on a tied variable is now the actual | |
162 | scalar that holds the object to which the variable is tied. This | |
163 | allows ties to be weakened with C<Scalar::Util::weaken(tied | |
164 | $tied_variable)>. | |
165 | ||
a4574d2e | 166 | =head2 Unicode Support |
412912b6 | 167 | |
77649ca9 RS |
168 | =head3 Supports (I<almost>) Unicode 6.1 |
169 | ||
170 | Besides the addition of whole new scripts, and new characters in | |
171 | existing scripts, this new version of Unicode, as always, makes some | |
172 | changes to existing characters. One change that may trip up some | |
173 | applications is that the General Category of two characters in the | |
174 | Latin-1 range, PILCROW SIGN and SECTION SIGN, has been changed from | |
175 | Other_Symbol to Other_Punctuation. The same change has been made for | |
176 | a character in each of Tibetan, Ethiopic, and Aegean. | |
177 | The code points U+3248..U+324F (CIRCLED NUMBER TEN ON BLACK SQUARE | |
178 | through CIRCLED NUMBER EIGHTY ON BLACK SQUARE) have had their General | |
179 | Category changed from Other_Symbol to Other_Numeric. The Line Break | |
180 | property has changes for Hebrew and Japanese; and as a consequence of | |
181 | other changes in 6.1, the Perl regular expression construct C<\X> now | |
182 | works differently for some characters in Thai and Lao. | |
183 | ||
184 | New aliases (synonyms) have been defined for many property values; | |
7adddc81 | 185 | these, along with the previously existing ones, are all cross-indexed in |
77649ca9 RS |
186 | L<perluniprops>. |
187 | ||
188 | The return value of C<charnames::viacode()> is affected by other | |
189 | changes: | |
190 | ||
191 | Code point Old Name New Name | |
192 | U+000A LINE FEED (LF) LINE FEED | |
193 | U+000C FORM FEED (FF) FORM FEED | |
194 | U+000D CARRIAGE RETURN (CR) CARRIAGE RETURN | |
195 | U+0085 NEXT LINE (NEL) NEXT LINE | |
196 | U+008E SINGLE-SHIFT 2 SINGLE-SHIFT-2 | |
197 | U+008F SINGLE-SHIFT 3 SINGLE-SHIFT-3 | |
198 | U+0091 PRIVATE USE 1 PRIVATE USE-1 | |
199 | U+0092 PRIVATE USE 2 PRIVATE USE-2 | |
200 | U+2118 SCRIPT CAPITAL P WEIERSTRASS ELLIPTIC FUNCTION | |
201 | ||
202 | Perl will accept any of these names as input, but | |
203 | C<charnames::viacode()> now returns the new name of each pair. The | |
204 | change for U+2118 is considered by Unicode to be a correction, that is | |
205 | the original name was a mistake (but again, it will remain forever valid | |
206 | to use it to refer to U+2118). But most of these changes are the | |
207 | fallout of the mistake Unicode 6.0 made in naming a character used in | |
7adddc81 FC |
208 | Japanese cell phones to be "BELL", which conflicts with the longstanding |
209 | industry use of (and Unicode's recommendation to use) that name | |
77649ca9 RS |
210 | to mean the ASCII control character at U+0007. As a result, that name |
211 | has been deprecated in Perl since v5.14; and any use of it will raise a | |
212 | warning message (unless turned off). The name "ALERT" is now the | |
213 | preferred name for this code point, with "BEL" being an acceptable short | |
214 | form. The name for the new cell phone character, at code point U+1F514, | |
215 | remains undefined in this version of Perl (hence we don't quite | |
216 | implement all of Unicode 6.1), but starting in v5.18, BELL will mean | |
217 | this character, and not U+0007. | |
218 | ||
219 | Unicode has taken steps to make sure that this sort of mistake does not | |
220 | happen again. The Standard now includes all the generally accepted | |
221 | names and abbreviations for control characters, whereas previously it | |
222 | didn't (though there were recommended names for most of them, which Perl | |
223 | used). This means that most of those recommended names are now | |
224 | officially in the Standard. Unicode did not recommend names for the | |
225 | four code points listed above between U+008E and U+008F, and in | |
226 | standardizing them Unicode subtly changed the names that Perl had | |
227 | previously given them, by replacing the final blank in each name by a | |
228 | hyphen. Unicode also officially accepts names that Perl had deprecated, | |
229 | such as FILE SEPARATOR. Now the only deprecated name is BELL. | |
230 | Finally, Perl now uses the new official names instead of the old | |
231 | (now considered obsolete) names for the first four code points in the | |
232 | list above (the ones which have the parentheses in them). | |
233 | ||
234 | Now that the names have been placed in the Unicode standard, these kinds | |
235 | of changes should not happen again, though corrections, such as to | |
236 | U+2118, are still possible. | |
237 | ||
238 | Unicode also added some name abbreviations, which Perl now accepts: | |
239 | SP for SPACE; | |
240 | TAB for CHARACTER TABULATION; | |
241 | NEW LINE, END OF LINE, NL, and EOL for LINE FEED; | |
242 | LOCKING-SHIFT ONE for SHIFT OUT; | |
243 | LOCKING-SHIFT ZERO for SHIFT IN; | |
244 | and ZWNBSP for ZERO WIDTH NO-BREAK SPACE. | |
245 | ||
246 | More details on this version of Unicode are provided in | |
247 | L<http://www.unicode.org/versions/Unicode6.1.0/>. | |
248 | ||
a4574d2e | 249 | =head3 C<use charnames> is no longer needed for C<\N{I<name>}> |
12477442 | 250 | |
a4574d2e RS |
251 | When C<\N{I<name>}> is encountered, the C<charnames> module is now |
252 | automatically loaded when needed as if the C<:full> and C<:short> | |
253 | options had been specified. See L<charnames> for more information. | |
12477442 | 254 | |
021c503d RS |
255 | =head3 C<\N{...}> can now have Unicode loose name matching |
256 | ||
257 | This is described in the C<charnames> item in | |
258 | L</Updated Modules and Pragmata> below. | |
259 | ||
a4574d2e | 260 | =head3 Unicode Symbol Names |
12477442 RS |
261 | |
262 | Perl now has proper support for Unicode in symbol names. It used to be | |
263 | that C<*{$foo}> would ignore the internal UTF8 flag and use the bytes of | |
264 | the underlying representation to look up the symbol. That meant that | |
265 | C<*{"\x{100}"}> and C<*{"\xc4\x80"}> would return the same thing. All | |
266 | these parts of Perl have been fixed to account for Unicode: | |
267 | ||
268 | =over | |
269 | ||
270 | =item * | |
271 | ||
272 | Method names (including those passed to C<use overload>) | |
273 | ||
274 | =item * | |
275 | ||
276 | Typeglob names (including names of variables, subroutines and filehandles) | |
277 | ||
278 | =item * | |
279 | ||
280 | Package names | |
281 | ||
282 | =item * | |
283 | ||
12477442 RS |
284 | C<goto> |
285 | ||
286 | =item * | |
287 | ||
288 | Symbolic dereferencing | |
289 | ||
290 | =item * | |
291 | ||
292 | Second argument to C<bless()> and C<tie()> | |
293 | ||
294 | =item * | |
295 | ||
296 | Return value of C<ref()> | |
297 | ||
298 | =item * | |
299 | ||
12477442 RS |
300 | Subroutine prototypes |
301 | ||
302 | =item * | |
303 | ||
304 | Attributes | |
305 | ||
a4574d2e RS |
306 | =item * |
307 | ||
308 | Various warnings and error messages that mention variable names or values, | |
309 | methods, etc. | |
310 | ||
311 | =back | |
312 | ||
313 | In addition, a parsing bug has been fixed that prevented C<*{Ć©}> from | |
314 | implicitly quoting the name, but instead interpreted it as C<*{+Ć©}>, which | |
315 | would cause a strict violation. | |
316 | ||
317 | C<*{"*a::b"}> automatically strips off the * if it is followed by an ASCII | |
318 | letter. That has been extended to all Unicode identifier characters. | |
319 | ||
da7ea579 RS |
320 | One-character non-ASCII non-punctuation variables (like C<$Ć©>) are now |
321 | subject to "Used only once" warnings. They used to be exempt, as they | |
322 | was treated as punctuation variables. | |
a4574d2e RS |
323 | |
324 | Also, single-character Unicode punctuation variables (like $ā°) are now | |
da7ea579 | 325 | supported [perl #69032]. |
a4574d2e | 326 | |
77649ca9 RS |
327 | =head3 Improved ability to mix locales and Unicode, including UTF-8 locales |
328 | ||
329 | An optional parameter has been added to C<use locale> | |
330 | ||
331 | use locale ':not_characters'; | |
332 | ||
333 | which tells Perl to use all but the C<LC_CTYPE> and C<LC_COLLATE> | |
334 | portions of the current locale. Instead, the character set is assumed | |
335 | to be Unicode. This allows locales and Unicode to be seamlessly mixed, | |
336 | including the increasingly frequent UTF-8 locales. When using this | |
337 | hybrid form of locales, the C<:locale> layer to the L<open> pragma can | |
338 | be used to interface with the file system, and there are CPAN modules | |
339 | available for ARGV and environment variable conversions. | |
340 | ||
341 | Full details are in L<perllocale>. | |
342 | ||
343 | =head3 New function C<fc> and corresponding escape sequence C<\F> for Unicode foldcase | |
344 | ||
345 | Unicode foldcase is an extension to lowercase that gives better results | |
346 | when comparing two strings case-insensitively. It has long been used | |
347 | internally in regular expression C</i> matching. Now it is available | |
348 | explicitly through the new C<fc> function call (enabled by | |
349 | S<C<"use feature 'fc'">>, or C<use v5.16>, or explicitly callable via | |
350 | C<CORE::fc>) or through the new C<\F> sequence in double-quotish | |
351 | strings. | |
352 | ||
353 | Full details are in L<perlfunc/fc>. | |
354 | ||
355 | =head3 The Unicode C<Script_Extensions> property is now supported. | |
a4574d2e RS |
356 | |
357 | New in Unicode 6.0, this is an improved C<Script> property. Details | |
358 | are in L<perlunicode/Scripts>. | |
359 | ||
a4574d2e RS |
360 | =head2 XS Changes |
361 | ||
021c503d | 362 | =head3 Improved typemaps for Some Builtin Types |
a4574d2e RS |
363 | |
364 | Most XS authors will be aware that there is a longstanding bug in the | |
365 | OUTPUT typemap for T_AVREF (C<AV*>), T_HVREF (C<HV*>), T_CVREF (C<CV*>), | |
366 | and T_SVREF (C<SVREF> or C<\$foo>) that requires manually decrementing | |
367 | the reference count of the return value instead of the typemap taking | |
4d6200df FC |
368 | care of this. For backwards-compatibility, this cannot be changed in the |
369 | default typemaps. But we now provide additional typemaps | |
a4574d2e RS |
370 | C<T_AVREF_REFCOUNT_FIXED>, etc. that do not exhibit this bug. Using |
371 | them in your extension is as simple as having one line in your | |
372 | C<TYPEMAP> section: | |
373 | ||
374 | HV* T_HVREF_REFCOUNT_FIXED | |
375 | ||
376 | =head3 C<is_utf8_char()> | |
377 | ||
378 | The XS-callable function C<is_utf8_char()>, when presented with | |
379 | malformed UTF-8 input, can read up to 12 bytes beyond the end of the | |
380 | string. This cannot be fixed without changing its API. It is not | |
381 | called from CPAN. The documentation now describes how to use it | |
382 | safely. | |
383 | ||
77649ca9 RS |
384 | =head3 Added C<is_utf8_char_buf()> |
385 | ||
386 | This function is designed to replace the deprecated L</is_utf8_char()> | |
387 | function. It includes an extra parameter to make sure it doesn't read | |
388 | past the end of the input buffer. | |
389 | ||
a4574d2e RS |
390 | =head3 Other C<is_utf8_foo()> functions, as well as C<utf8_to_foo()>, etc. |
391 | ||
392 | Most of the other XS-callable functions that take UTF-8 encoded input | |
393 | implicitly assume that the UTF-8 is valid (not malformed) in regards to | |
394 | buffer length. Do not do things such as change a character's case or | |
395 | see if it is alphanumeric without first being sure that it is valid | |
396 | UTF-8. This can be safely done for a whole string by using one of the | |
397 | functions C<is_utf8_string()>, C<is_utf8_string_loc()>, and | |
398 | C<is_utf8_string_loclen()>. | |
399 | ||
021c503d RS |
400 | =head3 New Pad API |
401 | ||
402 | Many new functions have been added to the API for manipulating lexical | |
403 | pads. See L<perlapi/Pad Data Structures> for more information. | |
404 | ||
a4574d2e RS |
405 | =head2 Changes to Special Variables |
406 | ||
021c503d RS |
407 | =head3 C<$$> can be assigned to |
408 | ||
409 | C<$$> was made read-only in Perl 5.8.0. But only sometimes: C<local $$> | |
410 | would make it writable again. Some CPAN modules were using C<local $$> or | |
411 | XS code to bypass the read-only check, so there is no reason to keep C<$$> | |
412 | read-only. (This change also allowed a bug to be fixed while maintaining | |
413 | backward compatibility.) | |
414 | ||
415 | =head3 C<$^X> converted to an absolute path on FreeBSD, OS X and Solaris | |
416 | ||
417 | C<$^X> is now converted to an absolute path on OS X, FreeBSD (without | |
4d6200df | 418 | needing F</proc> mounted) and Solaris 10 and 11. This augments the |
021c503d RS |
419 | previous approach of using F</proc> on Linux, FreeBSD and NetBSD |
420 | (in all cases, where mounted). | |
421 | ||
422 | This makes relocatable perl installations more useful on these platforms. | |
423 | (See "Relocatable @INC" in F<INSTALL>) | |
a4574d2e RS |
424 | |
425 | =head2 Debugger Changes | |
426 | ||
427 | =head3 Features inside the debugger | |
428 | ||
429 | The current Perl's L<feature> bundle is now enabled for commands entered | |
430 | in the interactive debugger. | |
431 | ||
432 | =head3 New option for the debugger's B<t> command | |
433 | ||
434 | The B<t> command in the debugger, which toggles tracing mode, now | |
435 | accepts a numeric argument that determines how many levels of subroutine | |
436 | calls to trace. | |
437 | ||
438 | =head3 C<enable> and C<disable> | |
439 | ||
440 | The debugger now has C<disable> and C<enable> commands for disabling | |
da7ea579 | 441 | existing breakpoints and re-enabling them. See L<perldebug>. |
a4574d2e RS |
442 | |
443 | =head3 Breakpoints with file names | |
444 | ||
445 | The debugger's "b" command for setting breakpoints now allows a line | |
446 | number to be prefixed with a file name. See | |
447 | L<perldebug/"b [file]:[line] [condition]">. | |
448 | ||
449 | =head2 The C<CORE> Namespace | |
450 | ||
a40c91f0 | 451 | =head3 The C<CORE::> prefix |
a4574d2e RS |
452 | |
453 | The C<CORE::> prefix can now be used on keywords enabled by | |
a40c91f0 | 454 | L<feature.pm|feature>, even outside the scope of C<use feature>. |
a4574d2e | 455 | |
a40c91f0 | 456 | =head3 Subroutines in the C<CORE> namespace |
a4574d2e | 457 | |
a40c91f0 FC |
458 | Many Perl keywords are now available as subroutines in the CORE namespace. |
459 | This allows them to be aliased: | |
460 | ||
461 | BEGIN { *entangle = \&CORE::tie } | |
462 | entangle $variable, $package, @args; | |
463 | ||
464 | And for prototypes to be bypassed: | |
465 | ||
466 | sub mytie(\[%$*@]$@) { | |
467 | my ($ref, $pack, @args) = @_; | |
468 | ... do something ... | |
469 | goto &CORE::tie; | |
470 | } | |
471 | ||
472 | Some of these cannot be called through references or via C<&foo> syntax, | |
473 | but must be called as barewords. | |
474 | ||
475 | See L<CORE> for details. | |
a4574d2e RS |
476 | |
477 | =head2 Other Changes | |
478 | ||
021c503d RS |
479 | =head3 Anonymous handles |
480 | ||
481 | Automatically generated file handles are now named __ANONIO__ when the | |
482 | variable name cannot be determined, rather than $__ANONIO__. | |
483 | ||
484 | =head3 Autoloaded sort Subroutines | |
485 | ||
486 | Custom sort subroutines can now be autoloaded [perl #30661]: | |
487 | ||
488 | sub AUTOLOAD { ... } | |
489 | @sorted = sort foo @list; # uses AUTOLOAD | |
490 | ||
491 | =head3 C<continue> no longer requires the "switch" feature | |
492 | ||
493 | The C<continue> keyword has two meanings. It can introduce a C<continue> | |
494 | block after a loop, or it can exit the current C<when> block. Up till now, | |
495 | the latter meaning was only valid with the "switch" feature enabled, and | |
496 | was a syntax error otherwise. Since the main purpose of feature.pm is to | |
497 | avoid conflicts with user-defined subroutines, there is no reason for | |
498 | C<continue> to depend on it. | |
499 | ||
021c503d RS |
500 | =head3 DTrace probes for interpreter phase change |
501 | ||
502 | The C<phase-change> probes will fire when the interpreter's phase | |
4d6200df FC |
503 | changes, which tracks the C<${^GLOBAL_PHASE}> variable. C<arg0> is |
504 | the new phase name; C<arg1> is the old one. This is useful mostly | |
021c503d RS |
505 | for limiting your instrumentation to one or more of: compile time, |
506 | run time, destruct time. | |
507 | ||
508 | =head3 C<__FILE__()> Syntax | |
509 | ||
510 | The C<__FILE__>, C<__LINE__> and C<__PACKAGE__> tokens can now be written | |
511 | with an empty pair of parentheses after them. This makes them parse the | |
512 | same way as C<time>, C<fork> and other built-in functions. | |
a4574d2e | 513 | |
f4ff5ee7 FC |
514 | =head3 The C<\$> prototype accepts any scalar lvalue |
515 | ||
516 | The C<\$> and C<\[$]> subroutine prototypes now accept any scalar lvalue | |
517 | argument. Previously they only accepted scalars beginning with C<$> and | |
518 | hash and array elements. This change makes them consistent with the way | |
519 | the built-in C<read> and C<recv> functions (among others) parse their | |
520 | arguments. This means that one can override the built-in functions with | |
521 | custom subroutines that parse their arguments the same way. | |
522 | ||
523 | =head3 C<_> in subroutine prototypes | |
77649ca9 RS |
524 | |
525 | The C<_> character in subroutine prototypes is now allowed before C<@> or | |
526 | C<%>. | |
527 | ||
a4574d2e RS |
528 | =head1 Security |
529 | ||
77649ca9 RS |
530 | =head2 Use C<is_utf8_char_buf()> and not C<is_utf8_char()> |
531 | ||
532 | The latter function is now deprecated because its API is insufficient to | |
533 | guarantee that it doesn't read (up to 12 bytes in the worst case) beyond | |
534 | the end of its input string. See | |
535 | L<is_utf8_char_buf()|/Added is_utf8_char_buf()>. | |
536 | ||
a4574d2e RS |
537 | =head2 C<File::Glob::bsd_glob()> memory error with GLOB_ALTDIRFUNC (CVE-2011-2728). |
538 | ||
539 | Calling C<File::Glob::bsd_glob> with the unsupported flag | |
540 | GLOB_ALTDIRFUNC would cause an access violation / segfault. A Perl | |
541 | program that accepts a flags value from an external source could expose | |
542 | itself to denial of service or arbitrary code execution attacks. There | |
543 | are no known exploits in the wild. The problem has been corrected by | |
544 | explicitly disabling all unsupported flags and setting unused function | |
545 | pointers to null. Bug reported by ClƩment Lecigne. | |
546 | ||
547 | =head2 Privileges are now set correctly when assigning to C<$(> | |
548 | ||
549 | A hypothetical bug (probably non-exploitable in practice) due to the | |
550 | incorrect setting of the effective group ID while setting C<$(> has been | |
551 | fixed. The bug would only have affected systems that have C<setresgid()> | |
552 | but not C<setregid()>, but no such systems are known of. | |
553 | ||
554 | =head1 Deprecations | |
555 | ||
556 | =head2 Don't read the Unicode data base files in F<lib/unicore> | |
557 | ||
558 | It is now deprecated to directly read the Unicode data base files. | |
559 | These are stored in the F<lib/unicore> directory. Instead, you should | |
560 | use the new functions in L<Unicode::UCD>. These provide a stable API, | |
021c503d | 561 | and give complete information. |
a4574d2e RS |
562 | |
563 | Perl may at some point in the future change or remove the files. The | |
564 | file most likely for applications to have used is | |
565 | F<lib/unicore/ToDigit.pl>. L<Unicode::UCD/prop_invmap()> can be used to | |
566 | get at its data instead. | |
567 | ||
77649ca9 RS |
568 | =head2 C<is_utf8_char()> |
569 | ||
570 | This function is deprecated because it could read beyond the end of the | |
571 | input string. Use the new L<is_utf8_char_buf()|/Added is_utf8_char_buf()> | |
572 | instead. | |
573 | ||
a4574d2e RS |
574 | =head1 Future Deprecations |
575 | ||
2200e649 | 576 | This section serves as a notice of features that are I<likely> to be |
021c503d RS |
577 | removed or L<deprecated|perlpolicy/deprecated> in the next release of |
578 | perl (5.18.0). If your code depends on these features, you should | |
579 | contact the Perl 5 Porters via the L<mailing | |
a4574d2e RS |
580 | list|http://lists.perl.org/list/perl5-porters.html> or L<perlbug> to |
581 | explain your use case and inform the deprecation process. | |
582 | ||
583 | =head2 Core Modules | |
584 | ||
585 | These modules may be marked as deprecated I<from the core>. This only | |
586 | means that they will no longer be installed by default with the core | |
587 | distribution, but will remain available on the CPAN. | |
588 | ||
589 | =over | |
590 | ||
021c503d | 591 | =item * |
a4574d2e | 592 | |
021c503d | 593 | CPANPLUS |
a4574d2e | 594 | |
021c503d | 595 | =item * |
a4574d2e | 596 | |
021c503d | 597 | Filter::Simple |
a4574d2e | 598 | |
021c503d | 599 | =item * |
a4574d2e | 600 | |
021c503d | 601 | PerlIO::mmap |
a4574d2e | 602 | |
021c503d | 603 | =item * |
a4574d2e | 604 | |
021c503d | 605 | Pod::Parser, Pod::LaTeX |
a4574d2e | 606 | |
021c503d | 607 | =item * |
a4574d2e | 608 | |
021c503d | 609 | SelfLoader |
a4574d2e | 610 | |
021c503d | 611 | =item * |
a4574d2e | 612 | |
021c503d | 613 | Text::Soundex |
a4574d2e | 614 | |
021c503d | 615 | =item * |
a4574d2e | 616 | |
021c503d | 617 | Thread.pm |
a4574d2e RS |
618 | |
619 | =back | |
620 | ||
021c503d | 621 | =head2 Platforms with no supporting programmers: |
12477442 | 622 | |
2200e649 FC |
623 | These platforms will probably have their |
624 | special build support removed during the | |
021c503d | 625 | 5.17.0 development series. |
12477442 RS |
626 | |
627 | =over | |
628 | ||
629 | =item * | |
630 | ||
021c503d | 631 | BeOS |
12477442 RS |
632 | |
633 | =item * | |
634 | ||
021c503d | 635 | djgpp |
12477442 RS |
636 | |
637 | =item * | |
638 | ||
021c503d | 639 | dgux |
12477442 RS |
640 | |
641 | =item * | |
642 | ||
021c503d | 643 | EPOC |
12477442 RS |
644 | |
645 | =item * | |
646 | ||
021c503d | 647 | MPE/iX |
12477442 RS |
648 | |
649 | =item * | |
650 | ||
021c503d | 651 | Rhapsody |
12477442 RS |
652 | |
653 | =item * | |
654 | ||
021c503d | 655 | UTS |
12477442 RS |
656 | |
657 | =item * | |
658 | ||
021c503d | 659 | VM/ESA |
12477442 RS |
660 | |
661 | =back | |
662 | ||
021c503d | 663 | =head2 Other Future Deprecations |
a14d7d4a | 664 | |
021c503d | 665 | =over |
ccad93fd | 666 | |
021c503d | 667 | =item * |
ccad93fd | 668 | |
021c503d | 669 | Swapping of $< and $> |
ccad93fd | 670 | |
da7ea579 RS |
671 | For more information about this future deprecation, see L<the relevant RT |
672 | ticket|https://rt.perl.org/rt3/Ticket/Display.html?id=96212>. | |
ccad93fd | 673 | |
021c503d | 674 | =item * |
ccad93fd | 675 | |
021c503d | 676 | sfio, stdio |
ccad93fd | 677 | |
6d365783 FC |
678 | =item * |
679 | ||
680 | Unescaped literal C<< "{" >> in regular expressions. | |
681 | ||
ddfbda00 FC |
682 | It is planned starting in v5.20 to require a literal C<"{"> to be |
683 | escaped by, for example, preceding it with a backslash. In v5.18, a | |
684 | deprecated warning message will be emitted for all such uses. Note that | |
685 | this only affects patterns which are to match a literal C<"{">. Other | |
686 | uses of this character, such as part of a quantifier or sequence like in | |
687 | the ones below are completely unaffected: | |
688 | ||
689 | /foo{3,5}/ | |
690 | /\p{Alphabetic}/ | |
691 | /\N{DIGIT ZERO} | |
692 | ||
693 | The removal of this will allow extensions to pattern syntax, and better | |
694 | error checking of existing syntax. See L<perlre/Quantifiers> for an | |
695 | example. | |
696 | ||
021c503d | 697 | =back |
30682cc3 | 698 | |
021c503d | 699 | =head1 Incompatible Changes |
94c11dd4 | 700 | |
77649ca9 RS |
701 | =head2 Special blocks called in void context |
702 | ||
703 | Special blocks (C<BEGIN>, C<CHECK>, C<INIT>, C<UNITCHECK>, C<END>) are now | |
704 | called in void context. This avoids wasteful copying of the result of the | |
705 | last statement [perl #108794]. | |
706 | ||
707 | =head2 The C<overloading> pragma and regexp objects | |
708 | ||
709 | With C<no overloading>, regular expression objects returned by C<qr//> are | |
710 | now stringified as "Regexp=REGEXP(0xbe600d)" instead of the regular | |
711 | expression itself [perl #108780]. | |
712 | ||
713 | =head2 Two XS typemap Entries removed | |
714 | ||
715 | Two presumably unused XS typemap entries have been removed from the | |
4d6200df | 716 | core typemap: T_DATAUNIT and T_CALLBACK. If you are, against all odds, |
77649ca9 RS |
717 | a user of these, please see the instructions on how to regain them |
718 | in L<perlxstypemap>. | |
719 | ||
720 | =head2 Unicode 6.1 has incompatibilities with Unicode 6.0 | |
721 | ||
722 | These are detailed in L</Supports (almost) Unicode 6.1> above. | |
16737d47 KW |
723 | You can compile this version of Perl to use Unicode 6.0. See |
724 | L<perlunicode/Hacking Perl to work on earlier Unicode versions (for very serious hackers only)>. | |
77649ca9 | 725 | |
021c503d | 726 | =head2 Borland compiler |
94c11dd4 | 727 | |
021c503d RS |
728 | All support for the Borland compiler has been dropped. The code had not |
729 | worked for a long time anyway. | |
30682cc3 | 730 | |
b325a3a2 RS |
731 | =head2 Certain deprecated Unicode properties are no longer supported by default |
732 | ||
733 | Perl should never have exposed certain Unicode properties that are used | |
734 | by Unicode internally and not meant to be publicly available. Use of | |
735 | these has generated deprecated warning messages since Perl 5.12. The | |
736 | removed properties are Other_Alphabetic, | |
737 | Other_Default_Ignorable_Code_Point, Other_Grapheme_Extend, | |
738 | Other_ID_Continue, Other_ID_Start, Other_Lowercase, Other_Math, and | |
739 | Other_Uppercase. | |
740 | ||
741 | Perl may be recompiled to include any or all of them; instructions are | |
742 | given in | |
743 | L<perluniprops/Unicode character properties that are NOT accepted by Perl>. | |
744 | ||
745 | =head2 Dereferencing IO thingies as typeglobs | |
746 | ||
747 | The C<*{...}> operator, when passed a reference to an IO thingy (as in | |
748 | C<*{*STDIN{IO}}>), creates a new typeglob containing just that IO object. | |
b325a3a2 RS |
749 | Previously, it would stringify as an empty string, but some operators would |
750 | treat it as undefined, producing an "uninitialized" warning. | |
13eda273 | 751 | Now it stringifies as __ANONIO__ [perl #96326]. |
b325a3a2 | 752 | |
4bbade93 RS |
753 | =head2 User-defined case changing operations. |
754 | ||
755 | This feature was deprecated in Perl 5.14, and has now been removed. | |
756 | The CPAN module L<Unicode::Casing> provides better functionality without | |
757 | the drawbacks that this feature had, as are detailed in the 5.14 | |
758 | documentation: | |
759 | L<http://perldoc.perl.org/5.14.0/perlunicode.html#User-Defined-Case-Mappings-%28for-serious-hackers-only%29> | |
760 | ||
761 | =head2 XSUBs are now 'static' | |
762 | ||
763 | XSUB C functions are now 'static', that is, they are not visible from | |
4d6200df | 764 | outside the compilation unit. Users can use the new C<XS_EXTERNAL(name)> |
4bbade93 RS |
765 | and C<XS_INTERNAL(name)> macros to pick the desired linking behaviour. |
766 | The ordinary C<XS(name)> declaration for XSUBs will continue to declare | |
767 | non-'static' XSUBs for compatibility, but the XS compiler, | |
768 | C<ExtUtils::ParseXS> (C<xsubpp>) will emit 'static' XSUBs by default. | |
769 | C<ExtUtils::ParseXS>'s behaviour can be reconfigured from XS using the | |
270edcef | 770 | C<EXPORT_XSUB_SYMBOLS> keyword. See L<perlxs> for details. |
4bbade93 | 771 | |
4bbade93 RS |
772 | =head2 Weakening read-only references |
773 | ||
774 | Weakening read-only references is no longer permitted. It should never | |
ef85823e | 775 | have worked anyway, and in some cases could result in crashes. |
4bbade93 | 776 | |
a14d7d4a RS |
777 | =head2 Tying scalars that hold typeglobs |
778 | ||
779 | Attempting to tie a scalar after a typeglob was assigned to it would | |
780 | instead tie the handle in the typeglob's IO slot. This meant that it was | |
781 | impossible to tie the scalar itself. Similar problems affected C<tied> and | |
782 | C<untie>: C<tied $scalar> would return false on a tied scalar if the last | |
783 | thing returned was a typeglob, and C<untie $scalar> on such a tied scalar | |
784 | would do nothing. | |
30682cc3 | 785 | |
a14d7d4a RS |
786 | We fixed this problem before Perl 5.14.0, but it caused problems with some |
787 | CPAN modules, so we put in a deprecation cycle instead. | |
30682cc3 | 788 | |
a14d7d4a RS |
789 | Now the deprecation has been removed and this bug has been fixed. So |
790 | C<tie $scalar> will always tie the scalar, not the handle it holds. To tie | |
791 | the handle, use C<tie *$scalar> (with an explicit asterisk). The same | |
792 | applies to C<tied *$scalar> and C<untie *$scalar>. | |
793 | ||
794 | =head2 IPC::Open3 no longer provides C<xfork()>, C<xclose_on_exec()> | |
795 | and C<xpipe_anon()> | |
796 | ||
797 | All three functions were private, undocumented and unexported. They do | |
798 | not appear to be used by any code on CPAN. Two have been inlined and one | |
799 | deleted entirely. | |
800 | ||
801 | =head2 C<$$> no longer caches PID | |
802 | ||
3af03643 | 803 | Previously, if one called fork(3) from C, Perl's |
4d6200df | 804 | notion of C<$$> could go out of sync with what getpid() returns. By always |
a14d7d4a RS |
805 | fetching the value of C<$$> via getpid(), this potential bug is eliminated. |
806 | Code that depends on the caching behavior will break. As described in | |
3af03643 FC |
807 | L<Core Enhancements|/C<$$> can be assigned to>, |
808 | C<$$> is now writable, but it will be reset during a | |
a14d7d4a | 809 | fork. |
30682cc3 | 810 | |
77649ca9 RS |
811 | =head2 C<$$> and C<getppid()> no longer emulate POSIX semantics under LinuxThreads |
812 | ||
813 | The POSIX emulation of C<$$> and C<getppid()> under the obsolete | |
2a94ed8e FC |
814 | LinuxThreads implementation has been removed. |
815 | This only impacts users of Linux 2.4 and | |
77649ca9 RS |
816 | users of Debian GNU/kFreeBSD up to and including 6.0, not the vast |
817 | majority of Linux installations that use NPTL threads. | |
818 | ||
37194c1a | 819 | This means that C<getppid()>, like C<$$>, is now always guaranteed to |
77649ca9 RS |
820 | return the OS's idea of the current state of the process, not perl's |
821 | cached version of it. | |
822 | ||
823 | See the documentation for L<$$|perlvar/$$> for details. | |
824 | ||
825 | =head2 C<< $< >>, C<< $> >>, C<$(> and C<$)> are no longer cached | |
826 | ||
37194c1a | 827 | Similarly to the changes to C<$$> and C<getppid()>, the internal |
77649ca9 RS |
828 | caching of C<< $< >>, C<< $> >>, C<$(> and C<$)> has been removed. |
829 | ||
830 | When we cached these values our idea of what they were would drift out | |
37194c1a | 831 | of sync with reality if someone (e.g., someone embedding perl) called |
04bd4d55 | 832 | C<sete?[ug]id()> without updating C<PL_e?[ug]id>. Having to deal with |
77649ca9 RS |
833 | this complexity wasn't worth it given how cheap the C<gete?[ug]id()> |
834 | system call is. | |
835 | ||
836 | This change will break a handful of CPAN modules that use the XS-level | |
837 | C<PL_uid>, C<PL_gid>, C<PL_euid> or C<PL_egid> variables. | |
838 | ||
839 | The fix for those breakages is to use C<PerlProc_gete?[ug]id()> to | |
840 | retrieve them (e.g. C<PerlProc_getuid()>), and not to assign to | |
4d6200df | 841 | C<PL_e?[ug]id> if you change the UID/GID/EUID/EGID. There is no longer |
77649ca9 RS |
842 | any need to do so since perl will always retrieve the up-to-date |
843 | version of those values from the OS. | |
844 | ||
845 | =head2 Which Non-ASCII characters get quoted by C<quotemeta> and C<\Q> has changed | |
846 | ||
847 | This is unlikely to result in a real problem, as Perl does not attach | |
848 | special meaning to any non-ASCII character, so it is currently | |
849 | irrelevant which are quoted or not. This change fixes bug [perl #77654] and | |
850 | bring Perl's behavior more into line with Unicode's recommendations. | |
851 | See L<perlfunc/quotemeta>. | |
852 | ||
a4574d2e | 853 | =head1 Performance Enhancements |
6c3c09b8 RS |
854 | |
855 | =over | |
856 | ||
a4574d2e | 857 | =item * |
6c3c09b8 | 858 | |
a4574d2e | 859 | Improved performance for Unicode properties in regular expressions |
6c3c09b8 | 860 | |
a4574d2e | 861 | =for comment Can this be compacted some? -- rjbs, 2012-02-20 |
6c3c09b8 | 862 | |
a4574d2e RS |
863 | Matching a code point against a Unicode property is now done via a |
864 | binary search instead of linear. This means for example that the worst | |
865 | case for a 1000 item property is 10 probes instead of 1000. This | |
866 | inefficiency has been compensated for in the past by permanently storing | |
867 | in a hash the results of a given probe plus the results for the adjacent | |
868 | 64 code points, under the theory that near-by code points are likely to | |
869 | be searched for. A separate hash was used for each mention of a Unicode | |
870 | property in each regular expression. Thus, C<qr/\p{foo}abc\p{foo}/> | |
871 | would generate two hashes. Any probes in one instance would be unknown | |
872 | to the other, and the hashes could expand separately to be quite large | |
873 | if the regular expression were used on many different widely-separated | |
874 | code points. This can lead to running out of memory in extreme cases. | |
875 | Now, however, there is just one hash shared by all instances of a given | |
876 | property. This means that if C<\p{foo}> is matched against "A" in one | |
877 | regular expression in a thread, the result will be known immediately to | |
878 | all regular expressions, and the relentless march of using up memory is | |
879 | slowed considerably. | |
6c3c09b8 | 880 | |
a4574d2e | 881 | =item * |
6c3c09b8 | 882 | |
a4574d2e RS |
883 | Version declarations with the C<use> keyword (e.g., C<use 5.012>) are now |
884 | faster, as they enable features without loading F<feature.pm>. | |
6c3c09b8 | 885 | |
a4574d2e | 886 | =item * |
6c3c09b8 | 887 | |
a4574d2e RS |
888 | C<local $_> is faster now, as it no longer iterates through magic that it |
889 | is not going to copy anyway. | |
6c3c09b8 | 890 | |
a4574d2e | 891 | =item * |
6c3c09b8 | 892 | |
a4574d2e RS |
893 | Perl 5.12.0 sped up the destruction of objects whose classes define |
894 | empty C<DESTROY> methods (to prevent autoloading), by simply not | |
895 | calling such empty methods. This release takes this optimisation a | |
896 | step further, by not calling any C<DESTROY> method that begins with a | |
897 | C<return> statement. This can be useful for destructors that are only | |
898 | used for debugging: | |
6c3c09b8 | 899 | |
a4574d2e RS |
900 | use constant DEBUG => 1; |
901 | sub DESTROY { return unless DEBUG; ... } | |
6c3c09b8 | 902 | |
a4574d2e RS |
903 | Constant-folding will reduce the first statement to C<return;> if DEBUG |
904 | is set to 0, triggering this optimisation. | |
6c3c09b8 | 905 | |
a4574d2e | 906 | =item * |
6c3c09b8 | 907 | |
a4574d2e RS |
908 | Assigning to a variable that holds a typeglob or copy-on-write scalar |
909 | is now much faster. Previously the typeglob would be stringified or | |
910 | the copy-on-write scalar would be copied before being clobbered. | |
6c3c09b8 | 911 | |
a4574d2e | 912 | =item * |
6c3c09b8 | 913 | |
a4574d2e RS |
914 | Assignment to C<substr> in void context is now more than twice its |
915 | previous speed. Instead of creating and returning a special lvalue | |
916 | scalar that is then assigned to, C<substr> modifies the original string | |
917 | itself. | |
6c3c09b8 | 918 | |
a4574d2e | 919 | =item * |
6c3c09b8 | 920 | |
a4574d2e RS |
921 | C<substr> no longer calculates a value to return when called in void |
922 | context. | |
6c3c09b8 | 923 | |
ccad93fd | 924 | =item * |
30682cc3 | 925 | |
a4574d2e RS |
926 | Due to changes in L<File::Glob>, Perl's C<glob> function and its C<< |
927 | <...> >> equivalent are now much faster. The splitting of the pattern | |
928 | into words has been rewritten in C, resulting in speed-ups of 20% in | |
929 | some cases. | |
b325a3a2 | 930 | |
49f99971 | 931 | This does not affect C<glob> on VMS, as it does not use File::Glob. |
b325a3a2 RS |
932 | |
933 | =item * | |
934 | ||
ccad93fd RS |
935 | The short-circuiting operators C<&&>, C<||>, and C<//>, when chained |
936 | (such as C<$a || $b || $c>), are now considerably faster to short-circuit, | |
937 | due to reduced optree traversal. | |
30682cc3 RS |
938 | |
939 | =item * | |
940 | ||
ccad93fd RS |
941 | The implementation of C<s///r> makes one fewer copy of the scalar's value. |
942 | ||
943 | =item * | |
944 | ||
021c503d | 945 | C<study> is now a no-op. |
ccad93fd RS |
946 | |
947 | =item * | |
948 | ||
949 | Recursive calls to lvalue subroutines in lvalue scalar context use less | |
950 | memory. | |
30682cc3 RS |
951 | |
952 | =back | |
953 | ||
954 | =head1 Modules and Pragmata | |
955 | ||
956 | XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/> | |
957 | go here. If Module::CoreList is updated, generate an initial draft of the | |
958 | following sections using F<Porting/corelist-perldelta.pl>, which prints stub | |
959 | entries to STDOUT. Results can be pasted in place of the '=head2' entries | |
960 | below. A paragraph summary for important changes should then be added by hand. | |
961 | In an ideal world, dual-life modules would have a F<Changes> file that could be | |
962 | cribbed. | |
963 | ||
964 | [ Within each section, list entries as a =item entry ] | |
965 | ||
cb82babd RS |
966 | =head2 Deprecated Modules |
967 | ||
968 | =over | |
969 | ||
970 | =item L<Version::Requirements> | |
971 | ||
da7ea579 | 972 | Version::Requirements is now DEPRECATED, use L<CPAN::Meta::Requirements>, |
4d6200df | 973 | which is a drop-in replacement. It will be deleted from perl.git blead |
cb82babd RS |
974 | in v5.17.0. |
975 | ||
976 | =back | |
977 | ||
30682cc3 RS |
978 | =head2 New Modules and Pragmata |
979 | ||
980 | =over 4 | |
981 | ||
982 | =item * | |
983 | ||
b325a3a2 | 984 | L<arybase> -- this new module implements the C<$[> variable. |
30682cc3 | 985 | |
77649ca9 RS |
986 | =item * |
987 | ||
988 | C<PerlIO::mmap> 0.010 has been added to the Perl core. | |
989 | ||
990 | The C<mmap> PerlIO layer is no longer implemented by perl itself, but has | |
991 | been moved out into the new L<PerlIO::mmap> module. | |
992 | ||
30682cc3 RS |
993 | =back |
994 | ||
995 | =head2 Updated Modules and Pragmata | |
996 | ||
997 | =over 4 | |
998 | ||
999 | =item * | |
1000 | ||
1001 | L<XXX> has been upgraded from version 0.69 to version 0.70. | |
1002 | ||
1003 | =back | |
1004 | ||
1005 | =head2 Removed Modules and Pragmata | |
1006 | ||
a14d7d4a RS |
1007 | As promised in Perl 5.14.0's release notes, the following modules have |
1008 | been removed from the core distribution, and if needed should be installed | |
1009 | from CPAN instead. | |
1010 | ||
1011 | =over | |
30682cc3 RS |
1012 | |
1013 | =item * | |
1014 | ||
021c503d RS |
1015 | C<Devel::DProf> has been removed from the Perl core. Prior version was |
1016 | 20110228.00. | |
a14d7d4a RS |
1017 | |
1018 | =item * | |
1019 | ||
1020 | C<Shell> has been removed from the Perl core. Prior version was 0.72_01. | |
30682cc3 RS |
1021 | |
1022 | =back | |
1023 | ||
1024 | =head1 Documentation | |
1025 | ||
30682cc3 RS |
1026 | =head2 New Documentation |
1027 | ||
ccad93fd | 1028 | =head3 L<perldtrace> |
30682cc3 | 1029 | |
ccad93fd RS |
1030 | L<perldtrace> describes Perl's DTrace support, listing the provided probes |
1031 | and gives examples of their use. | |
30682cc3 | 1032 | |
94c11dd4 RS |
1033 | =head3 L<perlexperiment> |
1034 | ||
1035 | This document is intended to provide a list of experimental features in | |
1036 | Perl. It is still a work in progress. | |
1037 | ||
021c503d RS |
1038 | =head3 L<perlootut> |
1039 | ||
4d6200df | 1040 | This a new OO tutorial. It focuses on basic OO concepts, and then recommends |
021c503d RS |
1041 | that readers choose an OO framework from CPAN. |
1042 | ||
77649ca9 RS |
1043 | =head3 L<perlxstypemap> |
1044 | ||
1045 | The new manual describes the XS typemapping mechanism in unprecedented | |
1046 | detail and combines new documentation with information extracted from | |
1047 | L<perlxs> and the previously unofficial list of all core typemaps. | |
1048 | ||
30682cc3 RS |
1049 | =head2 Changes to Existing Documentation |
1050 | ||
021c503d RS |
1051 | =head3 L<perlapi> |
1052 | ||
1053 | =over 4 | |
1054 | ||
1055 | =item * | |
1056 | ||
1057 | The HV API has long accepted negative lengths to indicate that the key is | |
1058 | in UTF8. Now this is documented. | |
1059 | ||
1060 | =item * | |
1061 | ||
1062 | The C<boolSV()> macro is now documented. | |
1063 | ||
1064 | =back | |
1065 | ||
cb82babd RS |
1066 | =head3 L<perlfunc> |
1067 | ||
1068 | =over 4 | |
1069 | ||
1070 | =item * | |
1071 | ||
1072 | C<dbmopen> treats a 0 mode as a special case, that prevents a nonexistent | |
1073 | file from being created. This has been the case since Perl 5.000, but was | |
1074 | never documented anywhere. Now the perlfunc entry mentions it | |
1075 | [perl #90064]. | |
1076 | ||
1077 | =item * | |
1078 | ||
021c503d RS |
1079 | As an accident of history, C<open $fh, "<:", ...> applies the default |
1080 | layers for the platform (C<:raw> on Unix, C<:crlf> on Windows), ignoring | |
1081 | whatever is declared by L<open.pm|open>. This seems such a useful feature | |
1082 | it has been documented in L<perlfunc|perlfunc/open> and L<open>. | |
1083 | ||
1084 | =item * | |
1085 | ||
cb82babd RS |
1086 | The entry for C<split> has been rewritten. It is now far clearer than |
1087 | before. | |
1088 | ||
1089 | =back | |
1090 | ||
021c503d | 1091 | =head3 L<perlguts> |
cb82babd RS |
1092 | |
1093 | =over 4 | |
1094 | ||
1095 | =item * | |
1096 | ||
021c503d RS |
1097 | A new section, L<Autoloading with XSUBs|perlguts/Autoloading with XSUBs>, |
1098 | has been added, which explains the two APIs for accessing the name of the | |
1099 | autoloaded sub. | |
cb82babd RS |
1100 | |
1101 | =item * | |
1102 | ||
021c503d RS |
1103 | Some of the function descriptions in L<perlguts> were confusing, as it was |
1104 | not clear whether they referred to the function above or below the | |
1105 | description. This has been clarified [perl #91790]. | |
cb82babd RS |
1106 | |
1107 | =back | |
1108 | ||
021c503d | 1109 | =head3 L<perlobj> |
412912b6 RS |
1110 | |
1111 | =over 4 | |
1112 | ||
1113 | =item * | |
1114 | ||
021c503d RS |
1115 | This document has been rewritten from scratch, and its coverage of various OO |
1116 | concepts has been expanded. | |
412912b6 RS |
1117 | |
1118 | =back | |
1119 | ||
021c503d | 1120 | =head3 L<perlop> |
12477442 RS |
1121 | |
1122 | =over 4 | |
1123 | ||
1124 | =item * | |
1125 | ||
021c503d RS |
1126 | Documentation of the smartmatch operator has been reworked and moved from |
1127 | perlsyn to perlop where it belongs. | |
12477442 | 1128 | |
021c503d RS |
1129 | It has also been corrected for the case of C<undef> on the left-hand |
1130 | side. The list of different smart match behaviours had an item in the | |
1131 | wrong place. | |
12477442 RS |
1132 | |
1133 | =item * | |
1134 | ||
021c503d RS |
1135 | Documentation of the ellipsis statement (C<...>) has been reworked and |
1136 | moved from perlop to perlsyn. | |
12477442 RS |
1137 | |
1138 | =item * | |
1139 | ||
021c503d RS |
1140 | The explanation of bitwise operators has been expanded to explain how they |
1141 | work on Unicode strings (5.14.1). | |
12477442 RS |
1142 | |
1143 | =item * | |
1144 | ||
021c503d | 1145 | More examples for C<m//g> have been added (5.14.1). |
4bbade93 RS |
1146 | |
1147 | =item * | |
1148 | ||
021c503d | 1149 | The C<<< <<\FOO >>> here-doc syntax has been documented (5.14.1). |
4bbade93 RS |
1150 | |
1151 | =back | |
1152 | ||
1153 | =head3 L<perlpragma> | |
1154 | ||
1155 | =over 4 | |
1156 | ||
1157 | =item * | |
1158 | ||
1159 | There is now a standard convention for naming keys in the C<%^H>, | |
1160 | documented under L<Key naming|perlpragma/Key naming>. | |
1161 | ||
1162 | =back | |
1163 | ||
021c503d | 1164 | =head3 L<perlsec/Laundering and Detecting Tainted Data> |
30682cc3 | 1165 | |
021c503d | 1166 | =over 4 |
ccad93fd RS |
1167 | |
1168 | =item * | |
1169 | ||
021c503d RS |
1170 | The example function for checking for taintedness contained a subtle |
1171 | error. C<$@> needs to be localized to prevent its changing this | |
1172 | global's value outside the function. The preferred method to check for | |
1173 | this remains L<Scalar::Util/tainted>. | |
ccad93fd RS |
1174 | |
1175 | =back | |
1176 | ||
1177 | =head3 L<perllol> | |
1178 | ||
1179 | =over | |
1180 | ||
1181 | =item * | |
1182 | ||
1183 | L<perllol> has been expanded with examples using the new C<push $scalar> | |
1184 | syntax introduced in Perl 5.14.0 (5.14.1). | |
1185 | ||
1186 | =back | |
1187 | ||
1188 | =head3 L<perlmod> | |
1189 | ||
1190 | =over | |
1191 | ||
1192 | =item * | |
1193 | ||
1194 | L<perlmod> now states explicitly that some types of explicit symbol table | |
1195 | manipulation are not supported. This codifies what was effectively already | |
1196 | the case [perl #78074]. | |
1197 | ||
1198 | =back | |
1199 | ||
ccad93fd RS |
1200 | =head3 L<perlpodstyle> |
1201 | ||
1202 | =over 4 | |
1203 | ||
1204 | =item * | |
1205 | ||
1206 | The tips on which formatting codes to use have been corrected and greatly | |
1207 | expanded. | |
1208 | ||
1209 | =item * | |
1210 | ||
1211 | There are now a couple of example one-liners for previewing POD files after | |
1212 | they have been edited. | |
1213 | ||
1214 | =back | |
1215 | ||
021c503d | 1216 | =head3 L<perlre> |
ccad93fd RS |
1217 | |
1218 | =over | |
1219 | ||
1220 | =item * | |
1221 | ||
021c503d RS |
1222 | The C<(*COMMIT)> directive is now listed in the right section |
1223 | (L<Verbs without an argument|perlre/Verbs without an argument>). | |
94c11dd4 | 1224 | |
ccad93fd RS |
1225 | =back |
1226 | ||
021c503d | 1227 | =head3 L<perlrun> |
ccad93fd RS |
1228 | |
1229 | =over | |
1230 | ||
1231 | =item * | |
1232 | ||
021c503d RS |
1233 | L<perlrun> has undergone a significant clean-up. Most notably, the |
1234 | B<-0x...> form of the B<-0> flag has been clarified, and the final section | |
1235 | on environment variables has been corrected and expanded (5.14.1). | |
ccad93fd RS |
1236 | |
1237 | =back | |
1238 | ||
021c503d | 1239 | =head3 L<perlsub> |
ccad93fd RS |
1240 | |
1241 | =over | |
1242 | ||
1243 | =item * | |
1244 | ||
021c503d RS |
1245 | The ($;) prototype syntax, which has existed for rather a long time, is now |
1246 | documented in L<perlsub>. It allows a unary function to have the same | |
1247 | precedence as a list operator. | |
ccad93fd RS |
1248 | |
1249 | =back | |
1250 | ||
1251 | =head3 L<perltie> | |
1252 | ||
1253 | =over | |
1254 | ||
1255 | =item * | |
1256 | ||
24391d94 | 1257 | The required syntax for tying handles has been documented. |
ccad93fd RS |
1258 | |
1259 | =back | |
1260 | ||
1261 | =head3 L<perlvar> | |
1262 | ||
1263 | =over | |
1264 | ||
1265 | =item * | |
1266 | ||
1267 | The documentation for L<$!|perlvar/$!> has been corrected and clarified. | |
1268 | It used to state that $! could be C<undef>, which is not the case. It was | |
1269 | also unclear as to whether system calls set C's C<errno> or Perl's C<$!> | |
1270 | [perl #91614]. | |
1271 | ||
1272 | =item * | |
1273 | ||
1274 | Documentation for L<$$|perlvar/$$> has been amended with additional | |
1275 | cautions regarding changing the process ID. | |
1276 | ||
1277 | =back | |
30682cc3 | 1278 | |
021c503d RS |
1279 | =head3 Other Changes |
1280 | ||
30682cc3 RS |
1281 | =over 4 |
1282 | ||
1283 | =item * | |
1284 | ||
ccad93fd RS |
1285 | L<perlxs> was extended with documentation on inline typemaps. |
1286 | ||
1287 | =item * | |
1288 | ||
1289 | L<perlref> has a new L<Circular References|perlref/Circular References> | |
1290 | section explaining how circularities may not be freed and how to solve that | |
1291 | with weak references. | |
1292 | ||
1293 | =item * | |
1294 | ||
ccad93fd RS |
1295 | Parts of L<perlapi> were clarified, and Perl equivalents of some C |
1296 | functions have been added as an additional mode of exposition. | |
1297 | ||
1298 | =item * | |
1299 | ||
1300 | A few parts of L<perlre> and L<perlrecharclass> were clarified. | |
30682cc3 RS |
1301 | |
1302 | =back | |
1303 | ||
4bbade93 RS |
1304 | =head2 Removed Documentation |
1305 | ||
1306 | =head3 Old OO Documentation | |
1307 | ||
1308 | All the old OO tutorials, perltoot, perltooc, and perlboot, have been | |
a4574d2e RS |
1309 | removed. The perlbot (bag of object tricks) document has been removed |
1310 | as well. | |
4bbade93 RS |
1311 | |
1312 | =head3 Development Deltas | |
1313 | ||
021c503d RS |
1314 | The perldelta files for development releases are no longer packaged with |
1315 | perl. These can still be found in the perl source code repository. | |
4bbade93 | 1316 | |
30682cc3 RS |
1317 | =head1 Diagnostics |
1318 | ||
1319 | The following additions or changes have been made to diagnostic output, | |
1320 | including warnings and fatal error messages. For the complete list of | |
1321 | diagnostic messages, see L<perldiag>. | |
1322 | ||
30682cc3 RS |
1323 | =head2 New Diagnostics |
1324 | ||
30682cc3 RS |
1325 | =head3 New Errors |
1326 | ||
1327 | =over 4 | |
1328 | ||
1329 | =item * | |
1330 | ||
cb82babd RS |
1331 | L<Cannot set tied @DB::args|perldiag/"Cannot set tied @DB::args"> |
1332 | ||
1333 | This error occurs when C<caller> tries to set C<@DB::args> but finds it | |
1334 | tied. Before this error was added, it used to crash instead. | |
1335 | ||
1336 | =item * | |
1337 | ||
1338 | L<Cannot tie unreifiable array|perldiag/"Cannot tie unreifiable array"> | |
1339 | ||
1340 | This error is part of a safety check that the C<tie> operator does before | |
1341 | tying a special array like C<@_>. You should never see this message. | |
1342 | ||
1343 | =item * | |
1344 | ||
94c11dd4 RS |
1345 | L<&CORE::%s cannot be called directly|perldiag/"&CORE::%s cannot be called directly"> |
1346 | ||
10c3c9ec | 1347 | This occurs when a subroutine in the C<CORE::> namespace is called |
4dbfa257 | 1348 | with C<&foo> syntax or through a reference. Some subroutines |
94c11dd4 | 1349 | in this package cannot yet be called that way, but must be |
10c3c9ec | 1350 | called as barewords. See L</Subroutines in the C<CORE> namespace>, above. |
30682cc3 | 1351 | |
98a0da08 FC |
1352 | =item * |
1353 | ||
1354 | L<Source filters apply only to byte streams|perldiag/"Source filters apply only to byte streams"> | |
1355 | ||
1356 | This new error occurs when you try to activate a source filter (usually by | |
1357 | loading a source filter module) within a string passed to C<eval> under the | |
1358 | C<unicode_eval> feature. | |
1359 | ||
30682cc3 RS |
1360 | =back |
1361 | ||
1362 | =head3 New Warnings | |
1363 | ||
1364 | =over 4 | |
1365 | ||
b325a3a2 RS |
1366 | =item * |
1367 | ||
cb82babd RS |
1368 | L<defined(@array) is deprecated|perldiag/"defined(@array) is deprecated"> |
1369 | ||
1370 | The long-deprecated C<defined(@array)> now also warns for package variables. | |
1371 | Previously it only issued a warning for lexical variables. | |
1372 | ||
1373 | =item * | |
1374 | ||
98a0da08 | 1375 | L<length() used on %s|perldiag/length() used on %s> |
cb82babd | 1376 | |
98a0da08 FC |
1377 | This new warning occurs when C<length> is used on an array or hash, instead |
1378 | of C<scalar(@array)> or C<scalar(keys %hash)>. | |
cb82babd RS |
1379 | |
1380 | =item * | |
1381 | ||
98a0da08 | 1382 | L<lvalue attribute %s already-defined subroutine|perldiag/"lvalue attribute %s already-defined subroutine"> |
cb82babd | 1383 | |
98a0da08 FC |
1384 | L<attributes.pm|attributes> now emits this warning when the :lvalue |
1385 | attribute is applied to a Perl subroutine that has already been defined, as | |
1386 | doing so can have unexpected side-effects. | |
cb82babd | 1387 | |
cb82babd RS |
1388 | =item * |
1389 | ||
98a0da08 | 1390 | L<overload arg '%s' is invalid|perldiag/"overload arg '%s' is invalid"> |
30682cc3 | 1391 | |
98a0da08 FC |
1392 | This warning, in the "overload" category, is produced when the overload |
1393 | pragma is given an argument it doesn't recognize, presumably a mistyped | |
1394 | operator. | |
a14d7d4a | 1395 | |
b325a3a2 RS |
1396 | =item * |
1397 | ||
98a0da08 | 1398 | L<$[ used in %s (did you mean $] ?)|perldiag/"$[ used in %s (did you mean $] ?)"> |
b325a3a2 | 1399 | |
98a0da08 FC |
1400 | This new warning exists to catch the mistaken use of C<$[> in version |
1401 | checks. C<$]>, not C<$[>, contains the version number. | |
b325a3a2 RS |
1402 | |
1403 | =item * | |
1404 | ||
98a0da08 | 1405 | L<Useless assignment to a temporary|perldiag/"Useless assignment to a temporary"> |
b325a3a2 | 1406 | |
98a0da08 FC |
1407 | Assigning to a temporary scalar returned |
1408 | from an lvalue subroutine now produces this | |
1409 | warning [perl #31946]. | |
b325a3a2 RS |
1410 | |
1411 | =item * | |
1412 | ||
98a0da08 | 1413 | L<Useless use of \E|perldiag/"Useless use of \E"> |
6d365783 | 1414 | |
98a0da08 | 1415 | C<\E> does nothing unless preceded by C<\Q>, C<\L> or C<\U>. |
6d365783 | 1416 | |
a14d7d4a | 1417 | =back |
30682cc3 | 1418 | |
482daec9 | 1419 | =head2 Removed Errors |
cb82babd RS |
1420 | |
1421 | =over | |
1422 | ||
1423 | =item * | |
1424 | ||
1425 | "sort is now a reserved word" | |
1426 | ||
a4574d2e RS |
1427 | This error used to occur when C<sort> was called without arguments, |
1428 | followed by C<;> or C<)>. (E.g., C<sort;> would die, but C<{sort}> was | |
cb82babd RS |
1429 | OK.) This error message was added in Perl 3 to catch code like |
1430 | C<close(sort)> which would no longer work. More than two decades later, | |
1431 | this message is no longer appropriate. Now C<sort> without arguments is | |
a4574d2e RS |
1432 | always allowed, and returns an empty list, as it did in those cases |
1433 | where it was already allowed [perl #90030]. | |
cb82babd RS |
1434 | |
1435 | =back | |
1436 | ||
30682cc3 RS |
1437 | =head2 Changes to Existing Diagnostics |
1438 | ||
ccad93fd RS |
1439 | =over 4 |
1440 | ||
1441 | =item * | |
1442 | ||
1154aa6d FC |
1443 | The "Applying pattern match..." or similar warning produced when an |
1444 | array or hash is on the left-hand side of the C<=~> operator now | |
1445 | mentions the name of the variable. | |
9f6b5e9d FC |
1446 | |
1447 | =item * | |
1448 | ||
412912b6 RS |
1449 | The "Attempt to free non-existent shared string" has had the spelling |
1450 | of "non-existent" corrected to "nonexistent". It was already listed | |
1451 | with the correct spelling in L<perldiag>. | |
1452 | ||
1453 | =item * | |
1454 | ||
412912b6 | 1455 | The error messages for using C<default> and C<when> outside of a |
a4574d2e RS |
1456 | topicalizer have been standardised to match the messages for C<continue> |
1457 | and loop controls. They now read 'Can't "default" outside a | |
1458 | topicalizer' and 'Can't "when" outside a topicalizer'. They both used | |
1459 | to be 'Can't use when() outside a topicalizer' [perl #91514]. | |
412912b6 RS |
1460 | |
1461 | =item * | |
1462 | ||
1154aa6d FC |
1463 | The message, "Code point 0x%X is not Unicode, no properties match it; |
1464 | all inverse properties do" has been changed to "Code point 0x%X is not | |
1465 | Unicode, all \p{} matches fail; all \P{} matches succeed". | |
b325a3a2 RS |
1466 | |
1467 | =item * | |
1468 | ||
1154aa6d FC |
1469 | Redefinition warnings for constant subroutines used to be mandatory, |
1470 | even occurring under C<no warnings>. Now they respect the L<warnings> | |
1471 | pragma. | |
1472 | ||
1473 | =item * | |
1474 | ||
1475 | The "glob failed" warning message is now suppressible via C<no warnings> | |
1476 | [perl #111656]. | |
b325a3a2 RS |
1477 | |
1478 | =item * | |
1479 | ||
ccad93fd RS |
1480 | The L<Invalid version format|perldiag/"Invalid version format (%s)"> |
1481 | error message now says "negative version number" within the parentheses, | |
1482 | rather than "non-numeric data", for negative numbers. | |
1483 | ||
1484 | =item * | |
1485 | ||
1486 | The two warnings | |
1487 | L<Possible attempt to put comments in qw() list|perldiag/"Possible attempt to put comments in qw() list"> | |
1488 | and | |
1489 | L<Possible attempt to separate words with commas|perldiag/"Possible attempt to separate words with commas"> | |
021c503d RS |
1490 | are no longer mutually exclusive: the same C<qw> construct may produce |
1491 | both. | |
30682cc3 | 1492 | |
021c503d | 1493 | =item * |
412912b6 | 1494 | |
1154aa6d FC |
1495 | The uninitialized warning for C<y///r> when C<$_> is implicit and |
1496 | undefined now mentions the variable name, just like the non-/r variation | |
1497 | of the operator. | |
1498 | ||
1499 | =item * | |
1500 | ||
1501 | The 'Use of "foo" without parentheses is ambiguous' warning has been | |
1502 | extended to apply also to user-defined subroutines with a (;$) | |
1503 | prototype, and not just to built-in functions. | |
412912b6 RS |
1504 | |
1505 | =item * | |
30682cc3 | 1506 | |
021c503d RS |
1507 | Warnings that mention the names of lexical (C<my>) variables with |
1508 | Unicode characters in them now respect the presence or absence of the | |
1509 | C<:utf8> layer on the output handle, instead of outputting UTF8 | |
1510 | regardless. Also, the correct names are included in the strings passed | |
1511 | to C<$SIG{__WARN__}> handlers, rather than the raw UTF8 bytes. | |
412912b6 RS |
1512 | |
1513 | =back | |
30682cc3 | 1514 | |
021c503d RS |
1515 | =head1 Utility Changes |
1516 | ||
4bbade93 | 1517 | =head3 L<h2ph> |
30682cc3 RS |
1518 | |
1519 | =over 4 | |
1520 | ||
1521 | =item * | |
1522 | ||
4bbade93 RS |
1523 | L<h2ph> used to generate code of the form |
1524 | ||
412912b6 RS |
1525 | unless(defined(&FOO)) { |
1526 | sub FOO () {42;} | |
1527 | } | |
4bbade93 RS |
1528 | |
1529 | But the subroutine is a compile-time declaration, and is hence unaffected | |
1530 | by the condition. It has now been corrected to emit a string C<eval> | |
1531 | around the subroutine [perl #99368]. | |
30682cc3 RS |
1532 | |
1533 | =back | |
1534 | ||
cb82babd RS |
1535 | =head3 L<splain> |
1536 | ||
1537 | =over 4 | |
1538 | ||
1539 | =item * | |
1540 | ||
a4574d2e RS |
1541 | F<splain> no longer emits backtraces with the first line number repeated. |
1542 | ||
cb82babd RS |
1543 | This: |
1544 | ||
1545 | Uncaught exception from user code: | |
1546 | Cannot fwiddle the fwuddle at -e line 1. | |
1547 | at -e line 1 | |
1548 | main::baz() called at -e line 1 | |
1549 | main::bar() called at -e line 1 | |
1550 | main::foo() called at -e line 1 | |
1551 | ||
1552 | has become this: | |
1553 | ||
1554 | Uncaught exception from user code: | |
1555 | Cannot fwiddle the fwuddle at -e line 1. | |
1556 | main::baz() called at -e line 1 | |
1557 | main::bar() called at -e line 1 | |
1558 | main::foo() called at -e line 1 | |
1559 | ||
1560 | =item * | |
1561 | ||
1562 | Some error messages consist of multiple lines that are listed as separate | |
1563 | entries in L<perldiag>. splain has been taught to find the separate | |
1564 | entries in these cases, instead of simply failing to find the message. | |
1565 | ||
1566 | =back | |
1567 | ||
021c503d RS |
1568 | =head3 L<zipdetails> |
1569 | ||
1570 | =over 4 | |
1571 | ||
1572 | =item * | |
1573 | ||
d0af4845 FC |
1574 | This is a new utility, included as part of an |
1575 | L<IO::Compress::Base> upgrade. | |
1576 | ||
021c503d RS |
1577 | L<zipdetails> displays information about the internal record structure |
1578 | of the zip file. It is not concerned with displaying any details of | |
1579 | the compressed data stored in the zip file. | |
1580 | ||
1581 | =back | |
1582 | ||
30682cc3 RS |
1583 | =head1 Configuration and Compilation |
1584 | ||
a14d7d4a | 1585 | =over 4 |
30682cc3 | 1586 | |
a14d7d4a | 1587 | =item * |
30682cc3 | 1588 | |
a4574d2e | 1589 | The C<-Dusesitecustomize> and C<-Duserelocatableinc> options now work |
412912b6 RS |
1590 | together properly. |
1591 | ||
1592 | =item * | |
1593 | ||
a14d7d4a RS |
1594 | F<regexp.h> has been modified for compatibility with GCC's B<-Werror> |
1595 | option, as used by some projects that include perl's header files (5.14.1). | |
30682cc3 RS |
1596 | |
1597 | =item * | |
1598 | ||
a14d7d4a RS |
1599 | C<USE_LOCALE{,_COLLATE,_CTYPE,_NUMERIC}> have been added the output of perl -V |
1600 | as they have affect the behaviour of the interpreter binary (albeit only | |
1601 | in a small area). | |
1602 | ||
1603 | =item * | |
1604 | ||
1605 | The code and tests for L<IPC::Open2> have been moved from F<ext/IPC-Open2> | |
1606 | into F<ext/IPC-Open3>, as C<IPC::Open2::open2()> is implemented as a thin | |
1607 | wrapper around C<IPC::Open3::_open3()>, and hence is very tightly coupled to | |
1608 | it. | |
1609 | ||
1610 | =item * | |
1611 | ||
1612 | The magic types and magic vtables are now generated from data in a new script | |
4d6200df FC |
1613 | F<regen/mg_vtable.pl>, instead of being |
1614 | maintained by hand. As different EBCDIC | |
a14d7d4a RS |
1615 | variants can't agree on the code point for '~', the character to code point |
1616 | conversion is done at build time by F<generate_uudmap> to a new generated header | |
4d6200df | 1617 | F<mg_data.h>. C<PL_vtbl_bm> and C<PL_vtbl_fm> are now defined by the |
a14d7d4a RS |
1618 | pre-processor as C<PL_vtbl_regexp>, instead of being distinct C variables. |
1619 | C<PL_vtbl_sig> has been removed. | |
1620 | ||
1621 | =item * | |
1622 | ||
4d6200df FC |
1623 | Building with C<-DPERL_GLOBAL_STRUCT> |
1624 | works again. This configuration is not | |
a14d7d4a RS |
1625 | generally used. |
1626 | ||
1627 | =item * | |
1628 | ||
1629 | Perl configured with I<MAD> now correctly frees C<MADPROP> structures when | |
4d6200df FC |
1630 | OPs are freed. C<MADPROP>s are now allocated with |
1631 | C<PerlMemShared_malloc()> | |
a14d7d4a RS |
1632 | |
1633 | =back | |
30682cc3 | 1634 | |
30682cc3 RS |
1635 | =head1 Testing |
1636 | ||
1637 | XXX Any significant changes to the testing of a freshly built perl should be | |
1638 | listed here. Changes which create B<new> files in F<t/> go here as do any | |
1639 | large changes to the testing harness (e.g. when parallel testing was added). | |
1640 | Changes to existing files in F<t/> aren't worth summarising, although the bugs | |
1641 | that they represent may be covered elsewhere. | |
1642 | ||
1643 | [ List each test improvement as a =item entry ] | |
1644 | ||
1645 | =over 4 | |
1646 | ||
1647 | =item * | |
1648 | ||
1649 | XXX | |
1650 | ||
1651 | =back | |
1652 | ||
1653 | =head1 Platform Support | |
1654 | ||
1655 | XXX Any changes to platform support should be listed in the sections below. | |
1656 | ||
1657 | [ Within the sections, list each platform as a =item entry with specific | |
1658 | changes as paragraphs below it. ] | |
1659 | ||
1660 | =head2 New Platforms | |
1661 | ||
1662 | XXX List any platforms that this version of perl compiles on, that previous | |
1663 | versions did not. These will either be enabled by new files in the F<hints/> | |
1664 | directories, or new subdirectories and F<README> files at the top level of the | |
1665 | source tree. | |
1666 | ||
1667 | =over 4 | |
1668 | ||
1669 | =item XXX-some-platform | |
1670 | ||
1671 | XXX | |
1672 | ||
1673 | =back | |
1674 | ||
1675 | =head2 Discontinued Platforms | |
1676 | ||
1677 | XXX List any platforms that this version of perl no longer compiles on. | |
1678 | ||
1679 | =over 4 | |
1680 | ||
1681 | =item XXX-some-platform | |
1682 | ||
1683 | XXX | |
1684 | ||
1685 | =back | |
1686 | ||
1687 | =head2 Platform-Specific Notes | |
1688 | ||
77649ca9 RS |
1689 | =head3 Cygwin |
1690 | ||
1691 | =over 4 | |
1692 | ||
1693 | =item * | |
1694 | ||
4d6200df | 1695 | Since version 1.7, Cygwin supports native UTF-8 paths. If Perl is built |
77649ca9 RS |
1696 | under that environment, directory and filenames will be UTF-8 encoded. |
1697 | ||
4c29740d FC |
1698 | Cygwin does not initialize all original Win32 environment variables. See |
1699 | F<README.cygwin> for a discussion of the newly-added | |
1700 | C<Cygwin::sync_winenv()> function [perl #110190] and for | |
77649ca9 RS |
1701 | further links. |
1702 | ||
1703 | =back | |
1704 | ||
412912b6 RS |
1705 | =head3 VMS |
1706 | ||
30682cc3 RS |
1707 | =over 4 |
1708 | ||
412912b6 | 1709 | =item * |
30682cc3 | 1710 | |
4bbade93 RS |
1711 | Remove unnecessary includes, fix miscellaneous compiler warnings and |
1712 | close some unclosed comments on F<vms/vms.c>. | |
1713 | ||
1714 | Remove sockadapt layer from the VMS build. | |
30682cc3 | 1715 | |
412912b6 RS |
1716 | =item * |
1717 | ||
412912b6 RS |
1718 | Explicit support for VMS versions prior to v7.0 and DEC C versions |
1719 | prior to v6.0 has been removed. | |
1720 | ||
1721 | =item * | |
1722 | ||
1723 | Since Perl 5.10.1, the home-grown C<stat> wrapper has been unable to | |
1724 | distinguish between a directory name containing an underscore and an | |
1725 | otherwise-identical filename containing a dot in the same position | |
1726 | (e.g., t/test_pl as a directory and t/test.pl as a file). This problem | |
1727 | has been corrected. | |
1728 | ||
77649ca9 RS |
1729 | =item * |
1730 | ||
1731 | The build on VMS now allows names of the resulting symbols in C code for | |
1732 | Perl longer than 31 characters. Symbols like | |
1733 | C<Perl__it_was_the_best_of_times_it_was_the_worst_of_times> can now be | |
1734 | created freely without causing the VMS linker to seize up. | |
1735 | ||
412912b6 RS |
1736 | =back |
1737 | ||
1738 | =head3 GNU/Hurd | |
b325a3a2 RS |
1739 | |
1740 | Numerous build and test failures on GNU/Hurd have been resolved with hints | |
1741 | for building DBM modules, detection of the library search path, and enabling | |
1742 | of large file support. | |
1743 | ||
412912b6 | 1744 | =head3 OpenVOS |
b325a3a2 RS |
1745 | |
1746 | Perl is now built with dynamic linking on OpenVOS, the minimum supported | |
1747 | version of which is now Release 17.1.0. | |
1748 | ||
412912b6 | 1749 | =head3 SunOS |
b325a3a2 RS |
1750 | |
1751 | The CC workshop C++ compiler is now detected and used on systems that ship | |
1752 | without cc. | |
1753 | ||
30682cc3 RS |
1754 | =head1 Internal Changes |
1755 | ||
4bbade93 | 1756 | =over 4 |
30682cc3 | 1757 | |
4bbade93 | 1758 | =item * |
30682cc3 | 1759 | |
cb82babd RS |
1760 | There are now feature bundle hints in C<PL_hints> (C<$^H>) that version |
1761 | declarations use, to avoid having to load F<feature.pm>. One setting of | |
1762 | the hint bits indicates a "custom" feature bundle, which means that the | |
1763 | entries in C<%^H> still apply. F<feature.pm> uses that. | |
1764 | ||
1765 | The C<HINT_FEATURE_MASK> macro is defined in F<perl.h> along with other | |
1766 | hints. Other macros for setting and testing features and bundles are in | |
1767 | the new F<feature.h>. C<FEATURE_IS_ENABLED> (which has moved to | |
1768 | F<feature.h>) is no longer used throughout the codebase, but more specific | |
1769 | macros, e.g., C<FEATURE_SAY_IS_ENABLED>, that are defined in F<feature.h>. | |
1770 | ||
1771 | =item * | |
1772 | ||
1773 | F<lib/feature.pm> is now a generated file, created by the new | |
1774 | F<regen/feature.pl> script, which also generates F<feature.h>. | |
1775 | ||
1776 | =item * | |
1777 | ||
1778 | Tied arrays are now always C<AvREAL>. If C<@_> or C<DB::args> is tied, it | |
1779 | is reified first, to make sure this is always the case. | |
1780 | ||
cb82babd RS |
1781 | =item * |
1782 | ||
4bbade93 RS |
1783 | The C<is_gv_magical_sv> function has been eliminated and merged with |
1784 | C<gv_fetchpvn_flags>. It used to be called to determine whether a GV | |
1785 | should be autovivified in rvalue context. Now it has been replaced with a | |
1786 | new C<GV_ADDMG> flag (not part of the API). | |
30682cc3 RS |
1787 | |
1788 | =item * | |
1789 | ||
4bbade93 RS |
1790 | Padlists are now marked C<AvREAL>; i.e., reference-counted. They have |
1791 | always been reference-counted, but were not marked real, because F<pad.c> | |
1792 | did its own clean-up, instead of using the usual clean-up code in F<sv.c>. | |
1793 | That caused problems in thread cloning, so now the C<AvREAL> flag is on, | |
1794 | but is turned off in F<pad.c> right before the padlist is freed (after | |
1795 | F<pad.c> has done its custom freeing of the pads). | |
1796 | ||
1797 | =item * | |
1798 | ||
1799 | All the C files that make up the Perl core have been converted to UTF-8. | |
30682cc3 RS |
1800 | |
1801 | =back | |
1802 | ||
1803 | =head1 Selected Bug Fixes | |
1804 | ||
a14d7d4a | 1805 | =head2 Regular expressions and character classes |
30682cc3 RS |
1806 | |
1807 | =over 4 | |
1808 | ||
1809 | =item * | |
1810 | ||
77649ca9 RS |
1811 | C</[[:ascii:]]/> and C</[[:blank:]]/> now use locale rules under |
1812 | C<use locale> when the platform supports that. Previously, they used | |
1813 | the platform's native character set. | |
1814 | ||
1815 | =item * | |
1816 | ||
77649ca9 RS |
1817 | C<m/[[:ascii:]]/i> and C</\p{ASCII}/i> now match identically (when not |
1818 | under a differing locale). This fixes a regression introduced in 5.14 | |
1819 | in which the first expression could match characters outside of ASCII, | |
1820 | such as the KELVIN SIGN. | |
1821 | ||
1822 | =item * | |
1823 | ||
1d1e229c FC |
1824 | C</.*/g> would sometimes refuse to match at the end of a string that ends |
1825 | with "\n". This has been fixed [perl #109206]. | |
1826 | ||
1827 | =item * | |
1828 | ||
77649ca9 RS |
1829 | Starting with 5.12.0, Perl used to get its internal bookkeeping muddled up |
1830 | after assigning C<${ qr// }> to a hash element and locking it with | |
1831 | L<Hash::Util>. This could result in double frees, crashes or erratic | |
1832 | behaviour. | |
1833 | ||
1834 | =item * | |
1835 | ||
a14d7d4a RS |
1836 | The new (in 5.14.0) regular expression modifier C</a> when repeated like |
1837 | C</aa> forbids the characters outside the ASCII range that match | |
1838 | characters inside that range from matching under C</i>. This did not | |
1839 | work under some circumstances, all involving alternation, such as: | |
1840 | ||
1841 | "\N{KELVIN SIGN}" =~ /k|foo/iaa; | |
1842 | ||
1843 | succeeded inappropriately. This is now fixed. | |
1844 | ||
1845 | =item * | |
1846 | ||
1847 | 5.14.0 introduced some memory leaks in regular expression character | |
4d6200df | 1848 | classes such as C<[\w\s]>, which have now been fixed. (5.14.1) |
a14d7d4a RS |
1849 | |
1850 | =item * | |
1851 | ||
1852 | An edge case in regular expression matching could potentially loop. | |
1853 | This happened only under C</i> in bracketed character classes that have | |
1854 | characters with multi-character folds, and the target string to match | |
1855 | against includes the first portion of the fold, followed by another | |
1856 | character that has a multi-character fold that begins with the remaining | |
1857 | portion of the fold, plus some more. | |
1858 | ||
1859 | "s\N{U+DF}" =~ /[\x{DF}foo]/i | |
1860 | ||
1861 | is one such case. C<\xDF> folds to C<"ss">. (5.14.1) | |
1862 | ||
1863 | =item * | |
1864 | ||
1865 | A few characters in regular expression pattern matches did not | |
1866 | match correctly in some circumstances, all involving C</i>. The | |
1867 | affected characters are: | |
1868 | COMBINING GREEK YPOGEGRAMMENI, | |
1869 | GREEK CAPITAL LETTER IOTA, | |
1870 | GREEK CAPITAL LETTER UPSILON, | |
1871 | GREEK PROSGEGRAMMENI, | |
1872 | GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA, | |
1873 | GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS, | |
1874 | GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA, | |
1875 | GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS, | |
1876 | LATIN SMALL LETTER LONG S, | |
1877 | LATIN SMALL LIGATURE LONG S T, | |
1878 | and | |
1879 | LATIN SMALL LIGATURE ST. | |
1880 | ||
1881 | =item * | |
1882 | ||
a4b68579 FC |
1883 | A memory leak regression in regular expression compilation |
1884 | under threading has been fixed. | |
a14d7d4a | 1885 | |
77649ca9 RS |
1886 | =item * |
1887 | ||
a4b68579 FC |
1888 | A regression introduced in 5.13.6 has |
1889 | been fixed. This involved an inverted | |
77649ca9 | 1890 | bracketed character class in a regular expression that consisted solely |
a4b68579 | 1891 | of a Unicode property. That property wasn't getting inverted outside the |
77649ca9 RS |
1892 | Latin1 range. |
1893 | ||
a14d7d4a RS |
1894 | =back |
1895 | ||
1896 | =head2 Formats | |
1897 | ||
1898 | =over | |
1899 | ||
1900 | =item * | |
1901 | ||
1902 | A number of edge cases have been fixed with formats and C<formline>; | |
1903 | in particular, where the format itself is potentially variable (such as | |
1904 | with ties and overloading), and where the format and data differ in their | |
801284b1 | 1905 | encoding. In both these cases, it used to possible for the output to be |
a14d7d4a RS |
1906 | corrupted [perl #91032]. |
1907 | ||
1908 | =item * | |
1909 | ||
1910 | C<formline> no longer converts its argument into a string in-place. So | |
1911 | passing a reference to C<formline> no longer destroys the reference | |
1912 | [perl #79532]. | |
1913 | ||
1914 | =back | |
1915 | ||
1916 | =head2 Copy-on-write scalars | |
1917 | ||
1918 | Copy-on-write scalars were introduced in 5.8.0, but most Perl code | |
1919 | did not encounter them (they were used mostly internally). Perl | |
1920 | 5.10.0 extended them, such that assigning C<__PACKAGE__> or a | |
1921 | hash key to a scalar would make it copy-on-write. Several parts | |
1922 | of Perl were not updated to account for them, but have now been fixed. | |
1923 | ||
1924 | =over | |
1925 | ||
1926 | =item * | |
1927 | ||
1928 | C<utf8::decode> had a nasty bug that would modify copy-on-write scalars' | |
1929 | string buffers in place (i.e., skipping the copy). This could result in | |
1930 | hashes having two elements with the same key [perl #91834]. | |
1931 | ||
1932 | =item * | |
1933 | ||
1934 | Lvalue subroutines were not allowing COW scalars to be returned. This was | |
1935 | fixed for lvalue scalar context in Perl 5.12.3 and 5.14.0, but list context | |
1936 | was not fixed until this release. | |
1937 | ||
1938 | =item * | |
1939 | ||
1940 | Elements of restricted hashes (see the L<fields> pragma) containing | |
1941 | copy-on-write values couldn't be deleted, nor could such hashes be cleared | |
1942 | (C<%hash = ()>). | |
1943 | ||
1944 | =item * | |
1945 | ||
1946 | Localising a tied variable used to make it read-only if it contained a | |
1947 | copy-on-write string. | |
1948 | ||
1949 | =item * | |
1950 | ||
1951 | L<Storable>, L<Devel::Peek> and L<PerlIO::scalar> had similar problems. | |
1952 | See L</Updated Modules and Pragmata>, above. | |
1953 | ||
bd9cbc46 FC |
1954 | XXX That section is empty. |
1955 | ||
a14d7d4a RS |
1956 | =back |
1957 | ||
4ad239c3 | 1958 | =head2 Lvalue subroutines |
a14d7d4a RS |
1959 | |
1960 | There have been various fixes to lvalue subroutines. | |
1961 | ||
1962 | =over | |
1963 | ||
1964 | =item * | |
1965 | ||
1966 | Explicit return now returns the actual argument passed to return, instead | |
8b541984 | 1967 | of copying it [perl #72724, #72706]. |
a14d7d4a | 1968 | |
a14d7d4a RS |
1969 | =item * |
1970 | ||
1971 | Lvalue subroutines used to enforce lvalue syntax (i.e., whatever can go on | |
1972 | the left-hand side of C<=>) for the last statement and the arguments to | |
1973 | return. Since lvalue subroutines are not always called in lvalue context, | |
1974 | this restriction has been lifted. | |
1975 | ||
1976 | =item * | |
1977 | ||
1978 | Lvalue subroutines are less restrictive as to what values can be returned. | |
1979 | It used to croak on values returned by C<shift> and C<delete> and from | |
1980 | other subroutines, but no longer does so [perl #71172]. | |
1981 | ||
1982 | =item * | |
1983 | ||
1984 | Empty lvalue subroutines (C<sub :lvalue {}>) used to return C<@_> in list | |
1985 | context. In fact, all subroutines used to, but regular subs were fixed in | |
1986 | Perl 5.8.2. Now lvalue subroutines have been likewise fixed. | |
1987 | ||
1988 | =item * | |
1989 | ||
0fe29a63 FC |
1990 | Autovivification now works on values returned from lvalue subroutines |
1991 | [perl #7946], as does returning C<keys> in lvalue context. | |
1992 | ||
1993 | =item * | |
1994 | ||
a14d7d4a RS |
1995 | Lvalue subroutines used to copy their return values in rvalue context. Not |
1996 | only was this a waste of CPU cycles, but it also caused bugs. A C<($)> | |
1997 | prototype would cause an lvalue sub to copy its return value [perl #51408], | |
1998 | and C<while(lvalue_sub() =~ m/.../g) { ... }> would loop endlessly | |
1999 | [perl #78680]. | |
2000 | ||
2001 | =item * | |
2002 | ||
4ad239c3 FC |
2003 | When called in potential lvalue context |
2004 | (e.g., subroutine arguments or a list | |
0fe29a63 | 2005 | passed to C<for>), lvalue subroutines used to copy |
a14d7d4a RS |
2006 | any read-only value that was returned. E.g., C< sub :lvalue { $] } > |
2007 | would not return C<$]>, but a copy of it. | |
2008 | ||
2009 | =item * | |
2010 | ||
0fe29a63 FC |
2011 | When called in potential lvalue context, an lvalue subroutine returning |
2012 | arrays or hashes used to bind the arrays or hashes to scalar variables, | |
2013 | resulting in bugs. This was fixed in 5.14.0 if an array were the first | |
2014 | thing returned from the subroutine (but not for C<$scalar, @array> or | |
2015 | hashes being returned). Now a more general fix has been applied | |
2016 | [perl #23790]. | |
a14d7d4a | 2017 | |
77649ca9 RS |
2018 | =item * |
2019 | ||
2020 | Method calls whose arguments were all surrounded with C<my()> or C<our()> | |
2021 | (as in C<< $object->method(my($a,$b)) >>) used to force lvalue context on | |
2022 | the subroutine. This would prevent lvalue methods from returning certain | |
2023 | values. | |
2024 | ||
4ad239c3 FC |
2025 | =item * |
2026 | ||
2027 | Lvalue sub calls that are not determined to be such at compile time | |
2028 | (C<&$name> or &{"name"}) are no longer exempt from strict refs if they | |
2029 | occur in the last statement of an lvalue subroutine [perl #102486]. | |
2030 | ||
2031 | =item * | |
2032 | ||
2033 | Sub calls whose subs are not visible at compile time, if | |
2034 | they occurred in the last statement of an lvalue subroutine, | |
2035 | would reject non-lvalue subroutines and die with "Can't modify non-lvalue | |
2036 | subroutine call" [perl #102486]. | |
2037 | ||
2038 | Non-lvalue sub calls whose subs I<are> visible at compile time exhibited | |
2039 | the opposite bug. If the call occurred in the last statement of an lvalue | |
2040 | subroutine, there would be no error when the lvalue sub was called in | |
2041 | lvalue context. Perl would blindly assign to the temporary value returned | |
2042 | by the non-lvalue subroutine. | |
2043 | ||
2044 | =item * | |
2045 | ||
2046 | C<AUTOLOAD> routines used to take precedence over the actual sub being | |
2047 | called (i.e., when autoloading wasn't needed), for sub calls in lvalue or | |
2048 | potential lvalue context, if the subroutine was not visible at compile | |
2049 | time. | |
2050 | ||
2051 | =item * | |
2052 | ||
0fe29a63 FC |
2053 | Applying the C<:lvalue> attribute to an XSUB or to an aliased subroutine |
2054 | stub with C<< sub foo :lvalue; >> syntax stopped working in Perl 5.12. | |
2055 | This has been fixed. | |
2056 | ||
2057 | =item * | |
2058 | ||
4ad239c3 FC |
2059 | Applying the :lvalue attribute to subroutine that is already defined does |
2060 | not work properly, as the attribute changes the way the sub is compiled. | |
2061 | Hence, Perl 5.12 began warning when an attempt is made to apply the | |
2062 | attribute to an already defined sub. In such cases, the attribute is | |
2063 | discarded. | |
2064 | ||
2065 | But the change in 5.12 missed the case where custom attributes are also | |
2066 | present: that case still silently and ineffectively applied the attribute. | |
2067 | That omission has now been corrected. C<sub foo :lvalue :Whatever> (when | |
2068 | C<foo> is already defined) now warns about the :lvalue attribute, and does | |
2069 | not apply it. | |
2070 | ||
2071 | =item * | |
2072 | ||
2073 | A bug affecting lvalue context propagation through nested lvalue subroutine | |
2074 | calls has been fixed. Previously, returning a value in nested rvalue | |
2075 | context would be treated as lvalue context by the inner subroutine call, | |
2076 | resulting in some values (such as read-only values) being rejected. | |
2077 | ||
a14d7d4a RS |
2078 | =back |
2079 | ||
85adda6e FC |
2080 | =head2 Compile-time hints |
2081 | ||
2082 | =over | |
2083 | ||
2084 | =item * | |
2085 | ||
2086 | Tying C<%^H> no longer causes perl to crash or ignore the contents of | |
2087 | C<%^H> when entering a compilation scope [perl #106282]. | |
2088 | ||
2089 | =item * | |
2090 | ||
9320cecf FC |
2091 | C<eval $string> and C<require> used not to |
2092 | localise C<%^H> when compiling its argument if it | |
85adda6e FC |
2093 | was empty at the time the C<eval> call itself was compiled. This could |
2094 | lead to scary side effects, like C<use re "/m"> enabling other flags that | |
2095 | the surrounding code was trying to enable for its caller [perl #68750]. | |
2096 | ||
2097 | =item * | |
2098 | ||
9320cecf FC |
2099 | C<eval $string> and C<require> no longer localise hints (C<$^H> and C<%^H>) |
2100 | at run time, but only during compilation of the $string or required file. | |
2101 | This makes C<BEGIN { $^H{foo}=7 }> equivalent to | |
2102 | C<BEGIN { eval '$^H{foo}=7' }> [perl #70151]. | |
2103 | ||
2104 | =item * | |
2105 | ||
85adda6e FC |
2106 | Creating a BEGIN block from XS code (via C<newXS> or C<newATTRSUB>) would, |
2107 | on completion, make the hints of the current compiling code the current | |
2108 | hints. This could cause warnings to occur in a non-warning scope. | |
2109 | ||
2110 | =back | |
2111 | ||
3949715f | 2112 | =head2 Fixes related to hashes and arrays |
a14d7d4a RS |
2113 | |
2114 | =over | |
2115 | ||
2116 | =item * | |
2117 | ||
2118 | A bug has been fixed that would cause a "Use of freed value in iteration" | |
2119 | error if the next two hash elements that would be iterated over are | |
2120 | deleted [perl #85026]. (5.14.1) | |
2121 | ||
2122 | =item * | |
2123 | ||
a14d7d4a | 2124 | Deleting the current hash iterator (the hash element that would be returend |
cbd5afc5 FC |
2125 | by the next call to C<each>) in void context used not to free it |
2126 | [perl #85026]. | |
3949715f FC |
2127 | |
2128 | =item * | |
2129 | ||
3949715f FC |
2130 | Deletion of methods via C<delete $Class::{method}> syntax used to update |
2131 | method caches if called in void context, but not scalar or list context. | |
3949715f FC |
2132 | |
2133 | =item * | |
2134 | ||
3949715f FC |
2135 | When hash elements are deleted in void context, the internal hash entry is |
2136 | now freed before the value is freed, to prevent destructors called by that | |
2137 | latter freeing from seeing the hash in an inconsistent state. It was | |
2138 | possible to cause double-frees if the destructor freed the hash itself | |
2139 | [perl #100340]. | |
2140 | ||
2141 | =item * | |
2142 | ||
cbd5afc5 FC |
2143 | A C<keys> optimisation in Perl 5.12.0 to make it faster on empty hashes |
2144 | caused C<each> not to reset the iterator if called after the last element | |
2145 | was deleted. | |
3949715f | 2146 | |
cbd5afc5 FC |
2147 | =item * |
2148 | ||
2149 | Freeing deeply nested hashes no longer crashes [perl #44225]. | |
3949715f FC |
2150 | |
2151 | =item * | |
2152 | ||
cbd5afc5 FC |
2153 | It is possible from XS code to create hashes with elements that have no |
2154 | values. The hash element and slice operators used to crash | |
2155 | when handling these in lvalue context. They now | |
2156 | produce a "Modification of non-creatable hash value attempted" error | |
2157 | message. | |
2158 | ||
2159 | =item * | |
2160 | ||
2161 | If list assignment to a hash or array triggered destructors that freed the | |
2162 | hash or array itself, a crash would ensue. This is no longer the case | |
2163 | [perl #107440]. | |
3949715f FC |
2164 | |
2165 | =item * | |
2166 | ||
2167 | It used to be possible to free the typeglob of a localised array or hash | |
2168 | (e.g., C<local @{"x"}; delete $::{x}>), resulting in a crash on scope exit. | |
2169 | ||
a14d7d4a RS |
2170 | =back |
2171 | ||
12fab0b9 FC |
2172 | =head2 Weak references |
2173 | ||
2174 | =over | |
2175 | ||
2176 | =item * | |
2177 | ||
2178 | Weakening the first argument to an automatically-invoked C<DESTROY> method | |
2179 | could result in erroneous "DESTROY created new reference" errors or | |
2180 | crashes. Now it is an error to weaken a read-only reference. | |
2181 | ||
2182 | =item * | |
2183 | ||
2184 | Weak references to lexical hashes going out of scope were not going stale | |
2185 | (becoming undefined), but continued to point to the hash. | |
2186 | ||
2187 | =item * | |
2188 | ||
2189 | Weak references to lexical variables going out of scope are now broken | |
2190 | before any magical methods (e.g., DESTROY on a tie object) are called. | |
2191 | This prevents such methods from modifying the variable that will be seen | |
2192 | the next time the scope is entered. | |
2193 | ||
2194 | =item * | |
2195 | ||
2196 | Creating a weak reference to an @ISA array or accessing the array index | |
2197 | (C<$#ISA>) could result in confused internal bookkeeping for elements | |
2198 | subsequently added to the @ISA array. For instance, creating a weak | |
2199 | reference to the element itself could push that weak reference on to @ISA; | |
2200 | and elements added after use of C<$#ISA> would be ignored by method lookup | |
2201 | [perl #85670]. | |
2202 | ||
2203 | =back | |
2204 | ||
c99e5913 | 2205 | =head2 Support for embedded nulls |
021c503d RS |
2206 | |
2207 | Some parts of Perl did not work correctly with nulls (C<chr 0>) embedded in | |
2208 | strings. That meant that, for instance, C<< $m = "a\0b"; foo->$m >> would | |
2209 | call the "a" method, instead of the actual method name contained in $m. | |
2210 | These parts of perl have been fixed to support nulls: | |
2211 | ||
2212 | =over | |
2213 | ||
2214 | =item * | |
2215 | ||
2216 | Method names | |
2217 | ||
2218 | =item * | |
2219 | ||
bf90dc88 | 2220 | Typeglob names (including filehandle and subroutine names) |
021c503d RS |
2221 | |
2222 | =item * | |
2223 | ||
bf90dc88 | 2224 | Package names, including the return value of C<ref()> |
021c503d RS |
2225 | |
2226 | =item * | |
2227 | ||
2228 | Typeglob elements (C<*foo{"THING\0stuff"}>) | |
2229 | ||
2230 | =item * | |
2231 | ||
2232 | Signal names | |
2233 | ||
2234 | =item * | |
2235 | ||
2236 | Various warnings and error messages that mention variable names or values, | |
2237 | methods, etc. | |
2238 | ||
2239 | =back | |
2240 | ||
2241 | One side effect of these changes is that blessing into "\0" no longer | |
2242 | causes C<ref()> to return false. | |
2243 | ||
200b6340 FC |
2244 | =head2 Filetests and C<stat> |
2245 | ||
2246 | The term "filetests" refers to the operators that consist of a hyphen | |
2247 | followed by a single letter: C<-r>, C<-x>, C<-M>, etc. The term "stacked" | |
2248 | when applied to filetests means followed by another filetest operator | |
2249 | sharing the same operand, as in C<-r -x -w $fooo>. | |
2250 | ||
2251 | =over | |
2252 | ||
2253 | =item * | |
2254 | ||
d2b8dc24 FC |
2255 | C<stat> produces more consistent warnings. It no longer warns for "_" |
2256 | [perl #71002] and no longer skips the warning at times for other unopened | |
2257 | handles. | |
200b6340 FC |
2258 | |
2259 | =item * | |
2260 | ||
d2b8dc24 FC |
2261 | C<-T _> with no preceding C<stat> used to produce a |
2262 | confusing "uninitialized" warning, even though there | |
200b6340 FC |
2263 | is no visible uninitialized value to speak of. |
2264 | ||
2265 | =item * | |
2266 | ||
d2b8dc24 FC |
2267 | C<-T>, C<-B> and C<-t> now work when stacked with other filetest operators |
2268 | [perl #77388]. | |
200b6340 FC |
2269 | |
2270 | =item * | |
2271 | ||
2272 | Stacked filetest operators now only call FETCH once on a tied argument. | |
2273 | ||
2274 | =item * | |
2275 | ||
200b6340 FC |
2276 | Perl keeps several internal variables to keep track of the last stat |
2277 | buffer, from which file(handle) it originated, what type it was, and | |
2278 | whether the last stat succeeded. | |
2279 | ||
2280 | There were various cases where these could get out of synch, resulting in | |
2281 | inconsistent or erratic behaviour in edge cases (every mention of C<-T> | |
2282 | applies to C<-B> as well): | |
2283 | ||
2284 | =over | |
2285 | ||
2286 | =item * | |
2287 | ||
2288 | C<-T I<HANDLE>>, even though it does a C<stat>, was not resetting the last | |
2289 | stat type, so an C<lstat _> following it would merrily return the wrong | |
2290 | results. Also, it was not setting the success status. | |
2291 | ||
2292 | =item * | |
2293 | ||
2294 | Freeing the handle last used by C<stat> or a filetest could result in | |
2295 | S<C<-T _>> using an unrelated handle. | |
2296 | ||
2297 | =item * | |
2298 | ||
d2b8dc24 FC |
2299 | C<stat> with an IO reference would not reset the stat type or record the |
2300 | filehandle for S<C<-T _>> to use. | |
200b6340 FC |
2301 | |
2302 | =item * | |
2303 | ||
d2b8dc24 | 2304 | Fatal warnings could cause the stat buffer not to be reset |
200b6340 | 2305 | for a filetest operator on an unopened filehandle or C<-l> on any handle. |
d2b8dc24 | 2306 | Fatal warnings also stopped C<-T> from setting C<$!>. |
200b6340 FC |
2307 | |
2308 | =item * | |
2309 | ||
2310 | When the last stat was on an unreadable file, C<-T _> is supposed to | |
2311 | return C<undef>, leaving the last stat buffer unchanged. But it was | |
2312 | setting the stat type, causing C<lstat _> to stop working. | |
2313 | ||
2314 | =item * | |
2315 | ||
2316 | C<-T I<FILENAME>> was not resetting the internal stat buffers for | |
2317 | unreadable files. | |
2318 | ||
2319 | =back | |
2320 | ||
2321 | These have all been fixed. | |
2322 | ||
2323 | =item * | |
2324 | ||
2325 | C<stat I<HANDLE>> and fstat failures | |
2326 | ||
2327 | If the operating system's C<fstat> function failed, C<stat> would warn | |
2328 | about an unopened handle, even though that was not the case. This has been | |
2329 | fixed. | |
2330 | ||
2331 | =item * | |
2332 | ||
2333 | C<lstat I<IOREF>> | |
2334 | ||
2335 | C<lstat> is documented to fall back to C<stat> (with a warning) when given | |
2336 | a filehandle. When passed an IO reference, it was actually doing the | |
2337 | equivalent of S<C<stat _>> and ignoring the handle. | |
2338 | ||
2339 | =item * | |
2340 | ||
2341 | stat() would always return the inode number as an IV, even when the | |
2342 | original was unsigned, or too large to fit in an IV. stat() now | |
2343 | returns the inode number as the type that would best preserve the | |
2344 | original value. [perl #84590] | |
2345 | ||
2346 | =item * | |
2347 | ||
2348 | In 5.14.0, filetest ops (C<-r>, C<-x>, etc.) started calling FETCH on a | |
2349 | tied argument belonging to the previous argument to a list operator, if | |
2350 | called with a bareword argument or no argument at all. This has been | |
2351 | fixed, so C<push @foo, $tied, -r> no longer calls FETCH on C<$tied>. | |
2352 | ||
2353 | =item * | |
2354 | ||
2355 | Stacked C<-l> (followed immediately by other filetest operators) did not | |
2356 | work previously; now it does. It is only permitted when the rightmost | |
2357 | filetest op has the special "_" handle for its argument and the most | |
2358 | recent C<stat>/C<lstat> call was an C<lstat>. | |
2359 | ||
2360 | =item * | |
2361 | ||
2362 | In Perl 5.6, C<-l> followed by anything other than a bareword would treat | |
2363 | its argument as a file name. That was changed in 5.8 for glob references | |
2364 | (C<\*foo>), but not for globs themselves (C<*foo>). C<-l> started | |
2365 | returning C<undef> for glob references without setting the last | |
2366 | stat buffer that the "_" handle uses, but only if warnings | |
2367 | were turned on. With warnings off, it was the same as 5.6. | |
2368 | In other words, it was simply buggy and inconsistent. Now the 5.6 | |
2369 | behaviour has been restored. | |
2370 | ||
2371 | =back | |
2372 | ||
a14d7d4a RS |
2373 | =head2 Other notable fixes |
2374 | ||
2375 | =over | |
2376 | ||
021c503d RS |
2377 | =item * |
2378 | ||
2379 | Last-accessed filehandle | |
2380 | ||
2381 | Perl has an internal variable that stores the last filehandle to be | |
2382 | accessed. It is used by C<$.> and by C<tell> and C<eof> without | |
2383 | arguments. | |
2384 | ||
2385 | It used to be possible to set this internal variable to a glob copy and | |
2386 | then modify that glob copy to be something other than a glob, and still | |
2387 | have the last-accessed filehandle associated with the variable after | |
2388 | assigning a glob to it again: | |
2389 | ||
2390 | my $foo = *STDOUT; # $foo is a glob copy | |
2391 | <$foo>; # $foo is now the last-accessed handle | |
2392 | $foo = 3; # no longer a glob | |
2393 | $foo = *STDERR; # still the last-accessed handle | |
2394 | ||
2395 | Now the C<$foo = 3> assignment unsets that internal variable, so there | |
2396 | is no last-accessed filehandle, just as if C<< <$foo> >> had never | |
2397 | happened. | |
2398 | ||
2399 | =item * | |
cb82babd | 2400 | |
77649ca9 RS |
2401 | C<~~> now correctly handles the precedence of Any~~Object, and is not tricked |
2402 | by an overloaded object on the left-hand side. | |
2403 | ||
2404 | =item * | |
2405 | ||
77649ca9 RS |
2406 | C<quotemeta> now quotes consistently the same non-ASCII characters under |
2407 | C<use feature 'unicode_strings'>, regardless of whether the string is | |
2408 | encoded in UTF-8 or not, hence fixing the last vestiges (we hope) of the | |
2409 | infamous L<perlunicode/The "Unicode Bug">. [perl #77654]. | |
2410 | ||
2411 | Which of these code points is quoted has changed, based on Unicode's | |
2412 | recommendations. See L<perlfunc/quotemeta> for details. | |
2413 | ||
2414 | =item * | |
2415 | ||
021c503d | 2416 | C<~> on vstrings |
cb82babd RS |
2417 | |
2418 | The bitwise complement operator (and possibly other operators, too) when | |
2419 | passed a vstring would leave vstring magic attached to the return value, | |
2420 | even though the string had changed. This meant that | |
2421 | C<< version->new(~v1.2.3) >> would create a version looking like "v1.2.3" | |
2422 | even though the string passed to C<< version->new >> was actually | |
2423 | "\376\375\374". This also caused L<B::Deparse> to deparse C<~v1.2.3> | |
2424 | incorrectly, without the C<~> [perl #29070]. | |
2425 | ||
021c503d RS |
2426 | =item * |
2427 | ||
2428 | Vstrings blowing away magic | |
cb82babd RS |
2429 | |
2430 | Assigning a vstring to a magic (e.g., tied, C<$!>) variable and then | |
2431 | assigning something else used to blow away all the magic. This meant that | |
2432 | tied variables would come undone, C<$!> would stop getting updated on | |
2433 | failed system calls, C<$|> would stop setting autoflush, and other | |
2434 | mischief would take place. This has been fixed. | |
2435 | ||
021c503d RS |
2436 | =item * |
2437 | ||
2438 | C<newHVhv> and tied hashes | |
cb82babd RS |
2439 | |
2440 | The C<newHVhv> XS function now works on tied hashes, instead of crashing or | |
2441 | returning an empty hash. | |
2442 | ||
021c503d RS |
2443 | =item * |
2444 | ||
021c503d | 2445 | No warning for C<open(foo::bar)> |
cb82babd RS |
2446 | |
2447 | When one writes C<open foo || die>, which used to work in Perl 4, a | |
2448 | "Precedence problem" warning is produced. This warning used erroneously to | |
2449 | apply to fully-qualified bareword handle names not followed by C<||>. This | |
2450 | has been corrected. | |
2451 | ||
021c503d RS |
2452 | =item * |
2453 | ||
2454 | C<select> and package aliasing | |
cb82babd RS |
2455 | |
2456 | After package aliasing (C<*foo:: = *bar::>), C<select> with 0 or 1 argument | |
2457 | would sometimes return a name that could not be used to refer to the | |
2458 | filehandle, or sometimes it would return C<undef> even when a filehandle | |
2459 | was selected. Now it returns a typeglob reference in such cases. | |
2460 | ||
021c503d RS |
2461 | =item * |
2462 | ||
2463 | C<PerlIO::get_layers> and tied variables | |
cb82babd RS |
2464 | |
2465 | C<PerlIO::get_layers> no longer ignores FETCH on tied variables as it used | |
2466 | to most of the time [perl #97956]. | |
2467 | ||
021c503d RS |
2468 | =item * |
2469 | ||
2470 | C<PerlIO::get_layers> and numbers | |
cb82babd RS |
2471 | |
2472 | C<PerlIO::get_layers> no longer ignores some arguments that it thinks are | |
2473 | numeric, while treating others as filehandle names. It is now consistent | |
2474 | for flat scalars (i.e., not references). | |
2475 | ||
021c503d RS |
2476 | =item * |
2477 | ||
021c503d | 2478 | C<caller> and tied C<@DB::args> |
cb82babd RS |
2479 | |
2480 | C<caller> sets C<@DB::args> to the subroutine arguments when called from | |
2481 | the DB package. It used to crash when doing so if C<@DB::args> happened to | |
2482 | be tied. Now it croaks instead. | |
2483 | ||
021c503d RS |
2484 | =item * |
2485 | ||
2486 | Tying C<@_> | |
cb82babd RS |
2487 | |
2488 | Under debugging builds, this code: | |
2489 | ||
2490 | sub TIEARRAY{bless[]} | |
2491 | sub { | |
2492 | tie @_, ""; | |
2493 | \@_; | |
2494 | }->(1); | |
2495 | ||
2496 | use to produce an "av_reify called on tied array" warning. It doesn't any | |
2497 | more. | |
2498 | ||
021c503d RS |
2499 | =item * |
2500 | ||
2501 | Unrecognised switches on C<#!> line | |
cb82babd RS |
2502 | |
2503 | If a switch, such as B<-x>, that cannot occur on the C<#!> line is used | |
2504 | there, perl dies with "Can't emulate...". | |
2505 | ||
2506 | It used to produce the same message for switches that perl did not | |
2507 | recognise at all, whether on the command line or the C<#!> line. | |
2508 | ||
2509 | Now it produces the "Unrecognized switch" error message [perl #104288]. | |
2510 | ||
021c503d RS |
2511 | =item * |
2512 | ||
2513 | C<system> and SIGCHLD | |
cb82babd RS |
2514 | |
2515 | C<system> now temporarily blocks the SIGCHLD signal handler, to prevent the | |
2516 | signal handler from stealing the exit status [perl #105700]. | |
2517 | ||
021c503d RS |
2518 | =item * |
2519 | ||
021c503d | 2520 | C<(s)printf>'s %n formatting code |
cb82babd RS |
2521 | |
2522 | The %n formatting code, which causes the number of characters to be | |
2523 | assigned to the next argument to C<printf> or C<sprintf> now actually | |
2524 | assigns the number of characters, instead of the number of bytes. | |
2525 | ||
2526 | It also works now with special lvalue functions like C<substr> and with | |
2527 | nonexistent hash and array elements [perl #3471, #103492]. | |
2528 | ||
021c503d RS |
2529 | =item * |
2530 | ||
2531 | Typeglobs and threads | |
cb82babd RS |
2532 | |
2533 | Typeglobs returned from threads are no longer cloned if the parent thread | |
2534 | already has a glob with the same name. This means that returned | |
2535 | subroutines will now assign to the right package variables [perl #107366]. | |
2536 | ||
021c503d RS |
2537 | =item * |
2538 | ||
2539 | C<local $_> | |
cb82babd RS |
2540 | |
2541 | In Perl 5.14, C<local $_> was changed to create a new variable not tied to | |
2542 | anything, even if $_ was tied before that. But, due to an oversight, it | |
2543 | would still call FETCH once on a tied $_ before replacing it with the new | |
2544 | variable. This has been fixed [perl #105912]. | |
2545 | ||
021c503d RS |
2546 | =item * |
2547 | ||
2548 | Returning tied variables | |
cb82babd RS |
2549 | |
2550 | When returning a value from a non-lvalue subroutine, Perl copies the value. | |
2551 | Sometimes it cheats for the sake of speed, and does not copy the value if | |
2552 | it makes no observable difference. This optimisation was erroneously | |
2553 | allowing the copy to be skipped on tied variables, causing a difference in | |
2554 | behaviour depending on the tied variable's reference count. This has been | |
2555 | fixed [perl #95548]. | |
2556 | ||
021c503d | 2557 | =item * |
cb82babd RS |
2558 | |
2559 | C<utf8::decode> now refuses to modify read-only scalars [perl #91850]. | |
2560 | ||
021c503d RS |
2561 | =item * |
2562 | ||
2563 | C<dbmopen> with undefined mode | |
cb82babd RS |
2564 | |
2565 | C<dbmopen> now only warns once, rather than three times, if the mode | |
2566 | argument is C<undef> [perl #90064]. | |
2567 | ||
021c503d RS |
2568 | =item * |
2569 | ||
021c503d | 2570 | DELETE on scalar ties |
cb82babd RS |
2571 | |
2572 | Tying an element of %ENV or C<%^H> and then deleting that element would | |
2573 | result in a call to the tie object's DELETE method, even though tying the | |
2574 | element itself is supposed to be equivalent to tying a scalar (the element | |
2575 | is, of course, a scalar) [perl #67490]. | |
2576 | ||
021c503d RS |
2577 | =item * |
2578 | ||
2579 | Freeing $_ inside C<grep> or C<map> | |
cb82babd RS |
2580 | |
2581 | Freeing $_ inside a C<grep> or C<map> block or a code block embedded in a | |
2582 | regular expression used to result in double frees [perl #92254, #92256]. | |
2583 | ||
021c503d RS |
2584 | =item * |
2585 | ||
2586 | Warnings with C<+=> | |
cb82babd RS |
2587 | |
2588 | The C<+=> operator does not usually warn when the left-hand side is | |
2589 | C<undef>, but it was doing so for tied variables. This has been fixed | |
2590 | [perl #44895]. | |
2591 | ||
021c503d RS |
2592 | =item * |
2593 | ||
2594 | Tying and autovivification | |
cb82babd RS |
2595 | |
2596 | When Perl autovivifies an element of a tied array or hash (which entails | |
2597 | calling STORE with a new reference), it now calls FETCH immediately after | |
2598 | the STORE, instead of assuming that FETCH would have returned the same | |
2599 | reference. This can make it easier to implement tied objects [perl #35865, #43011]. | |
2600 | ||
021c503d RS |
2601 | =item * |
2602 | ||
2603 | C<@&> and C<$&> | |
cb82babd RS |
2604 | |
2605 | Mentioning a variable named "&" other than C<$&> (i.e., C<@&> or C<%&>) no | |
2606 | longer stops C<$&> from working. The same applies to variables named "'" | |
2607 | and "`" [perl #24237]. | |
2608 | ||
021c503d RS |
2609 | =item * |
2610 | ||
021c503d | 2611 | Bitwise assignment operators and copy-on-write |
cb82babd RS |
2612 | |
2613 | In 5.14.0, the bitwise assignment operators C<|=>, C<^=> and C<&=> started | |
2614 | leaving the left-hand side undefined if it happened to be a copy-on-write | |
2615 | string. This has been fixed [perl #108480]. | |
2616 | ||
021c503d RS |
2617 | =item * |
2618 | ||
2619 | Three problematic Unicode characters now work better in regex pattern matching under C</i> | |
cb82babd RS |
2620 | |
2621 | In the past, three Unicode characters: | |
2622 | LATIN SMALL LETTER SHARP S, | |
2623 | GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS, | |
2624 | and | |
2625 | GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS, | |
2626 | along with the sequences that they fold to | |
2627 | (including "ss" in the case of LATIN SMALL LETTER SHARP S), | |
2628 | did not properly match under C</i>. 5.14.0 fixed some of these cases, | |
2629 | but introduced others, including a panic when one of the characters or | |
2630 | sequences was used in the C<(?(DEFINE)> regular expression predicate. | |
2631 | The known bugs that were introduced in 5.14 have now been fixed; as well | |
2632 | as some other edge cases that have never worked until now. All these | |
2633 | involve using the characters and sequences outside bracketed character | |
2634 | classes under C</i>. This closes [perl #98546]. | |
2635 | ||
2636 | There remain known problems when using certain characters with | |
2637 | multi-character folds inside bracketed character classes, including such | |
2638 | constructs as C<qr/[\N{LATIN SMALL LETTER SHARP}a-z]/i>. These | |
2639 | remaining bugs are addressed in [perl #89774]. | |
2640 | ||
a14d7d4a RS |
2641 | =item * |
2642 | ||
412912b6 RS |
2643 | RT #78266: The regex engine has been leaking memory when accessing |
2644 | named captures that weren't matched as part of a regex ever since 5.10 | |
2645 | when they were introduced, e.g. this would consume over a hundred MB of | |
2646 | memory: | |
2647 | ||
2648 | for (1..10_000_000) { | |
2649 | if ("foo" =~ /(foo|(?<capture>bar))?/) { | |
2650 | my $capture = $+{capture} | |
2651 | } | |
2652 | } | |
2653 | system "ps -o rss $$"' | |
2654 | ||
2655 | =item * | |
2656 | ||
2657 | A constant subroutine assigned to a glob whose name contains a null | |
2658 | will no longer cause extra globs to pop into existence when the | |
2659 | constant is referenced under its new name. | |
2660 | ||
2661 | =item * | |
2662 | ||
2663 | C<sort> was not treating C<sub {}> and C<sub {()}> as equivalent when | |
2664 | such a sub was provided as the comparison routine. It used to croak on | |
2665 | C<sub {()}>. | |
2666 | ||
2667 | =item * | |
2668 | ||
2669 | Subroutines from the C<autouse> namespace are once more exempt from | |
2670 | redefinition warnings. This used to work in 5.005, but was broken in | |
2671 | 5.6 for most subroutines. For subs created via XS that redefine | |
2672 | subroutines from the C<autouse> package, this stopped working in 5.10. | |
2673 | ||
2674 | =item * | |
2675 | ||
2676 | New XSUBs now produce redefinition warnings if they overwrite existing | |
2677 | subs, as they did in 5.8.x. (The C<autouse> logic was reversed in | |
2678 | 5.10-14. Only subroutines from the C<autouse> namespace would warn | |
2679 | when clobbered.) | |
2680 | ||
2681 | =item * | |
2682 | ||
412912b6 RS |
2683 | C<newCONSTSUB> used to use compile-time warning hints, instead of |
2684 | run-time hints. The following code should never produce a redefinition | |
2685 | warning, but it used to, if C<newCONSTSUB> redefined an existing | |
2686 | subroutine: | |
2687 | ||
2688 | use warnings; | |
2689 | BEGIN { | |
2690 | no warnings; | |
2691 | some_XS_function_that_calls_new_CONSTSUB(); | |
2692 | } | |
2693 | ||
2694 | =item * | |
2695 | ||
2696 | Redefinition warnings for constant subroutines are on by default (what | |
2697 | are known as severe warnings in L<perldiag>). This was only the case | |
2698 | when it was a glob assignment or declaration of a Perl subroutine that | |
2699 | caused the warning. If the creation of XSUBs triggered the warning, it | |
2700 | was not a default warning. This has been corrected. | |
2701 | ||
2702 | =item * | |
2703 | ||
2704 | The internal check to see whether a redefinition warning should occur | |
2705 | used to emit "uninitialized" warnings in cases like this: | |
2706 | ||
2707 | use warnings "uninitialized"; | |
2708 | use constant {u => undef, v => undef}; | |
2709 | sub foo(){u} | |
2710 | sub foo(){v} | |
2711 | ||
2712 | =item * | |
2713 | ||
2714 | A bug fix in Perl 5.14 introduced a new bug, causing "uninitialized" | |
2715 | warnings to report the wrong variable if the operator in question had | |
2716 | two operands and one was C<%{...}> or C<@{...}>. This has been fixed | |
2717 | [perl #103766]. | |
2718 | ||
2719 | =item * | |
2720 | ||
2721 | C<< version->new("version") >> and C<printf "%vd", "version"> no longer | |
2722 | crash [perl #102586]. | |
2723 | ||
2724 | =item * | |
2725 | ||
2726 | C<$tied =~ y/a/b/>, C<chop $tied> and C<chomp $tied> now call FETCH | |
2727 | just once when $tied holds a reference. | |
2728 | ||
2729 | =item * | |
2730 | ||
2731 | Four-argument C<select> now always calls FETCH on tied arguments. It | |
2732 | used to skip the call if the tied argument happened to hold C<undef> or | |
2733 | a typeglob. | |
2734 | ||
2735 | =item * | |
2736 | ||
2737 | Four-argument C<select> no longer produces its "Non-string passed as | |
2738 | bitmask" warning on tied or tainted variables that are strings. | |
2739 | ||
2740 | =item * | |
2741 | ||
2742 | C<sysread> now always calls FETCH on the buffer passed to it if the | |
2743 | buffer is tied. It used to skip the call if the tied variable happened | |
2744 | to hold a typeglob. | |
2745 | ||
2746 | =item * | |
2747 | ||
2748 | C<< $tied .= <> >> now calls FETCH once on C<$tied>. It used to call | |
2749 | it multiple times if the last value assigned to or returned from the | |
2750 | tied variable was anything other than a string or typeglob. | |
2751 | ||
2752 | =item * | |
2753 | ||
021c503d RS |
2754 | Return value of C<eval> |
2755 | ||
2756 | C<eval> returns C<undef> in scalar context or an empty list in list | |
2757 | context when there is a run-time error. When C<eval> was passed a | |
2758 | string in list context and a syntax error occurred, it used to return a | |
2759 | list containing a single undefined element. Now it returns an empty | |
2760 | list in list context for all errors [perl #80630]. | |
412912b6 RS |
2761 | |
2762 | =item * | |
2763 | ||
2764 | C<goto &func> no longer crashes, but produces an error message, when | |
2765 | the unwinding of the current subroutine's scope fires a destructor that | |
2766 | undefines the subroutine being "goneto" [perl #99850]. | |
2767 | ||
2768 | =item * | |
2769 | ||
2770 | Arithmetic assignment (C<$left += $right>) involving overloaded objects | |
2771 | that rely on the 'nomethod' override no longer segfault when the left | |
2772 | operand is not overloaded. | |
2773 | ||
2774 | =item * | |
2775 | ||
2776 | Assigning C<__PACKAGE__> or any other shared hash key scalar to a stash | |
2777 | element no longer causes a double free. Regardless of this change, the | |
2778 | results of such assignments are still undefined. | |
2779 | ||
2780 | =item * | |
2781 | ||
2782 | Assigning C<__PACKAGE__> or another shared hash key string to a | |
2783 | variable no longer stops that variable from being tied if it happens to | |
2784 | be a PVMG or PVLV internally. | |
2785 | ||
2786 | =item * | |
2787 | ||
2788 | Creating a C<UNIVERSAL::AUTOLOAD> sub no longer stops C<%+>, C<%-> and | |
2789 | C<%!> from working some of the time [perl #105024]. | |
2790 | ||
2791 | =item * | |
2792 | ||
2793 | When presented with malformed UTF-8 input, the XS-callable functions | |
2794 | C<is_utf8_string()>, C<is_utf8_string_loc()>, and | |
2795 | C<is_utf8_string_loclen()> could read beyond the end of the input | |
2796 | string by up to 12 bytes. This no longer happens. [perl #32080]. | |
2797 | However, currently, C<is_utf8_char()> still has this defect, see | |
2798 | L</is_utf8_char()> above. | |
2799 | ||
2800 | =item * | |
2801 | ||
2802 | Doing a substitution on a tied variable returning a copy-on-write | |
2803 | scalar used to cause an assertion failure or an "Attempt to free | |
2804 | nonexistent shared string" warning. | |
2805 | ||
2806 | =item * | |
2807 | ||
412912b6 RS |
2808 | The debugger no longer tries to do C<local $_> when dumping data |
2809 | structures. | |
2810 | ||
2811 | =item * | |
2812 | ||
2813 | Calling C<readline($fh)> where $fh is a glob copy (e.g., after C<$fh = | |
2814 | *STDOUT>), assigning something other than a glob to $fh, and then | |
2815 | freeing $fh (e.g., by leaving the scope where it is defined) no longer | |
2816 | causes the internal variable used by C<$.> (C<PL_last_in_gv>) to point | |
2817 | to a freed scalar, that could be reused for some other glob, causing | |
2818 | C<$.> to use some unrelated filehandle [perl #97988]. | |
2819 | ||
2820 | =item * | |
2821 | ||
2822 | A regression in 5.14 caused these statements not to set the internal | |
2823 | variable that holds the handle used by C<$.>: | |
2824 | ||
2825 | my $fh = *STDOUT; | |
2826 | tell $fh; | |
2827 | eof $fh; | |
2828 | seek $fh, 0,0; | |
2829 | tell *$fh; | |
2830 | eof *$fh; | |
2831 | seek *$fh, 0,0; | |
2832 | readline *$fh; | |
2833 | ||
2834 | This is now fixed, but C<tell *{ *$fh }> still has the problem, and it | |
2835 | is not clear how to fix it [perl #106536]. | |
2836 | ||
2837 | =item * | |
2838 | ||
2839 | Version comparisons, such as those that happen implicitly with C<use | |
2840 | v5.43>, no longer cause locale settings to change [perl #105784]. | |
2841 | ||
2842 | =item * | |
2843 | ||
b325a3a2 RS |
2844 | Perl now holds an extra reference count on the package that code is |
2845 | currently compiling in. This means that the following code no longer crashes [perl #101486]: | |
2846 | ||
2847 | package Foo; | |
2848 | BEGIN {*Foo:: = *Bar::} | |
2849 | sub foo; | |
2850 | ||
2851 | =item * | |
2852 | ||
2853 | F<dumpvar.pl>, and consequently the C<x> command in the debugger, have been | |
2854 | fixed to handle objects blessed into classes whose names contain "=". The | |
2855 | contents of such objects used not to be dumped [perl #101814]. | |
2856 | ||
2857 | =item * | |
2858 | ||
2859 | The C<x> repetition operator no longer crashes on 64-bit builds with large | |
2860 | repeat counts [perl #94560]. | |
2861 | ||
2862 | =item * | |
2863 | ||
b325a3a2 RS |
2864 | On OSes other than VMS, Perl's C<glob> operator (and the C<< <...> >> form) |
2865 | use L<File::Glob> underneath. L<File::Glob> splits the pattern into words, | |
2866 | before feeding each word to its C<bsd_glob> function. | |
2867 | ||
2868 | There were several inconsistencies in the way the split was done. Now | |
2869 | quotation marks (' and ") are always treated as shell-style word delimiters | |
2870 | (that allow whitespace as part of a word) and backslashes are always | |
2871 | preserved, unless they exist to escape quotation marks. Before, those | |
2872 | would only sometimes be the case, depending on whether the pattern | |
2873 | contained whitespace. Also, escaped whitespace at the end of the pattern | |
2874 | is no longer stripped [perl #40470]. | |
2875 | ||
2876 | =item * | |
2877 | ||
2878 | C<CORE::glob> now works as a way to call the default globbing function. It | |
2879 | used to respect overrides, despite the C<CORE::> prefix. | |
2880 | ||
2881 | =item * | |
2882 | ||
2883 | In 5.14, C</[[:lower:]]/i> and C</[[:upper:]]/i> no longer matched the | |
2884 | opposite case. This has been fixed [perl #101970]. | |
2885 | ||
2886 | =item * | |
2887 | ||
2888 | A regular expression match with an overloaded object on the right-hand side | |
2889 | would in some cases stringify the object too many times. | |
2890 | ||
2891 | =item * | |
2892 | ||
2893 | The C-level C<pregcomp> function could become confused as to whether the | |
2894 | pattern was in UTF8 if the pattern was an overloaded, tied, or otherwise | |
2895 | magical scalar [perl #101940]. | |
2896 | ||
2897 | =item * | |
2898 | ||
2899 | A regression has been fixed that was introduced in 5.14, in C</i> | |
2900 | regular expression matching, in which a match improperly fails if the | |
2901 | pattern is in UTF-8, the target string is not, and a Latin-1 character | |
5f81abda FC |
2902 | precedes a character in the string that should match the pattern. |
2903 | [perl #101710] | |
b325a3a2 RS |
2904 | |
2905 | =item * | |
2906 | ||
b325a3a2 RS |
2907 | The C<#line 42 foo> directive used not to update the arrays of lines used |
2908 | by the debugger if it occurred in a string eval. This was partially fixed | |
2909 | in 5.14, but it only worked for a single C<#line 42 foo> in each eval. Now | |
2910 | it works for multiple. | |
2911 | ||
2912 | =item * | |
2913 | ||
b325a3a2 RS |
2914 | When subroutine calls are intercepted by the debugger, the name of the |
2915 | subroutine or a reference to it is stored in C<$DB::sub>, for the debugger | |
2916 | to access. In some cases (such as C<$foo = *bar; undef *bar; &$foo>) | |
2917 | C<$DB::sub> would be set to a name that could not be used to find the | |
2918 | subroutine, and so the debugger's attempt to call it would fail. Now the | |
2919 | check to see whether a reference is needed is more robust, so those | |
2920 | problems should not happen anymore [rt.cpan.org #69862]. | |
2921 | ||
2922 | =item * | |
2923 | ||
2924 | Localising a tied scalar that returns a typeglob no longer stops it from | |
2925 | being tied till the end of the scope. | |
2926 | ||
2927 | =item * | |
2928 | ||
2929 | When C<open> is called with three arguments, the third being a file handle | |
2930 | (as in C<< open $fh, ">&", $fh2 >>), if the third argument is tied or a | |
2931 | reference to a tied variable, FETCH is now called exactly once, instead of | |
2932 | 0, 2, or 3 times (all of which could occur in various circumstances). | |
2933 | ||
2934 | =item * | |
2935 | ||
2936 | C<sort> no longer ignores FETCH when passed a reference to a tied glob for | |
2937 | the comparison routine. | |
2938 | ||
2939 | =item * | |
2940 | ||
2941 | Warnings emitted by C<sort> when a custom comparison routine returns a | |
2942 | non-numeric value now show the line number of the C<sort> operator, rather | |
2943 | than the last line of the comparison routine. The warnings also occur now | |
2944 | only if warnings are enabled in the scope where C<sort> occurs. Previously | |
2945 | the warnings would occur if enabled in the comparison routine's scope. | |
2946 | ||
2947 | =item * | |
2948 | ||
2949 | C<Internals::SvREFCNT> now behaves consistently in 'get' and 'set' scenarios | |
2950 | [perl #103222] and also treats the reference count as unsigned. | |
2951 | ||
2952 | =item * | |
2953 | ||
2954 | Calling C<require> on an implicit C<$_> when C<*CORE::GLOBAL::require> has | |
2955 | been overridden does not segfault anymore, and C<$_> is now passed to the | |
2956 | overriding subroutine [perl #78260]. | |
2957 | ||
2958 | =item * | |
2959 | ||
12477442 RS |
2960 | In Perl 5.14.0, C<$tainted ~~ @array> stopped working properly. Sometimes |
2961 | it would erroneously fail (when C<$tainted> contained a string that occurs | |
2962 | in the array I<after> the first element) or erroneously succeed (when | |
2963 | C<undef> occurred after the first element) [perl #93590]. | |
2964 | ||
2965 | =item * | |
2966 | ||
12477442 RS |
2967 | C<use> and C<require> are no longer affected by the I/O layers active in |
2968 | the caller's scope (enabled by L<open.pm|open>) [perl #96008]. | |
2969 | ||
2970 | =item * | |
2971 | ||
2972 | Errors that occur when methods cannot be found during overloading now | |
2973 | mention the correct package name, as they did in 5.8.x, instead of | |
2974 | erroneously mentioning the "overload" package, as they have since 5.10.0. | |
2975 | ||
2976 | =item * | |
2977 | ||
2978 | Undefining C<%overload::> no longer causes a crash. | |
2979 | ||
2980 | =item * | |
2981 | ||
2982 | C<our $::Ć©; $Ć©> (which is invalid) no longer produces the "Compilation | |
2983 | error at lib/utf8_heavy.pl..." error message, which it started emitting in | |
2984 | 5.10.0 [perl #99984]. | |
2985 | ||
2986 | =item * | |
2987 | ||
12477442 RS |
2988 | In case-insensitive regular expression pattern matching, no longer on |
2989 | UTF-8 encoded strings does the scan for the start of match only look at | |
2990 | the first possible position. This caused matches such as | |
2991 | C<"f\x{FB00}" =~ /ff/i> to fail. | |
2992 | ||
2993 | =item * | |
2994 | ||
2995 | On 64-bit systems, C<read()> now understands large string offsets beyond | |
2996 | the 32-bit range. | |
2997 | ||
2998 | =item * | |
2999 | ||
3000 | Errors that occur when processing subroutine attributes no longer cause the | |
3001 | subroutine's op tree to leak. | |
3002 | ||
3003 | =item * | |
3004 | ||
3005 | C<sort> now works once more with custom sort routines that are XSUBs. It | |
3006 | stopped working in 5.10.0. | |
3007 | ||
3008 | =item * | |
3009 | ||
3010 | C<sort> with a constant for a custom sort routine, although it produces | |
3011 | unsorted results, no longer crashes. It started crashing in 5.10.0. | |
3012 | ||
3013 | =item * | |
3014 | ||
3015 | Warnings produced when a custom sort routine returns a non-numeric value | |
3016 | now contain "in sort"; e.g., "Use of uninitialized value in sort". | |
3017 | ||
3018 | =item * | |
3019 | ||
3020 | C<< sort { $a <=> $b } >>, which is optimised internally, now produces | |
3021 | "uninitialized" warnings for NaNs (not-a-number values), since C<< <=> >> | |
3022 | returns C<undef> for those. This brings it in line with | |
3023 | S<C<< sort { 1; $a <=> $b } >>> and other more complex cases, which are not | |
3024 | optimised [perl #94390]. | |
3025 | ||
3026 | =item * | |
3027 | ||
3028 | C<..> and C<...> in list context now call FETCH only once on tied | |
3029 | arguments, instead of three or four times [perl #53554]. | |
3030 | ||
3031 | =item * | |
3032 | ||
3033 | C<..> and C<...> in list context now mention the name of the variable in | |
3034 | "uninitialized" warnings for string (as opposed to numeric) ranges. | |
3035 | ||
3036 | =item * | |
3037 | ||
a14d7d4a RS |
3038 | Passing the same constant subroutine to both C<index> and C<formline> no |
3039 | longer causes one or the other to fail [perl #89218]. (5.14.1) | |
3040 | ||
3041 | =item * | |
3042 | ||
3043 | List assignment to lexical variables declared with attributes in the same | |
3044 | statement (C<my ($x,@y) : blimp = (72,94)>) stopped working in Perl 5.8.0. | |
3045 | It has now been fixed. | |
3046 | ||
3047 | =item * | |
3048 | ||
3049 | Perl 5.10.0 introduced some faulty logic that made "U*" in the middle of | |
3050 | a pack template equivalent to "U0" if the input string was empty. This has | |
3051 | been fixed [perl #90160]. | |
3052 | ||
3053 | =item * | |
3054 | ||
3055 | Destructors on objects were not called during global destruction on objects | |
3056 | that were not referenced by any scalars. This could happen if an array | |
3057 | element were blessed (e.g., C<bless \$a[0]>) or if a closure referenced a | |
3058 | blessed variable (C<bless \my @a; sub foo { @a }>). | |
3059 | ||
3060 | Now there is an extra pass during global destruction to fire destructors on | |
3061 | any objects that might be left after the usual passes that check for | |
3062 | objects referenced by scalars [perl #36347]. | |
3063 | ||
3064 | This bug fix was added in Perl 5.13.9, but caused problems with some CPAN | |
3065 | modules that were relying on the bug. Since it was so close to Perl | |
3066 | 5.14.0, the fix was reverted in 5.13.10, to allow more time for the modules | |
3067 | to adapt. Hopefully they will be fixed soon (see L</Known Problems>, | |
3068 | below). | |
3069 | ||
3070 | =item * | |
3071 | ||
3072 | C<given> was not calling set-magic on the implicit lexical C<$_> that it | |
3073 | uses. This meant, for example, that C<pos> would be remembered from one | |
3074 | execution of the same C<given> block to the next, even if the input were a | |
3075 | different variable [perl #84526]. | |
3076 | ||
3077 | =item * | |
3078 | ||
3079 | The "R" command for restarting a debugger session has been fixed to work on | |
3080 | Windows, or any other system lacking a C<POSIX::_SC_OPEN_MAX> constant | |
3081 | [perl #87740]. | |
3082 | ||
3083 | =item * | |
3084 | ||
3085 | Fixed a case where it was possible that a freed buffer may have been read | |
3086 | from when parsing a here document [perl #90128]. (5.14.1) | |
3087 | ||
3088 | =item * | |
3089 | ||
3090 | The C<study> function could become confused if fed a string longer than | |
021c503d | 3091 | 2**31 characters. Now that it's a no-op, it can't. |
a14d7d4a RS |
3092 | |
3093 | =item * | |
3094 | ||
3095 | C<each(I<ARRAY>)> is now wrapped in C<defined(...)>, like C<each(I<HASH>)>, | |
3096 | inside a C<while> condition [perl #90888]. | |
3097 | ||
3098 | =item * | |
3099 | ||
3100 | In @INC filters (subroutines returned by subroutines in @INC), $_ used to | |
3101 | misbehave: If returned from a subroutine, it would not be copied, but the | |
3102 | variable itself would be returned; and freeing $_ (e.g., with C<undef *_>) | |
3103 | would cause perl to crash. This has been fixed [perl #91880]. | |
3104 | ||
3105 | =item * | |
3106 | ||
3107 | An ASCII single quote (') in a symbol name is meant to be equivalent to a | |
3108 | double colon (::) except at the end of the name. It was not equivalent if | |
3109 | followed by a null character, but now it is [perl #88138]. | |
3110 | ||
3111 | =item * | |
3112 | ||
021c503d RS |
3113 | The abbreviations for four C1 control characters C<MW> C<PM>, C<RI>, and |
3114 | C<ST> were previously unrecognized by C<\N{}>, vianame(), and | |
3115 | string_vianame(). | |
a14d7d4a RS |
3116 | |
3117 | =item * | |
3118 | ||
3119 | Some cases of threads crashing due to memory allocation during cloning have | |
3120 | been fixed [perl #90006]. | |
3121 | ||
3122 | =item * | |
3123 | ||
3124 | Attempting to C<goto> out of a tied handle method used to cause memory | |
3125 | corruption or crashes. Now it produces an error message instead | |
3126 | [perl #8611]. | |
3127 | ||
3128 | =item * | |
3129 | ||
3130 | Perl skips copying values returned from a subroutine if it thinks the value | |
3131 | is not in use elsewhere. Due to faulty logic, this would happen with the | |
3132 | result of C<delete>, C<shift> or C<splice>, even if the result was | |
3133 | referenced elsewhere. So C<< \sub { delete $_[0] }->($x) >> would return a | |
3134 | reference to C<$x>. This has been fixed [perl #91844]. | |
30682cc3 | 3135 | |
ccad93fd RS |
3136 | =item * |
3137 | ||
ccad93fd RS |
3138 | The C<prototype> function no longer dies for the C<__FILE__>, C<__LINE__> |
3139 | and C<__PACKAGE__> directives. It now returns an empty-string prototype | |
3140 | for them, because they are syntactically very similar to nullary functions | |
3141 | like C<time>. | |
3142 | ||
3143 | =item * | |
3144 | ||
3145 | C<prototype> now returns C<undef> for all overridable infix operators, | |
3146 | such as C<eq>, which are not callable in any way resembling functions. | |
3147 | It used to return incorrect prototypes for some and die for others | |
3148 | [perl #94984]. | |
3149 | ||
3150 | =item * | |
3151 | ||
ccad93fd RS |
3152 | Some core bugs affecting L<Hash::Util> have been fixed: locking a hash |
3153 | element that is a glob copy no longer causes subsequent assignment to it to | |
3154 | corrupt the glob, and unlocking a hash element that holds a copy-on-write | |
3155 | scalar no longer causes modifications to that scalar to modify other | |
3156 | scalars that were sharing the same string buffer. | |
3157 | ||
3158 | =item * | |
3159 | ||
3160 | C<when> blocks are now capable of returning variables declared inside the | |
3161 | enclosing C<given> block [perl #93548]. | |
3162 | ||
3163 | =item * | |
3164 | ||
3165 | A problem with context propagation when a C<do> block is an argument to | |
3166 | C<return> has been fixed. It used to cause C<undef> to be returned in | |
3167 | some cases of a C<return> inside an C<if> block which itself is followed by | |
3168 | another C<return>. | |
3169 | ||
3170 | =item * | |
3171 | ||
3172 | Calling C<index> with a tainted constant no longer causes constants in | |
3173 | subsequently compiled code to become tainted [perl #64804]. | |
3174 | ||
3175 | =item * | |
3176 | ||
3177 | Use of lexical (C<my>) variables in code blocks embedded in regular | |
3178 | expressions will no longer result in memory corruption or crashes. | |
3179 | ||
3180 | Nevertheless, these code blocks are still experimental, as there are still | |
3181 | problems with the wrong variables being closed over (in loops for instance) | |
3182 | and with abnormal exiting (e.g., C<die>) causing memory corruption. | |
3183 | ||
3184 | =item * | |
3185 | ||
3186 | The C<SvIsCOW> C macro now returns false for read-only copies of typeglobs, | |
3187 | such as those created by: | |
3188 | ||
3189 | $hash{elem} = *foo; | |
3190 | Hash::Util::lock_value %hash, 'elem'; | |
3191 | ||
3192 | It used to return true. | |
3193 | ||
3194 | =item * | |
3195 | ||
3196 | Assignment to C<$^A> (the format output accumulator) now recalculates | |
3197 | the number of lines output. | |
3198 | ||
3199 | =item * | |
3200 | ||
3201 | The regexp optimiser no longer crashes on debugging builds when merging | |
3202 | fixed-string nodes with inconvenient contents. | |
3203 | ||
94c11dd4 RS |
3204 | =item * |
3205 | ||
3206 | Locking a subroutine (via C<lock &sub>) is no longer a compile-time error | |
3207 | for regular subs. For lvalue subroutines, it no longer tries to return the | |
3208 | sub as a scalar, resulting in strange side effects like C<ref \$_> | |
3209 | returning "CODE" in some instances. | |
3210 | ||
3211 | C<lock &sub> is now a run-time error if L<threads::shared> is loaded (a | |
3212 | no-op otherwise), but that may be rectified in a future version. | |
3213 | ||
3214 | =item * | |
3215 | ||
3216 | The prototypes of several built-in functions--C<getprotobynumber>, C<lock>, | |
3217 | C<not> and C<select>--have been corrected, or at least are now closer to | |
3218 | reality than before. | |
3219 | ||
3220 | =item * | |
3221 | ||
3222 | Most dereferencing operators (C<${}>, etc.) used to call C<FETCH> twice on | |
3223 | a tied operand when doing a symbolic dereference (looking up a variable by | |
3224 | name, which is not permitted under C<use strict 'refs'>). Only C<&{}> did | |
3225 | not have this problem. This has been fixed. | |
3226 | ||
3227 | =item * | |
3228 | ||
94c11dd4 RS |
3229 | A panic involving the combination of the regular expression modifiers |
3230 | C</aa> and the C<\b> escape sequence introduced in 5.14.0 has been | |
3231 | fixed [perl #95964]. | |
3232 | ||
3233 | =item * | |
3234 | ||
94c11dd4 RS |
3235 | The combination of the regular expression modifiers C</aa> and the C<\b> |
3236 | and C<\B> escape sequences did not work properly on UTF-8 encoded | |
3237 | strings. All non-ASCII characters under C</aa> should be treated as | |
3238 | non-word characters, but what was happening was that Unicode rules were | |
3239 | used to determine wordness/non-wordness for non-ASCII characters. This | |
3240 | is now fixed [perl #95968]. | |
3241 | ||
3242 | =item * | |
3243 | ||
3244 | Infinite loops like C<1 while 1> used to stop C<strict 'subs'> mode from | |
3245 | working for the rest of the block.t | |
3246 | ||
3247 | =item * | |
3248 | ||
3249 | The C<\h>, C<\H>, C<\v> and C<\V> regular expression metacharacters used to | |
3250 | cause a panic error message when attempting to match at the end of the | |
3251 | string [perl #96354]. | |
3252 | ||
3253 | =item * | |
3254 | ||
3255 | For list assignments like C<($a,$b) = ($b,$a)>, Perl has to make a copy of | |
3256 | the items on the right-hand side before assignment them to the left. For | |
3257 | efficiency's sake, it assigns the values on the right straight to the items | |
3258 | on the left no variable is mentioned on both sides, as in | |
3259 | C<($a,$b) = ($c,$d)>. The logic for determining when it can cheat was | |
3260 | faulty, in that C<&&> and C<||> on the right-hand side could fool it. So | |
3261 | C<($a,$b) = $some_true_value && ($b,$a)> would end up assigning the value | |
3262 | of C<$b> to both scalars. | |
3263 | ||
3264 | =item * | |
3265 | ||
3266 | Perl no longer tries to apply lvalue context to the string in | |
3267 | C<("string", $variable) ||= 1> (which used to be an error). Since the | |
3268 | left-hand side of C<||=> is evaluated in scalar context, that's a scalar | |
3269 | comma operator, which gives all but the last item void context. There is | |
3270 | no such thing as void lvalue context, so it was a mistake for Perl to try | |
3271 | to force it [perl #96942]. | |
3272 | ||
3273 | =item * | |
3274 | ||
3275 | Every subroutine has a filename associated with it, that the debugger uses. | |
3276 | The one associated with constant subroutines used to be misallocated when | |
3277 | cloned under threads. Consequently, debugging threaded applications could | |
3278 | result in memory corruption [perl #96126]. | |
3279 | ||
3280 | =item * | |
3281 | ||
3282 | C<caller> no longer leaks memory when called from the DB package if | |
3283 | C<@DB::args> was assigned to after the first call to C<caller>. L<Carp> | |
3284 | was triggering this bug [perl #97010]. | |
3285 | ||
4bbade93 | 3286 | =item * |
30682cc3 | 3287 | |
4bbade93 RS |
3288 | C<defined(${"..."})>, C<defined(*{"..."})>, etc., used to |
3289 | return true for most, but not all built-in variables, if | |
3290 | they had not been used yet. Many times that new built-in | |
3291 | variables were added in past versions, this construct was | |
3292 | not taken into account, so this affected C<${^GLOBAL_PHASE}> and | |
3293 | C<${^UTF8CACHE}>, among others. It also used to return false if the | |
8b541984 | 3294 | package name was given as well (C<${"::!"}>) [perl #97978, #97492]. |
4bbade93 RS |
3295 | |
3296 | =item * | |
3297 | ||
3298 | Perl 5.10.0 introduced a similar bug: C<defined(*{"foo"})> where "foo" | |
3299 | represents the name of a built-in global variable used to return false if | |
3300 | the variable had never been used before, but only on the I<first> call. | |
3301 | This, too, has been fixed. | |
3302 | ||
3303 | =item * | |
3304 | ||
3305 | Various functions that take a filehandle argument in rvalue context | |
3306 | (C<close>, C<readline>, etc.) used to call C<FETCH> multiple times, if it | |
3307 | was a tied variable, and warn twice, if it was C<undef> [perl #97482]. | |
3308 | ||
3309 | =item * | |
3310 | ||
3311 | C<close> and similar filehandle functions, when called on built-in global | |
3312 | variables (like C<$+>), used to die if the variable happened to hold the | |
3313 | undefined value, instead of producing the usual "Use of uninitialized | |
3314 | value" warning. | |
3315 | ||
3316 | =item * | |
3317 | ||
3318 | When autovivified file handles were introduced in Perl 5.6.0, C<readline> | |
3319 | was inadvertently made to autovivify when called as C<readline($foo)> (but | |
3320 | not as C<E<lt>$fooE<gt>>). It has now been fixed never to autovivify. | |
3321 | ||
3322 | =item * | |
3323 | ||
3324 | C<defined ${ $tied_variable }> used to call C<FETCH> multiple times, but | |
3325 | now calls it just once. | |
3326 | ||
3327 | =item * | |
3328 | ||
3329 | Some cases of dereferencing a complex expression, such as | |
3330 | C<${ (), $tied } = 1>, used to call C<FETCH> multiple times, but now call | |
3331 | it once. | |
3332 | ||
3333 | =item * | |
3334 | ||
3335 | For a tied variable returning a package name, C<$tied-E<gt>method> used to | |
3336 | call C<FETCH> multiple times (even up to six!), and sometimes would | |
3337 | fail to call the method, due to memory corruption. | |
3338 | ||
3339 | =item * | |
3340 | ||
3341 | Calling an undefined anonymous subroutine (e.g., what $x holds after | |
3342 | C<undef &{$x = sub{}}>) used to cause a "Not a CODE reference" error, which | |
3343 | has been corrected to "Undefined subroutine called" [perl #71154]. | |
3344 | ||
3345 | =item * | |
3346 | ||
3347 | Causing C<@DB::args> to be freed between uses of C<caller> no longer | |
3348 | results in a crash [perl #93320]. | |
3349 | ||
3350 | =item * | |
3351 | ||
3352 | Since 5.6.0, C<*{ ... }> has been inconsistent in how it treats undefined | |
3353 | values. It would die in strict mode or lvalue context for most undefined | |
3354 | values, but would be treated as the empty string (with a warning) for the | |
3355 | specific scalar return by C<undef()> (C<&PL_sv_undef> internally). This | |
3356 | has been corrected. C<undef()> is now treated like other undefined | |
3357 | scalars, as in Perl 5.005. | |
3358 | ||
3359 | =item * | |
3360 | ||
4bbade93 RS |
3361 | C<setpgrp($foo)> used to be equivalent to C<($foo, setpgrp)>, because |
3362 | C<setpgrp> was ignoring its argument if there was just one. Now it is | |
3363 | equivalent to C<setpgrp($foo,0)>. | |
3364 | ||
3365 | =item * | |
30682cc3 | 3366 | |
4bbade93 RS |
3367 | Assignments like C<*$tied = \&{"..."}> and C<*glob = $tied> now call FETCH |
3368 | only once. | |
30682cc3 | 3369 | |
4bbade93 RS |
3370 | =item * |
3371 | ||
3372 | C<chdir>, C<chmod>, C<chown>, C<utime>, C<truncate>, C<stat>, C<lstat> and | |
3373 | the filetest ops (C<-r>, C<-x>, etc.) now always call FETCH if passed a tied | |
3374 | variable as the last argument. They used to ignore tiedness if the last | |
3375 | thing return from or assigned to the variable was a typeglob or reference | |
3376 | to a typeglob. | |
3377 | ||
3378 | =item * | |
3379 | ||
4bbade93 RS |
3380 | If things were arranged in memory the right way, it was possible for |
3381 | thread joining to emit "Attempt to free unreferenced scalar" warnings if | |
3382 | C<caller> had been used from the C<DB> package prior to thread creation, | |
3383 | due to the way pads were reference-counted and cloned [perl #98092]. | |
3384 | ||
3385 | =item * | |
3386 | ||
4bbade93 RS |
3387 | A bug has been fixed that occurs when a tied variable is used as a |
3388 | subroutine reference: if the last thing assigned to or returned from the | |
3389 | variable was a reference or typeglob, the C<\&$tied> could either crash or | |
3390 | return the wrong subroutine. The reference case is a regression introduced | |
3391 | in Perl 5.10.0. For typeglobs, it has probably never worked till now. | |
3392 | ||
3393 | =item * | |
30682cc3 | 3394 | |
4bbade93 RS |
3395 | C<given> was not scoping its implicit $_ properly, resulting in memory |
3396 | leaks or "Variable is not available" warnings [perl #94682]. | |
3397 | ||
3398 | =item * | |
3399 | ||
3400 | C<-l> followed by a bareword no longer "eats" the previous argument to | |
3401 | the list operator in whose argument list it resides. In less convoluted | |
3402 | English: C<print "bar", -l foo> now actually prints "bar", because C<-l> | |
3403 | on longer eats it. | |
3404 | ||
3405 | =item * | |
3406 | ||
4bbade93 RS |
3407 | C<shmread> was not setting the scalar flags correctly when reading from |
3408 | shared memory, causing the existing cached numeric representation in the | |
3409 | scalar to persist [perl #98480]. | |
3410 | ||
3411 | =item * | |
3412 | ||
4bbade93 RS |
3413 | Under miniperl (used to configure modules when perl itself is built), |
3414 | C<glob> now clears %ENV before calling csh, since the latter croaks on some | |
3415 | systems if it does not like the contents of the LS_COLORS enviroment | |
3416 | variable [perl #98662]. | |
3417 | ||
3418 | =item * | |
3419 | ||
3420 | C<++> and C<--> now work on copies of globs, instead of dying. | |
3421 | ||
3422 | =item * | |
3423 | ||
021c503d RS |
3424 | C<splice()> doesn't warn when truncating |
3425 | ||
3426 | You can now limit the size of an array using C<splice(@a,MAX_LEN)> without | |
3427 | worrying about warnings. | |
3428 | ||
77649ca9 RS |
3429 | =item * |
3430 | ||
3431 | The C<SvPVutf8> C function no longer tries to modify its argument, | |
3432 | resulting in errors [perl #108994]. | |
3433 | ||
3434 | =item * | |
3435 | ||
3436 | C<SvPVutf8> now works properly with magical variables. | |
3437 | ||
3438 | =item * | |
3439 | ||
3440 | C<SvPVbyte> now works properly non-PVs. | |
3441 | ||
fcdfb45f FC |
3442 | =item * |
3443 | ||
3444 | Version objects no longer cause memory leaks in boolean context | |
3445 | [perl #109762]. | |
3446 | ||
6d365783 FC |
3447 | =item * |
3448 | ||
d005e6a6 | 3449 | C<< $$ >> is no longer tainted. Since this value comes directly from |
6d365783 FC |
3450 | C<< getpid() >>, it is always safe. |
3451 | ||
3452 | =item * | |
3453 | ||
3454 | The parser no longer leaks a filehandle if STDIN was closed before parsing | |
3455 | started [perl #37033]. | |
3456 | ||
3457 | =item * | |
3458 | ||
3459 | C<< (?foo: ...) >> no longer loses passed in character set. | |
3460 | ||
3461 | =item * | |
3462 | ||
3463 | C<< die; >> with a non-reference, non-string, or magical (e.g., tainted) | |
3464 | value in $@ now properly | |
3465 | propagates that value [perl #111654]. | |
3466 | ||
fe0d5730 FC |
3467 | =item * |
3468 | ||
3469 | The trie optimisation used to have problems with alternations containing | |
3470 | an empty C<(?:)>, causing C<< "x" =~ /\A(?>(?:(?:)A|B|C?x))\z/ >> not to | |
3471 | match, whereas it should [perl #111842]. | |
3472 | ||
4bbade93 RS |
3473 | =back |
3474 | ||
3475 | =head1 Known Problems | |
30682cc3 RS |
3476 | |
3477 | =over 4 | |
3478 | ||
3479 | =item * | |
3480 | ||
4bbade93 RS |
3481 | On Solaris, we have two kinds of failure. |
3482 | ||
3483 | If F<make> is Sun's F<makeā„>, we get an error about a badly formed macro | |
4d6200df FC |
3484 | assignment in the F<Makefile>. That happens when F<./Configure> tries to |
3485 | make depends. F<Configure> then exits 0, but further F<make>-ing fails. | |
4bbade93 RS |
3486 | |
3487 | If F<make> is F<gmake>, F<Configure> completes, then we get errors related | |
3488 | to F</usr/include/stdbool.h> | |
30682cc3 | 3489 | |
04e04589 FC |
3490 | =item * |
3491 | ||
3492 | The following CPAN modules have test failures with perl 5.16. Patches have | |
3493 | been submitted for all of these, so hopefully there will be new releases | |
3494 | soon: | |
3495 | ||
3496 | =over | |
3497 | ||
3498 | =item * | |
3499 | ||
3500 | L<Date::Pcalc> version 6.1 | |
3501 | ||
3502 | =item * | |
3503 | ||
3504 | L<Encode::JP::Mobile> version 0.27 | |
3505 | ||
3506 | =item * | |
3507 | ||
3508 | L<Module::CPANTS::Analyse> version 0.85 | |
3509 | ||
3510 | This fails due to problems in L<Module::Find> 0.10 and L<File::MMagic> | |
3511 | 1.27. | |
3512 | ||
3513 | =item * | |
3514 | ||
3515 | L<PerlIO::Util> version 0.72 | |
3516 | ||
04e04589 FC |
3517 | =back |
3518 | ||
30682cc3 RS |
3519 | =back |
3520 | ||
3521 | =head1 Obituary | |
3522 | ||
3523 | XXX If any significant core contributor has died, we've added a short obituary | |
3524 | here. | |
3525 | ||
3526 | =head1 Acknowledgements | |
3527 | ||
3528 | XXX Generate this with: | |
3529 | ||
021c503d | 3530 | perl Porting/acknowledgements.pl v5.14.0..HEAD |
30682cc3 RS |
3531 | |
3532 | =head1 Reporting Bugs | |
3533 | ||
3534 | If you find what you think is a bug, you might check the articles | |
3535 | recently posted to the comp.lang.perl.misc newsgroup and the perl | |
021c503d RS |
3536 | bug database at L<http://rt.perl.org/perlbug/>. There may also be |
3537 | information at L<http://www.perl.org/>, the Perl Home Page. | |
30682cc3 RS |
3538 | |
3539 | If you believe you have an unreported bug, please run the L<perlbug> | |
3540 | program included with your release. Be sure to trim your bug down | |
3541 | to a tiny but sufficient test case. Your bug report, along with the | |
3542 | output of C<perl -V>, will be sent off to perlbug@perl.org to be | |
3543 | analysed by the Perl porting team. | |
3544 | ||
3545 | If the bug you are reporting has security implications, which make it | |
021c503d | 3546 | inappropriate to send to a publicly archived mailing list, then please |
4d6200df | 3547 | send it to perl5-security-report@perl.org. This points to a closed |
021c503d RS |
3548 | subscription unarchived mailing list, which includes all the core |
3549 | committers, who will be able to help assess the impact of issues, figure | |
3550 | out a resolution, and help co-ordinate the release of patches to | |
3551 | mitigate or fix the problem across all platforms on which Perl is | |
4d6200df | 3552 | supported. Please only use this address for security issues in the Perl |
021c503d | 3553 | core, not for modules independently distributed on CPAN. |
30682cc3 RS |
3554 | |
3555 | =head1 SEE ALSO | |
3556 | ||
3557 | The F<Changes> file for an explanation of how to view exhaustive details | |
3558 | on what changed. | |
3559 | ||
3560 | The F<INSTALL> file for how to build Perl. | |
3561 | ||
3562 | The F<README> file for general stuff. | |
3563 | ||
3564 | The F<Artistic> and F<Copying> files for copyright information. | |
3565 | ||
3566 | =cut |