Commit | Line | Data |
---|---|---|
44691e6f AB |
1 | =encoding utf8 |
2 | ||
3 | =head1 NAME | |
4 | ||
05c8f9ed | 5 | perldelta - what is new for perl v5.16.0 |
2630d42b | 6 | |
05c8f9ed RS |
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 | ||
7af9a95b | 16 | Some bug fixes in this release have been backported to later |
c7957d51 FC |
17 | releases of 5.14.x. Those are indicated with the 5.14.x version in |
18 | parentheses. | |
19 | ||
05c8f9ed RS |
20 | =head1 Notice |
21 | ||
8c551b2a RS |
22 | With the release of Perl 5.16.0, the 5.12.x series of releases is now out of |
23 | its support period. There may be future 5.12.x releases, but only in the | |
7c54b938 RS |
24 | event of a critical security issue. Users of Perl 5.12 or earlier should |
25 | consider upgrading to a more recent release of Perl. | |
26 | ||
27 | This policy is described in greater detail in | |
28 | L<perlpolicy|perlpolicy/MAINTENANCE AND SUPPORT>. | |
05c8f9ed RS |
29 | |
30 | =head1 Core Enhancements | |
31 | ||
32 | =head2 C<use I<VERSION>> | |
33 | ||
34 | As of this release, version declarations like C<use v5.16> now disable | |
35 | all features before enabling the new feature bundle. This means that | |
36 | the following holds true: | |
37 | ||
38 | use 5.016; | |
39 | # only 5.16 features enabled here | |
40 | use 5.014; | |
41 | # only 5.14 features enabled here (not 5.16) | |
42 | ||
43 | C<use v5.12> and higher continue to enable strict, but explicit C<use | |
44 | strict> and C<no strict> now override the version declaration, even | |
45 | when they come first: | |
46 | ||
47 | no strict; | |
48 | use 5.012; | |
49 | # no strict here | |
50 | ||
51 | There is a new ":default" feature bundle that represents the set of | |
52 | features enabled before any version declaration or C<use feature> has | |
53 | been seen. Version declarations below 5.10 now enable the ":default" | |
1540de7c | 54 | feature set. This does not actually change the behavior of C<use |
05c8f9ed RS |
55 | v5.8>, because features added to the ":default" set are those that were |
56 | traditionally enabled by default, before they could be turned off. | |
57 | ||
58 | C<< no feature >> now resets to the default feature set. To disable all | |
59 | features (which is likely to be a pretty special-purpose request, since | |
60 | it presumably won't match any named set of semantics) you can now | |
61 | write C<< no feature ':all' >>. | |
62 | ||
63 | C<$[> is now disabled under C<use v5.16>. It is part of the default | |
64 | feature set and can be turned on or off explicitly with C<use feature | |
65 | 'array_base'>. | |
66 | ||
67 | =head2 C<__SUB__> | |
68 | ||
69 | The new C<__SUB__> token, available under the C<current_sub> feature | |
70 | (see L<feature>) or C<use v5.16>, returns a reference to the current | |
71 | subroutine, making it easier to write recursive closures. | |
72 | ||
73 | =head2 New and Improved Built-ins | |
74 | ||
75 | =head3 More consistent C<eval> | |
76 | ||
77 | The C<eval> operator sometimes treats a string argument as a sequence of | |
78 | characters and sometimes as a sequence of bytes, depending on the | |
79 | internal encoding. The internal encoding is not supposed to make any | |
80 | difference, but there is code that relies on this inconsistency. | |
81 | ||
82 | The new C<unicode_eval> and C<evalbytes> features (enabled under C<use | |
83 | 5.16.0>) resolve this. The C<unicode_eval> feature causes C<eval | |
84 | $string> to treat the string always as Unicode. The C<evalbytes> | |
85 | features provides a function, itself called C<evalbytes>, which | |
86 | evaluates its argument always as a string of bytes. | |
87 | ||
88 | These features also fix oddities with source filters leaking to outer | |
89 | dynamic scopes. | |
90 | ||
91 | See L<feature> for more detail. | |
92 | ||
93 | =head3 C<substr> lvalue revamp | |
94 | ||
7af9a95b | 95 | =for comment Does this belong here, or under Incompatible Changes? |
05c8f9ed RS |
96 | |
97 | When C<substr> is called in lvalue or potential lvalue context with two | |
98 | or three arguments, a special lvalue scalar is returned that modifies | |
99 | the original string (the first argument) when assigned to. | |
100 | ||
101 | Previously, the offsets (the second and third arguments) passed to | |
102 | C<substr> would be converted immediately to match the string, negative | |
103 | offsets being translated to positive and offsets beyond the end of the | |
104 | string being truncated. | |
105 | ||
106 | Now, the offsets are recorded without modification in the special | |
107 | lvalue scalar that is returned, and the original string is not even | |
108 | looked at by C<substr> itself, but only when the returned lvalue is | |
109 | read or modified. | |
110 | ||
111 | These changes result in an incompatible change: | |
112 | ||
113 | If the original string changes length after the call to C<substr> but | |
114 | before assignment to its return value, negative offsets will remember | |
115 | their position from the end of the string, affecting code like this: | |
116 | ||
117 | my $string = "string"; | |
118 | my $lvalue = \substr $string, -4, 2; | |
5bbddb31 | 119 | print $$lvalue, "\n"; # prints "ri" |
05c8f9ed | 120 | $string = "bailing twine"; |
5bbddb31 | 121 | print $$lvalue, "\n"; # prints "wi"; used to print "il" |
05c8f9ed RS |
122 | |
123 | The same thing happens with an omitted third argument. The returned | |
124 | lvalue will always extend to the end of the string, even if the string | |
125 | becomes longer. | |
126 | ||
127 | Since this change also allowed many bugs to be fixed (see | |
1540de7c | 128 | L</The C<substr> operator>), and since the behavior |
014dc7eb | 129 | of negative offsets has never been specified, the |
05c8f9ed RS |
130 | change was deemed acceptable. |
131 | ||
132 | =head3 Return value of C<tied> | |
133 | ||
134 | The value returned by C<tied> on a tied variable is now the actual | |
135 | scalar that holds the object to which the variable is tied. This | |
7af9a95b | 136 | lets ties be weakened with C<Scalar::Util::weaken(tied |
05c8f9ed RS |
137 | $tied_variable)>. |
138 | ||
139 | =head2 Unicode Support | |
140 | ||
141 | =head3 Supports (I<almost>) Unicode 6.1 | |
142 | ||
143 | Besides the addition of whole new scripts, and new characters in | |
144 | existing scripts, this new version of Unicode, as always, makes some | |
145 | changes to existing characters. One change that may trip up some | |
146 | applications is that the General Category of two characters in the | |
147 | Latin-1 range, PILCROW SIGN and SECTION SIGN, has been changed from | |
148 | Other_Symbol to Other_Punctuation. The same change has been made for | |
149 | a character in each of Tibetan, Ethiopic, and Aegean. | |
150 | The code points U+3248..U+324F (CIRCLED NUMBER TEN ON BLACK SQUARE | |
151 | through CIRCLED NUMBER EIGHTY ON BLACK SQUARE) have had their General | |
152 | Category changed from Other_Symbol to Other_Numeric. The Line Break | |
7af9a95b | 153 | property has changes for Hebrew and Japanese; and because of |
05c8f9ed RS |
154 | other changes in 6.1, the Perl regular expression construct C<\X> now |
155 | works differently for some characters in Thai and Lao. | |
156 | ||
157 | New aliases (synonyms) have been defined for many property values; | |
158 | these, along with the previously existing ones, are all cross-indexed in | |
159 | L<perluniprops>. | |
160 | ||
161 | The return value of C<charnames::viacode()> is affected by other | |
162 | changes: | |
163 | ||
164 | Code point Old Name New Name | |
165 | U+000A LINE FEED (LF) LINE FEED | |
166 | U+000C FORM FEED (FF) FORM FEED | |
167 | U+000D CARRIAGE RETURN (CR) CARRIAGE RETURN | |
168 | U+0085 NEXT LINE (NEL) NEXT LINE | |
169 | U+008E SINGLE-SHIFT 2 SINGLE-SHIFT-2 | |
170 | U+008F SINGLE-SHIFT 3 SINGLE-SHIFT-3 | |
171 | U+0091 PRIVATE USE 1 PRIVATE USE-1 | |
172 | U+0092 PRIVATE USE 2 PRIVATE USE-2 | |
173 | U+2118 SCRIPT CAPITAL P WEIERSTRASS ELLIPTIC FUNCTION | |
174 | ||
175 | Perl will accept any of these names as input, but | |
176 | C<charnames::viacode()> now returns the new name of each pair. The | |
177 | change for U+2118 is considered by Unicode to be a correction, that is | |
178 | the original name was a mistake (but again, it will remain forever valid | |
179 | to use it to refer to U+2118). But most of these changes are the | |
180 | fallout of the mistake Unicode 6.0 made in naming a character used in | |
181 | Japanese cell phones to be "BELL", which conflicts with the longstanding | |
182 | industry use of (and Unicode's recommendation to use) that name | |
7af9a95b TC |
183 | to mean the ASCII control character at U+0007. Therefore, that name |
184 | has been deprecated in Perl since v5.14, and any use of it will raise a | |
05c8f9ed | 185 | warning message (unless turned off). The name "ALERT" is now the |
7af9a95b | 186 | preferred name for this code point, with "BEL" an acceptable short |
05c8f9ed | 187 | form. The name for the new cell phone character, at code point U+1F514, |
7af9a95b TC |
188 | remains undefined in this version of Perl (hence we don't |
189 | implement quite all of Unicode 6.1), but starting in v5.18, BELL will mean | |
05c8f9ed RS |
190 | this character, and not U+0007. |
191 | ||
192 | Unicode has taken steps to make sure that this sort of mistake does not | |
7af9a95b | 193 | happen again. The Standard now includes all generally accepted |
05c8f9ed RS |
194 | names and abbreviations for control characters, whereas previously it |
195 | didn't (though there were recommended names for most of them, which Perl | |
196 | used). This means that most of those recommended names are now | |
197 | officially in the Standard. Unicode did not recommend names for the | |
198 | four code points listed above between U+008E and U+008F, and in | |
199 | standardizing them Unicode subtly changed the names that Perl had | |
200 | previously given them, by replacing the final blank in each name by a | |
201 | hyphen. Unicode also officially accepts names that Perl had deprecated, | |
202 | such as FILE SEPARATOR. Now the only deprecated name is BELL. | |
203 | Finally, Perl now uses the new official names instead of the old | |
204 | (now considered obsolete) names for the first four code points in the | |
205 | list above (the ones which have the parentheses in them). | |
206 | ||
207 | Now that the names have been placed in the Unicode standard, these kinds | |
208 | of changes should not happen again, though corrections, such as to | |
209 | U+2118, are still possible. | |
210 | ||
211 | Unicode also added some name abbreviations, which Perl now accepts: | |
212 | SP for SPACE; | |
213 | TAB for CHARACTER TABULATION; | |
214 | NEW LINE, END OF LINE, NL, and EOL for LINE FEED; | |
215 | LOCKING-SHIFT ONE for SHIFT OUT; | |
216 | LOCKING-SHIFT ZERO for SHIFT IN; | |
217 | and ZWNBSP for ZERO WIDTH NO-BREAK SPACE. | |
218 | ||
219 | More details on this version of Unicode are provided in | |
220 | L<http://www.unicode.org/versions/Unicode6.1.0/>. | |
221 | ||
222 | =head3 C<use charnames> is no longer needed for C<\N{I<name>}> | |
223 | ||
224 | When C<\N{I<name>}> is encountered, the C<charnames> module is now | |
225 | automatically loaded when needed as if the C<:full> and C<:short> | |
226 | options had been specified. See L<charnames> for more information. | |
227 | ||
228 | =head3 C<\N{...}> can now have Unicode loose name matching | |
229 | ||
230 | This is described in the C<charnames> item in | |
231 | L</Updated Modules and Pragmata> below. | |
232 | ||
233 | =head3 Unicode Symbol Names | |
234 | ||
235 | Perl now has proper support for Unicode in symbol names. It used to be | |
236 | that C<*{$foo}> would ignore the internal UTF8 flag and use the bytes of | |
237 | the underlying representation to look up the symbol. That meant that | |
238 | C<*{"\x{100}"}> and C<*{"\xc4\x80"}> would return the same thing. All | |
239 | these parts of Perl have been fixed to account for Unicode: | |
240 | ||
241 | =over | |
242 | ||
243 | =item * | |
244 | ||
245 | Method names (including those passed to C<use overload>) | |
246 | ||
247 | =item * | |
248 | ||
7af9a95b | 249 | Typeglob names (including names of variables, subroutines, and filehandles) |
05c8f9ed RS |
250 | |
251 | =item * | |
252 | ||
253 | Package names | |
254 | ||
255 | =item * | |
256 | ||
257 | C<goto> | |
258 | ||
259 | =item * | |
260 | ||
261 | Symbolic dereferencing | |
262 | ||
263 | =item * | |
264 | ||
265 | Second argument to C<bless()> and C<tie()> | |
266 | ||
267 | =item * | |
268 | ||
269 | Return value of C<ref()> | |
270 | ||
271 | =item * | |
272 | ||
273 | Subroutine prototypes | |
274 | ||
275 | =item * | |
276 | ||
277 | Attributes | |
278 | ||
279 | =item * | |
280 | ||
281 | Various warnings and error messages that mention variable names or values, | |
282 | methods, etc. | |
283 | ||
284 | =back | |
285 | ||
286 | In addition, a parsing bug has been fixed that prevented C<*{é}> from | |
287 | implicitly quoting the name, but instead interpreted it as C<*{+é}>, which | |
288 | would cause a strict violation. | |
289 | ||
290 | C<*{"*a::b"}> automatically strips off the * if it is followed by an ASCII | |
291 | letter. That has been extended to all Unicode identifier characters. | |
292 | ||
293 | One-character non-ASCII non-punctuation variables (like C<$é>) are now | |
294 | subject to "Used only once" warnings. They used to be exempt, as they | |
e019578d | 295 | were treated as punctuation variables. |
05c8f9ed RS |
296 | |
297 | Also, single-character Unicode punctuation variables (like C<$‰>) are now | |
298 | supported [perl #69032]. | |
299 | ||
300 | =head3 Improved ability to mix locales and Unicode, including UTF-8 locales | |
301 | ||
302 | An optional parameter has been added to C<use locale> | |
303 | ||
304 | use locale ':not_characters'; | |
305 | ||
306 | which tells Perl to use all but the C<LC_CTYPE> and C<LC_COLLATE> | |
307 | portions of the current locale. Instead, the character set is assumed | |
7af9a95b | 308 | to be Unicode. This lets locales and Unicode be seamlessly mixed, |
05c8f9ed RS |
309 | including the increasingly frequent UTF-8 locales. When using this |
310 | hybrid form of locales, the C<:locale> layer to the L<open> pragma can | |
311 | be used to interface with the file system, and there are CPAN modules | |
312 | available for ARGV and environment variable conversions. | |
313 | ||
314 | Full details are in L<perllocale>. | |
315 | ||
316 | =head3 New function C<fc> and corresponding escape sequence C<\F> for Unicode foldcase | |
317 | ||
318 | Unicode foldcase is an extension to lowercase that gives better results | |
319 | when comparing two strings case-insensitively. It has long been used | |
320 | internally in regular expression C</i> matching. Now it is available | |
321 | explicitly through the new C<fc> function call (enabled by | |
322 | S<C<"use feature 'fc'">>, or C<use v5.16>, or explicitly callable via | |
323 | C<CORE::fc>) or through the new C<\F> sequence in double-quotish | |
324 | strings. | |
325 | ||
326 | Full details are in L<perlfunc/fc>. | |
327 | ||
328 | =head3 The Unicode C<Script_Extensions> property is now supported. | |
329 | ||
330 | New in Unicode 6.0, this is an improved C<Script> property. Details | |
331 | are in L<perlunicode/Scripts>. | |
332 | ||
333 | =head2 XS Changes | |
334 | ||
335 | =head3 Improved typemaps for Some Builtin Types | |
336 | ||
7af9a95b | 337 | Most XS authors will know there is a longstanding bug in the |
05c8f9ed RS |
338 | OUTPUT typemap for T_AVREF (C<AV*>), T_HVREF (C<HV*>), T_CVREF (C<CV*>), |
339 | and T_SVREF (C<SVREF> or C<\$foo>) that requires manually decrementing | |
340 | the reference count of the return value instead of the typemap taking | |
341 | care of this. For backwards-compatibility, this cannot be changed in the | |
342 | default typemaps. But we now provide additional typemaps | |
343 | C<T_AVREF_REFCOUNT_FIXED>, etc. that do not exhibit this bug. Using | |
344 | them in your extension is as simple as having one line in your | |
345 | C<TYPEMAP> section: | |
346 | ||
347 | HV* T_HVREF_REFCOUNT_FIXED | |
348 | ||
349 | =head3 C<is_utf8_char()> | |
350 | ||
351 | The XS-callable function C<is_utf8_char()>, when presented with | |
352 | malformed UTF-8 input, can read up to 12 bytes beyond the end of the | |
88132a12 KW |
353 | string. This cannot be fixed without changing its API, and so its |
354 | use is now deprecated. Use C<is_utf8_char_buf()> (described just below) | |
355 | instead. | |
05c8f9ed RS |
356 | |
357 | =head3 Added C<is_utf8_char_buf()> | |
358 | ||
359 | This function is designed to replace the deprecated L</is_utf8_char()> | |
360 | function. It includes an extra parameter to make sure it doesn't read | |
361 | past the end of the input buffer. | |
362 | ||
363 | =head3 Other C<is_utf8_foo()> functions, as well as C<utf8_to_foo()>, etc. | |
364 | ||
7af9a95b TC |
365 | Most other XS-callable functions that take UTF-8 encoded input |
366 | implicitly assume that the UTF-8 is valid (not malformed) with respect to | |
05c8f9ed RS |
367 | buffer length. Do not do things such as change a character's case or |
368 | see if it is alphanumeric without first being sure that it is valid | |
369 | UTF-8. This can be safely done for a whole string by using one of the | |
370 | functions C<is_utf8_string()>, C<is_utf8_string_loc()>, and | |
371 | C<is_utf8_string_loclen()>. | |
372 | ||
373 | =head3 New Pad API | |
374 | ||
375 | Many new functions have been added to the API for manipulating lexical | |
376 | pads. See L<perlapi/Pad Data Structures> for more information. | |
377 | ||
378 | =head2 Changes to Special Variables | |
379 | ||
380 | =head3 C<$$> can be assigned to | |
381 | ||
382 | C<$$> was made read-only in Perl 5.8.0. But only sometimes: C<local $$> | |
383 | would make it writable again. Some CPAN modules were using C<local $$> or | |
384 | XS code to bypass the read-only check, so there is no reason to keep C<$$> | |
385 | read-only. (This change also allowed a bug to be fixed while maintaining | |
386 | backward compatibility.) | |
387 | ||
388 | =head3 C<$^X> converted to an absolute path on FreeBSD, OS X and Solaris | |
389 | ||
390 | C<$^X> is now converted to an absolute path on OS X, FreeBSD (without | |
391 | needing F</proc> mounted) and Solaris 10 and 11. This augments the | |
7af9a95b | 392 | previous approach of using F</proc> on Linux, FreeBSD, and NetBSD |
05c8f9ed RS |
393 | (in all cases, where mounted). |
394 | ||
395 | This makes relocatable perl installations more useful on these platforms. | |
396 | (See "Relocatable @INC" in F<INSTALL>) | |
397 | ||
398 | =head2 Debugger Changes | |
399 | ||
400 | =head3 Features inside the debugger | |
401 | ||
402 | The current Perl's L<feature> bundle is now enabled for commands entered | |
403 | in the interactive debugger. | |
404 | ||
405 | =head3 New option for the debugger's B<t> command | |
406 | ||
407 | The B<t> command in the debugger, which toggles tracing mode, now | |
408 | accepts a numeric argument that determines how many levels of subroutine | |
409 | calls to trace. | |
410 | ||
411 | =head3 C<enable> and C<disable> | |
412 | ||
413 | The debugger now has C<disable> and C<enable> commands for disabling | |
414 | existing breakpoints and re-enabling them. See L<perldebug>. | |
415 | ||
416 | =head3 Breakpoints with file names | |
417 | ||
7af9a95b TC |
418 | The debugger's "b" command for setting breakpoints now lets a line |
419 | number be prefixed with a file name. See | |
05c8f9ed RS |
420 | L<perldebug/"b [file]:[line] [condition]">. |
421 | ||
422 | =head2 The C<CORE> Namespace | |
423 | ||
424 | =head3 The C<CORE::> prefix | |
425 | ||
426 | The C<CORE::> prefix can now be used on keywords enabled by | |
427 | L<feature.pm|feature>, even outside the scope of C<use feature>. | |
428 | ||
429 | =head3 Subroutines in the C<CORE> namespace | |
430 | ||
431 | Many Perl keywords are now available as subroutines in the CORE namespace. | |
7af9a95b | 432 | This lets them be aliased: |
05c8f9ed RS |
433 | |
434 | BEGIN { *entangle = \&CORE::tie } | |
435 | entangle $variable, $package, @args; | |
436 | ||
437 | And for prototypes to be bypassed: | |
438 | ||
439 | sub mytie(\[%$*@]$@) { | |
440 | my ($ref, $pack, @args) = @_; | |
441 | ... do something ... | |
442 | goto &CORE::tie; | |
443 | } | |
444 | ||
445 | Some of these cannot be called through references or via C<&foo> syntax, | |
446 | but must be called as barewords. | |
447 | ||
448 | See L<CORE> for details. | |
449 | ||
450 | =head2 Other Changes | |
451 | ||
452 | =head3 Anonymous handles | |
453 | ||
454 | Automatically generated file handles are now named __ANONIO__ when the | |
455 | variable name cannot be determined, rather than $__ANONIO__. | |
456 | ||
457 | =head3 Autoloaded sort Subroutines | |
458 | ||
459 | Custom sort subroutines can now be autoloaded [perl #30661]: | |
460 | ||
461 | sub AUTOLOAD { ... } | |
462 | @sorted = sort foo @list; # uses AUTOLOAD | |
463 | ||
464 | =head3 C<continue> no longer requires the "switch" feature | |
465 | ||
466 | The C<continue> keyword has two meanings. It can introduce a C<continue> | |
7af9a95b TC |
467 | block after a loop, or it can exit the current C<when> block. Up to now, |
468 | the latter meaning was valid only with the "switch" feature enabled, and | |
05c8f9ed RS |
469 | was a syntax error otherwise. Since the main purpose of feature.pm is to |
470 | avoid conflicts with user-defined subroutines, there is no reason for | |
471 | C<continue> to depend on it. | |
472 | ||
473 | =head3 DTrace probes for interpreter phase change | |
474 | ||
475 | The C<phase-change> probes will fire when the interpreter's phase | |
476 | changes, which tracks the C<${^GLOBAL_PHASE}> variable. C<arg0> is | |
7af9a95b | 477 | the new phase name; C<arg1> is the old one. This is useful |
05c8f9ed | 478 | for limiting your instrumentation to one or more of: compile time, |
7af9a95b | 479 | run time, or destruct time. |
05c8f9ed RS |
480 | |
481 | =head3 C<__FILE__()> Syntax | |
482 | ||
483 | The C<__FILE__>, C<__LINE__> and C<__PACKAGE__> tokens can now be written | |
484 | with an empty pair of parentheses after them. This makes them parse the | |
485 | same way as C<time>, C<fork> and other built-in functions. | |
486 | ||
487 | =head3 The C<\$> prototype accepts any scalar lvalue | |
488 | ||
489 | The C<\$> and C<\[$]> subroutine prototypes now accept any scalar lvalue | |
7af9a95b | 490 | argument. Previously they accepted only scalars beginning with C<$> and |
05c8f9ed RS |
491 | hash and array elements. This change makes them consistent with the way |
492 | the built-in C<read> and C<recv> functions (among others) parse their | |
493 | arguments. This means that one can override the built-in functions with | |
494 | custom subroutines that parse their arguments the same way. | |
495 | ||
496 | =head3 C<_> in subroutine prototypes | |
497 | ||
498 | The C<_> character in subroutine prototypes is now allowed before C<@> or | |
499 | C<%>. | |
500 | ||
501 | =head1 Security | |
502 | ||
503 | =head2 Use C<is_utf8_char_buf()> and not C<is_utf8_char()> | |
504 | ||
505 | The latter function is now deprecated because its API is insufficient to | |
506 | guarantee that it doesn't read (up to 12 bytes in the worst case) beyond | |
507 | the end of its input string. See | |
508 | L<is_utf8_char_buf()|/Added is_utf8_char_buf()>. | |
509 | ||
510 | =head2 Malformed UTF-8 input could cause attempts to read beyond the end of the buffer | |
511 | ||
512 | Two new XS-accessible functions, C<utf8_to_uvchr_buf()> and | |
513 | C<utf8_to_uvuni_buf()> are now available to prevent this, and the Perl | |
514 | core has been converted to use them. | |
515 | See L</Internal Changes>. | |
516 | ||
517 | =head2 C<File::Glob::bsd_glob()> memory error with GLOB_ALTDIRFUNC (CVE-2011-2728). | |
518 | ||
519 | Calling C<File::Glob::bsd_glob> with the unsupported flag | |
520 | GLOB_ALTDIRFUNC would cause an access violation / segfault. A Perl | |
521 | program that accepts a flags value from an external source could expose | |
522 | itself to denial of service or arbitrary code execution attacks. There | |
523 | are no known exploits in the wild. The problem has been corrected by | |
524 | explicitly disabling all unsupported flags and setting unused function | |
006b5090 | 525 | pointers to null. Bug reported by Clément Lecigne. (5.14.2) |
05c8f9ed RS |
526 | |
527 | =head2 Privileges are now set correctly when assigning to C<$(> | |
528 | ||
7af9a95b | 529 | A hypothetical bug (probably unexploitable in practice) because the |
05c8f9ed | 530 | incorrect setting of the effective group ID while setting C<$(> has been |
7af9a95b | 531 | fixed. The bug would have affected only systems that have C<setresgid()> |
e019578d | 532 | but not C<setregid()>, but no such systems are known to exist. |
05c8f9ed RS |
533 | |
534 | =head1 Deprecations | |
535 | ||
536 | =head2 Don't read the Unicode data base files in F<lib/unicore> | |
537 | ||
538 | It is now deprecated to directly read the Unicode data base files. | |
539 | These are stored in the F<lib/unicore> directory. Instead, you should | |
540 | use the new functions in L<Unicode::UCD>. These provide a stable API, | |
541 | and give complete information. | |
542 | ||
7af9a95b | 543 | Perl may at some point in the future change or remove these files. The |
e019578d | 544 | file which applications were most likely to have used is |
05c8f9ed RS |
545 | F<lib/unicore/ToDigit.pl>. L<Unicode::UCD/prop_invmap()> can be used to |
546 | get at its data instead. | |
547 | ||
548 | =head2 XS functions C<is_utf8_char()>, C<utf8_to_uvchr()> and | |
549 | C<utf8_to_uvuni()> | |
550 | ||
551 | This function is deprecated because it could read beyond the end of the | |
552 | input string. Use the new L<is_utf8_char_buf()|/Added is_utf8_char_buf()>, | |
553 | C<utf8_to_uvchr_buf()> and C<utf8_to_uvuni_buf()> instead. | |
554 | ||
555 | =head1 Future Deprecations | |
556 | ||
557 | This section serves as a notice of features that are I<likely> to be | |
558 | removed or L<deprecated|perlpolicy/deprecated> in the next release of | |
559 | perl (5.18.0). If your code depends on these features, you should | |
560 | contact the Perl 5 Porters via the L<mailing | |
561 | list|http://lists.perl.org/list/perl5-porters.html> or L<perlbug> to | |
562 | explain your use case and inform the deprecation process. | |
563 | ||
564 | =head2 Core Modules | |
565 | ||
566 | These modules may be marked as deprecated I<from the core>. This only | |
567 | means that they will no longer be installed by default with the core | |
568 | distribution, but will remain available on the CPAN. | |
569 | ||
570 | =over | |
571 | ||
572 | =item * | |
573 | ||
574 | CPANPLUS | |
575 | ||
576 | =item * | |
577 | ||
578 | Filter::Simple | |
579 | ||
580 | =item * | |
581 | ||
582 | PerlIO::mmap | |
583 | ||
584 | =item * | |
585 | ||
53b25539 RS |
586 | Pod::LaTeX |
587 | ||
588 | =item * | |
589 | ||
590 | Pod::Parser | |
05c8f9ed RS |
591 | |
592 | =item * | |
593 | ||
594 | SelfLoader | |
595 | ||
596 | =item * | |
597 | ||
598 | Text::Soundex | |
599 | ||
600 | =item * | |
601 | ||
602 | Thread.pm | |
603 | ||
604 | =back | |
605 | ||
606 | =head2 Platforms with no supporting programmers: | |
607 | ||
608 | These platforms will probably have their | |
609 | special build support removed during the | |
610 | 5.17.0 development series. | |
611 | ||
612 | =over | |
613 | ||
614 | =item * | |
615 | ||
616 | BeOS | |
617 | ||
618 | =item * | |
619 | ||
620 | djgpp | |
621 | ||
622 | =item * | |
623 | ||
624 | dgux | |
625 | ||
626 | =item * | |
627 | ||
628 | EPOC | |
629 | ||
630 | =item * | |
631 | ||
632 | MPE/iX | |
633 | ||
634 | =item * | |
635 | ||
636 | Rhapsody | |
637 | ||
638 | =item * | |
639 | ||
640 | UTS | |
641 | ||
642 | =item * | |
643 | ||
644 | VM/ESA | |
645 | ||
646 | =back | |
647 | ||
648 | =head2 Other Future Deprecations | |
649 | ||
650 | =over | |
651 | ||
652 | =item * | |
653 | ||
654 | Swapping of $< and $> | |
655 | ||
656 | For more information about this future deprecation, see L<the relevant RT | |
657 | ticket|https://rt.perl.org/rt3/Ticket/Display.html?id=96212>. | |
658 | ||
659 | =item * | |
660 | ||
661 | sfio, stdio | |
662 | ||
e57f4500 LT |
663 | Perl supports being built without PerlIO proper, using a stdio or sfio |
664 | wrapper instead. A perl build like this will not support IO layers and | |
665 | thus Unicode IO, making it rather handicapped. | |
666 | ||
667 | PerlIO supports a C<stdio> layer if stdio use is desired, and similarly a | |
668 | sfio layer could be produced. | |
669 | ||
05c8f9ed RS |
670 | =item * |
671 | ||
672 | Unescaped literal C<< "{" >> in regular expressions. | |
673 | ||
7af9a95b TC |
674 | Starting with v5.20, it is planned to require a literal C<"{"> to be |
675 | escaped, for example by preceding it with a backslash. In v5.18, a | |
676 | deprecated warning message will be emitted for all such uses. | |
677 | This affects only patterns that are to match a literal C<"{">. Other | |
678 | uses of this character, such as part of a quantifier or sequence as in | |
679 | those below, are completely unaffected: | |
05c8f9ed RS |
680 | |
681 | /foo{3,5}/ | |
682 | /\p{Alphabetic}/ | |
683 | /\N{DIGIT ZERO} | |
684 | ||
7af9a95b TC |
685 | Removing this will permit extensions to Perl's pattern syntax and better |
686 | error checking for existing syntax. See L<perlre/Quantifiers> for an | |
05c8f9ed RS |
687 | example. |
688 | ||
081e557a KW |
689 | =item * |
690 | ||
7af9a95b | 691 | Revamping C<< "\Q" >> semantics in double-quotish strings when combined with other escapes. |
081e557a | 692 | |
7af9a95b | 693 | There are several bugs and inconsistencies involving combinations |
43b0ea4c | 694 | of C<\Q> and escapes like C<\x>, C<\L>, etc., within a C<\Q...\E> pair. |
081e557a KW |
695 | These need to be fixed, and doing so will necessarily change current |
696 | behavior. The changes have not yet been settled. | |
697 | ||
05c8f9ed RS |
698 | =back |
699 | ||
700 | =head1 Incompatible Changes | |
701 | ||
702 | =head2 Special blocks called in void context | |
703 | ||
704 | Special blocks (C<BEGIN>, C<CHECK>, C<INIT>, C<UNITCHECK>, C<END>) are now | |
705 | called in void context. This avoids wasteful copying of the result of the | |
706 | last statement [perl #108794]. | |
707 | ||
708 | =head2 The C<overloading> pragma and regexp objects | |
709 | ||
710 | With C<no overloading>, regular expression objects returned by C<qr//> are | |
711 | now stringified as "Regexp=REGEXP(0xbe600d)" instead of the regular | |
712 | expression itself [perl #108780]. | |
713 | ||
714 | =head2 Two XS typemap Entries removed | |
715 | ||
716 | Two presumably unused XS typemap entries have been removed from the | |
717 | core typemap: T_DATAUNIT and T_CALLBACK. If you are, against all odds, | |
e019578d | 718 | a user of these, please see the instructions on how to restore them |
05c8f9ed RS |
719 | in L<perlxstypemap>. |
720 | ||
721 | =head2 Unicode 6.1 has incompatibilities with Unicode 6.0 | |
722 | ||
723 | These are detailed in L</Supports (almost) Unicode 6.1> above. | |
724 | You can compile this version of Perl to use Unicode 6.0. See | |
725 | L<perlunicode/Hacking Perl to work on earlier Unicode versions (for very serious hackers only)>. | |
726 | ||
727 | =head2 Borland compiler | |
728 | ||
729 | All support for the Borland compiler has been dropped. The code had not | |
730 | worked for a long time anyway. | |
731 | ||
732 | =head2 Certain deprecated Unicode properties are no longer supported by default | |
733 | ||
734 | Perl should never have exposed certain Unicode properties that are used | |
735 | by Unicode internally and not meant to be publicly available. Use of | |
736 | these has generated deprecated warning messages since Perl 5.12. The | |
737 | removed properties are Other_Alphabetic, | |
738 | Other_Default_Ignorable_Code_Point, Other_Grapheme_Extend, | |
739 | Other_ID_Continue, Other_ID_Start, Other_Lowercase, Other_Math, and | |
740 | Other_Uppercase. | |
741 | ||
742 | Perl may be recompiled to include any or all of them; instructions are | |
743 | given in | |
744 | L<perluniprops/Unicode character properties that are NOT accepted by Perl>. | |
745 | ||
746 | =head2 Dereferencing IO thingies as typeglobs | |
747 | ||
748 | The C<*{...}> operator, when passed a reference to an IO thingy (as in | |
749 | C<*{*STDIN{IO}}>), creates a new typeglob containing just that IO object. | |
750 | Previously, it would stringify as an empty string, but some operators would | |
751 | treat it as undefined, producing an "uninitialized" warning. | |
752 | Now it stringifies as __ANONIO__ [perl #96326]. | |
753 | ||
754 | =head2 User-defined case-changing operations | |
755 | ||
756 | This feature was deprecated in Perl 5.14, and has now been removed. | |
757 | The CPAN module L<Unicode::Casing> provides better functionality without | |
758 | the drawbacks that this feature had, as are detailed in the 5.14 | |
759 | documentation: | |
760 | L<http://perldoc.perl.org/5.14.0/perlunicode.html#User-Defined-Case-Mappings-%28for-serious-hackers-only%29> | |
761 | ||
762 | =head2 XSUBs are now 'static' | |
763 | ||
764 | XSUB C functions are now 'static', that is, they are not visible from | |
765 | outside the compilation unit. Users can use the new C<XS_EXTERNAL(name)> | |
1540de7c | 766 | and C<XS_INTERNAL(name)> macros to pick the desired linking behavior. |
05c8f9ed RS |
767 | The ordinary C<XS(name)> declaration for XSUBs will continue to declare |
768 | non-'static' XSUBs for compatibility, but the XS compiler, | |
9d83d6bd | 769 | L<ExtUtils::ParseXS> (C<xsubpp>) will emit 'static' XSUBs by default. |
1540de7c | 770 | L<ExtUtils::ParseXS>'s behavior can be reconfigured from XS using the |
05c8f9ed RS |
771 | C<EXPORT_XSUB_SYMBOLS> keyword. See L<perlxs> for details. |
772 | ||
773 | =head2 Weakening read-only references | |
774 | ||
775 | Weakening read-only references is no longer permitted. It should never | |
7af9a95b | 776 | have worked anyway, and could sometimes result in crashes. |
05c8f9ed RS |
777 | |
778 | =head2 Tying scalars that hold typeglobs | |
779 | ||
780 | Attempting to tie a scalar after a typeglob was assigned to it would | |
781 | instead tie the handle in the typeglob's IO slot. This meant that it was | |
782 | impossible to tie the scalar itself. Similar problems affected C<tied> and | |
783 | C<untie>: C<tied $scalar> would return false on a tied scalar if the last | |
784 | thing returned was a typeglob, and C<untie $scalar> on such a tied scalar | |
785 | would do nothing. | |
786 | ||
787 | We fixed this problem before Perl 5.14.0, but it caused problems with some | |
788 | CPAN modules, so we put in a deprecation cycle instead. | |
789 | ||
790 | Now the deprecation has been removed and this bug has been fixed. So | |
791 | C<tie $scalar> will always tie the scalar, not the handle it holds. To tie | |
792 | the handle, use C<tie *$scalar> (with an explicit asterisk). The same | |
793 | applies to C<tied *$scalar> and C<untie *$scalar>. | |
794 | ||
795 | =head2 IPC::Open3 no longer provides C<xfork()>, C<xclose_on_exec()> | |
796 | and C<xpipe_anon()> | |
797 | ||
7af9a95b | 798 | All three functions were private, undocumented, and unexported. They do |
05c8f9ed RS |
799 | not appear to be used by any code on CPAN. Two have been inlined and one |
800 | deleted entirely. | |
801 | ||
802 | =head2 C<$$> no longer caches PID | |
803 | ||
804 | Previously, if one called fork(3) from C, Perl's | |
805 | notion of C<$$> could go out of sync with what getpid() returns. By always | |
806 | fetching the value of C<$$> via getpid(), this potential bug is eliminated. | |
807 | Code that depends on the caching behavior will break. As described in | |
808 | L<Core Enhancements|/C<$$> can be assigned to>, | |
809 | C<$$> is now writable, but it will be reset during a | |
810 | fork. | |
811 | ||
812 | =head2 C<$$> and C<getppid()> no longer emulate POSIX semantics under LinuxThreads | |
813 | ||
814 | The POSIX emulation of C<$$> and C<getppid()> under the obsolete | |
815 | LinuxThreads implementation has been removed. | |
816 | This only impacts users of Linux 2.4 and | |
817 | users of Debian GNU/kFreeBSD up to and including 6.0, not the vast | |
818 | majority of Linux installations that use NPTL threads. | |
819 | ||
820 | This means that C<getppid()>, like C<$$>, is now always guaranteed to | |
821 | return the OS's idea of the current state of the process, not perl's | |
822 | cached version of it. | |
823 | ||
824 | See the documentation for L<$$|perlvar/$$> for details. | |
825 | ||
826 | =head2 C<< $< >>, C<< $> >>, C<$(> and C<$)> are no longer cached | |
827 | ||
828 | Similarly to the changes to C<$$> and C<getppid()>, the internal | |
829 | caching of C<< $< >>, C<< $> >>, C<$(> and C<$)> has been removed. | |
830 | ||
831 | When we cached these values our idea of what they were would drift out | |
832 | of sync with reality if someone (e.g., someone embedding perl) called | |
833 | C<sete?[ug]id()> without updating C<PL_e?[ug]id>. Having to deal with | |
834 | this complexity wasn't worth it given how cheap the C<gete?[ug]id()> | |
835 | system call is. | |
836 | ||
837 | This change will break a handful of CPAN modules that use the XS-level | |
838 | C<PL_uid>, C<PL_gid>, C<PL_euid> or C<PL_egid> variables. | |
839 | ||
840 | The fix for those breakages is to use C<PerlProc_gete?[ug]id()> to | |
7af9a95b | 841 | retrieve them (e.g., C<PerlProc_getuid()>), and not to assign to |
05c8f9ed RS |
842 | C<PL_e?[ug]id> if you change the UID/GID/EUID/EGID. There is no longer |
843 | any need to do so since perl will always retrieve the up-to-date | |
844 | version of those values from the OS. | |
845 | ||
846 | =head2 Which Non-ASCII characters get quoted by C<quotemeta> and C<\Q> has changed | |
847 | ||
848 | This is unlikely to result in a real problem, as Perl does not attach | |
849 | special meaning to any non-ASCII character, so it is currently | |
850 | irrelevant which are quoted or not. This change fixes bug [perl #77654] and | |
5a2baa23 | 851 | brings Perl's behavior more into line with Unicode's recommendations. |
05c8f9ed RS |
852 | See L<perlfunc/quotemeta>. |
853 | ||
854 | =head1 Performance Enhancements | |
855 | ||
856 | =over | |
857 | ||
858 | =item * | |
859 | ||
860 | Improved performance for Unicode properties in regular expressions | |
861 | ||
862 | =for comment Can this be compacted some? -- rjbs, 2012-02-20 | |
863 | ||
864 | Matching a code point against a Unicode property is now done via a | |
865 | binary search instead of linear. This means for example that the worst | |
866 | case for a 1000 item property is 10 probes instead of 1000. This | |
867 | inefficiency has been compensated for in the past by permanently storing | |
868 | in a hash the results of a given probe plus the results for the adjacent | |
869 | 64 code points, under the theory that near-by code points are likely to | |
870 | be searched for. A separate hash was used for each mention of a Unicode | |
871 | property in each regular expression. Thus, C<qr/\p{foo}abc\p{foo}/> | |
872 | would generate two hashes. Any probes in one instance would be unknown | |
873 | to the other, and the hashes could expand separately to be quite large | |
874 | if the regular expression were used on many different widely-separated | |
fd85cc12 | 875 | code points. |
05c8f9ed RS |
876 | Now, however, there is just one hash shared by all instances of a given |
877 | property. This means that if C<\p{foo}> is matched against "A" in one | |
878 | regular expression in a thread, the result will be known immediately to | |
879 | all regular expressions, and the relentless march of using up memory is | |
880 | slowed considerably. | |
881 | ||
882 | =item * | |
883 | ||
884 | Version declarations with the C<use> keyword (e.g., C<use 5.012>) are now | |
885 | faster, as they enable features without loading F<feature.pm>. | |
886 | ||
887 | =item * | |
888 | ||
889 | C<local $_> is faster now, as it no longer iterates through magic that it | |
890 | is not going to copy anyway. | |
891 | ||
892 | =item * | |
893 | ||
894 | Perl 5.12.0 sped up the destruction of objects whose classes define | |
895 | empty C<DESTROY> methods (to prevent autoloading), by simply not | |
1540de7c | 896 | calling such empty methods. This release takes this optimization a |
05c8f9ed RS |
897 | step further, by not calling any C<DESTROY> method that begins with a |
898 | C<return> statement. This can be useful for destructors that are only | |
899 | used for debugging: | |
900 | ||
901 | use constant DEBUG => 1; | |
902 | sub DESTROY { return unless DEBUG; ... } | |
903 | ||
904 | Constant-folding will reduce the first statement to C<return;> if DEBUG | |
1540de7c | 905 | is set to 0, triggering this optimization. |
05c8f9ed RS |
906 | |
907 | =item * | |
908 | ||
909 | Assigning to a variable that holds a typeglob or copy-on-write scalar | |
910 | is now much faster. Previously the typeglob would be stringified or | |
911 | the copy-on-write scalar would be copied before being clobbered. | |
912 | ||
913 | =item * | |
914 | ||
915 | Assignment to C<substr> in void context is now more than twice its | |
916 | previous speed. Instead of creating and returning a special lvalue | |
917 | scalar that is then assigned to, C<substr> modifies the original string | |
918 | itself. | |
919 | ||
920 | =item * | |
921 | ||
922 | C<substr> no longer calculates a value to return when called in void | |
923 | context. | |
924 | ||
925 | =item * | |
926 | ||
927 | Due to changes in L<File::Glob>, Perl's C<glob> function and its C<< | |
928 | <...> >> equivalent are now much faster. The splitting of the pattern | |
7af9a95b | 929 | into words has been rewritten in C, resulting in speed-ups of 20% for |
05c8f9ed RS |
930 | some cases. |
931 | ||
932 | This does not affect C<glob> on VMS, as it does not use File::Glob. | |
933 | ||
934 | =item * | |
935 | ||
936 | The short-circuiting operators C<&&>, C<||>, and C<//>, when chained | |
937 | (such as C<$a || $b || $c>), are now considerably faster to short-circuit, | |
938 | due to reduced optree traversal. | |
939 | ||
940 | =item * | |
941 | ||
942 | The implementation of C<s///r> makes one fewer copy of the scalar's value. | |
943 | ||
944 | =item * | |
945 | ||
05c8f9ed RS |
946 | Recursive calls to lvalue subroutines in lvalue scalar context use less |
947 | memory. | |
948 | ||
949 | =back | |
950 | ||
951 | =head1 Modules and Pragmata | |
952 | ||
953 | =head2 Deprecated Modules | |
954 | ||
955 | =over | |
956 | ||
957 | =item L<Version::Requirements> | |
958 | ||
959 | Version::Requirements is now DEPRECATED, use L<CPAN::Meta::Requirements>, | |
960 | which is a drop-in replacement. It will be deleted from perl.git blead | |
961 | in v5.17.0. | |
962 | ||
963 | =back | |
964 | ||
965 | =head2 New Modules and Pragmata | |
966 | ||
967 | =over 4 | |
968 | ||
969 | =item * | |
970 | ||
971 | L<arybase> -- this new module implements the C<$[> variable. | |
972 | ||
973 | =item * | |
974 | ||
9d83d6bd | 975 | L<PerlIO::mmap> 0.010 has been added to the Perl core. |
05c8f9ed RS |
976 | |
977 | The C<mmap> PerlIO layer is no longer implemented by perl itself, but has | |
978 | been moved out into the new L<PerlIO::mmap> module. | |
979 | ||
980 | =back | |
981 | ||
982 | =head2 Updated Modules and Pragmata | |
983 | ||
b7f87eaf RS |
984 | This is only an overview of selected module updates. For a complete list of |
985 | updates, run: | |
986 | ||
987 | $ corelist --diff 5.14.0 5.16.0 | |
988 | ||
989 | You can substitute your favorite version in place of 5.14.0, too. | |
990 | ||
05c8f9ed RS |
991 | =over 4 |
992 | ||
993 | =item * | |
994 | ||
91acaa3b | 995 | L<Archive::Extract> has been upgraded from version 0.48 to 0.58. |
b46815fd RS |
996 | |
997 | Includes a fix for FreeBSD to only use C<unzip> if it is located in | |
998 | C</usr/local/bin>, as FreeBSD 9.0 will ship with a limited C<unzip> in | |
999 | C</usr/bin>. | |
1000 | ||
1001 | =item * | |
1002 | ||
91acaa3b | 1003 | L<Archive::Tar> has been upgraded from version 1.76 to 1.82. |
b46815fd RS |
1004 | |
1005 | Adjustments to handle files >8gb (>0777777777777 octal) and a feature | |
1006 | to return the MD5SUM of files in the archive. | |
1007 | ||
1008 | =item * | |
1009 | ||
91acaa3b | 1010 | L<base> has been upgraded from version 2.16 to 2.18. |
b46815fd RS |
1011 | |
1012 | C<base> no longer sets a module's C<$VERSION> to "-1" when a module it | |
1013 | loads does not define a C<$VERSION>. This change has been made because | |
1014 | "-1" is not a valid version number under the new "lax" criteria used | |
1015 | internally by C<UNIVERSAL::VERSION>. (See L<version> for more on "lax" | |
1016 | version criteria.) | |
1017 | ||
1018 | C<base> no longer internally skips loading modules it has already loaded | |
1019 | and instead relies on C<require> to inspect C<%INC>. This fixes a bug | |
1020 | when C<base> is used with code that clear C<%INC> to force a module to | |
1021 | be reloaded. | |
1022 | ||
1023 | =item * | |
1024 | ||
91acaa3b | 1025 | L<Carp> has been upgraded from version 1.20 to 1.26. |
b46815fd RS |
1026 | |
1027 | It now includes last read filehandle info and puts a dot after the file | |
1028 | and line number, just like errors from C<die> [perl #106538]. | |
1029 | ||
1030 | =item * | |
1031 | ||
91acaa3b | 1032 | L<charnames> has been updated from version 1.18 to 1.30. |
b46815fd | 1033 | |
959e5662 | 1034 | C<charnames> can now be invoked with a new option, C<:loose>, |
b46815fd RS |
1035 | which is like the existing C<:full> option, but enables Unicode loose |
1036 | name matching. Details are in L<charnames/LOOSE MATCHES>. | |
1037 | ||
1038 | =item * | |
1039 | ||
1040 | L<B::Deparse> has been upgraded from version 1.03 to 1.14. This fixes | |
1041 | numerous deparsing bugs. | |
1042 | ||
1043 | =item * | |
1044 | ||
91acaa3b | 1045 | L<CGI> has been upgraded from version 3.52 to 3.59. |
b46815fd | 1046 | |
e019578d | 1047 | It uses the public and documented FCGI.pm API in CGI::Fast. CGI::Fast was |
b46815fd RS |
1048 | using an FCGI API that was deprecated and removed from documentation |
1049 | more than ten years ago. Usage of this deprecated API with FCGI E<gt>= | |
1050 | 0.70 or FCGI E<lt>= 0.73 introduces a security issue. | |
1051 | L<https://rt.cpan.org/Public/Bug/Display.html?id=68380> | |
1052 | L<http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-2766> | |
1053 | ||
1054 | Things that may break your code: | |
1055 | ||
1056 | C<url()> was fixed to return C<PATH_INFO> when it is explicitly requested | |
1057 | with either the C<path=E<gt>1> or C<path_info=E<gt>1> flag. | |
1058 | ||
1059 | If your code is running under mod_rewrite (or compatible) and you are | |
1060 | calling C<self_url()> or you are calling C<url()> and passing | |
5f08bd67 | 1061 | C<path_info=E<gt>1>, these methods will actually be returning |
04521166 | 1062 | C<PATH_INFO> now, as you have explicitly requested or C<self_url()> |
b46815fd RS |
1063 | has requested on your behalf. |
1064 | ||
1065 | The C<PATH_INFO> has been omitted in such URLs since the issue was | |
1066 | introduced in the 3.12 release in December, 2005. | |
1067 | ||
1068 | This bug is so old your application may have come to depend on it or | |
1069 | workaround it. Check for application before upgrading to this release. | |
1070 | ||
1071 | Examples of affected method calls: | |
1072 | ||
6a9cb335 FC |
1073 | $q->url(-absolute => 1, -query => 1, -path_info => 1); |
1074 | $q->url(-path=>1); | |
1075 | $q->url(-full=>1,-path=>1); | |
1076 | $q->url(-rewrite=>1,-path=>1); | |
b46815fd RS |
1077 | $q->self_url(); |
1078 | ||
1079 | We no longer read from STDIN when the Content-Length is not set, | |
7af9a95b | 1080 | preventing requests with no Content-Length from sometimes freezing. |
b46815fd | 1081 | This is consistent with the CGI RFC 3875, and is also consistent with |
71d9f308 | 1082 | CGI::Simple. However, the old behavior may have been expected by some |
b46815fd RS |
1083 | command-line uses of CGI.pm. |
1084 | ||
b8206f26 KW |
1085 | In addition, the DELETE HTTP verb is now supported. |
1086 | ||
b46815fd RS |
1087 | =item * |
1088 | ||
91acaa3b | 1089 | L<Compress::Zlib> has been upgraded from version 2.035 to 2.048. |
b46815fd RS |
1090 | |
1091 | IO::Compress::Zip and IO::Uncompress::Unzip now have support for LZMA | |
1092 | (method 14). There is a fix for a CRC issue in IO::Compress::Unzip and | |
71d9f308 | 1093 | it supports Streamed Stored context now. And fixed a Zip64 issue in |
b46815fd RS |
1094 | IO::Compress::Zip when the content size was exactly 0xFFFFFFFF. |
1095 | ||
1096 | =item * | |
1097 | ||
91acaa3b | 1098 | L<Digest::SHA> has been upgraded from version 5.61 to 5.71. |
b46815fd RS |
1099 | |
1100 | Added BITS mode to the addfile method and shasum. This makes | |
7af9a95b | 1101 | partial-byte inputs possible via files/STDIN and lets shasum check |
b46815fd RS |
1102 | all 8074 NIST Msg vectors, where previously special programming was |
1103 | required to do this. | |
1104 | ||
1105 | =item * | |
1106 | ||
91acaa3b | 1107 | L<Encode> has been upgraded from version 2.42 to 2.44. |
b46815fd RS |
1108 | |
1109 | Missing aliases added, a deep recursion error fixed and various | |
1110 | documentation updates. | |
1111 | ||
1112 | Addressed 'decode_xs n-byte heap-overflow' security bug in Unicode.xs | |
006b5090 | 1113 | (CVE-2011-2939). (5.14.2) |
b46815fd RS |
1114 | |
1115 | =item * | |
1116 | ||
1117 | L<ExtUtils::CBuilder> updated from version 0.280203 to 0.280206. | |
1118 | ||
1119 | The new version appends CFLAGS and LDFLAGS to their Config.pm | |
1120 | counterparts. | |
1121 | ||
1122 | =item * | |
1123 | ||
1124 | L<ExtUtils::ParseXS> has been upgraded from version 2.2210 to 3.16. | |
1125 | ||
1126 | Much of L<ExtUtils::ParseXS>, the module behind the XS compiler C<xsubpp>, | |
71d9f308 | 1127 | was rewritten and cleaned up. It has been made somewhat more extensible |
b46815fd RS |
1128 | and now finally uses strictures. |
1129 | ||
1130 | The typemap logic has been moved into a separate module, | |
1131 | L<ExtUtils::Typemaps>. See L</New Modules and Pragmata>, above. | |
1132 | ||
1133 | For a complete set of changes, please see the ExtUtils::ParseXS | |
1134 | changelog, available on the CPAN. | |
1135 | ||
1136 | =item * | |
1137 | ||
91acaa3b | 1138 | L<File::Glob> has been upgraded from version 1.12 to 1.17. |
b46815fd RS |
1139 | |
1140 | On Windows, tilde (~) expansion now checks the C<USERPROFILE> environment | |
1141 | variable, after checking C<HOME>. | |
1142 | ||
1143 | It has a new C<:bsd_glob> export tag, intended to replace C<:glob>. Like | |
1144 | C<:glob> it overrides C<glob> with a function that does not split the glob | |
1145 | pattern into words, but, unlike C<:glob>, it iterates properly in scalar | |
1146 | context, instead of returning the last file. | |
1147 | ||
1148 | There are other changes affecting Perl's own C<glob> operator (which uses | |
1149 | File::Glob internally, except on VMS). See L</Performance Enhancements> | |
1150 | and L</Selected Bug Fixes>. | |
1151 | ||
1152 | =item * | |
1153 | ||
1154 | L<FindBin> updated from version 1.50 to 1.51. | |
1155 | ||
1156 | It no longer returns a wrong result if a script of the same name as the | |
1157 | current one exists in the path and is executable. | |
1158 | ||
1159 | =item * | |
1160 | ||
91acaa3b | 1161 | L<HTTP::Tiny> has been upgraded from version 0.012 to 0.017. |
b46815fd RS |
1162 | |
1163 | Added support for using C<$ENV{http_proxy}> to set the default proxy host. | |
1164 | ||
1165 | Adds additional shorthand methods for all common HTTP verbs, | |
1166 | a C<post_form()> method for POST-ing x-www-form-urlencoded data and | |
1167 | a C<www_form_urlencode()> utility method. | |
1168 | ||
1169 | =item * | |
1170 | ||
1171 | L<IO> has been upgraded from version 1.25_04 to 1.25_06, and L<IO::Handle> | |
1172 | from version 1.31 to 1.33. | |
1173 | ||
1174 | Together, these upgrades fix a problem with IO::Handle's C<getline> and | |
1175 | C<getlines> methods. When these methods are called on the special ARGV | |
1176 | handle, the next file is automatically opened, as happens with the built-in | |
1177 | C<E<lt>E<gt>> and C<readline> functions. But, unlike the built-ins, these | |
1178 | methods were not respecting the caller's use of the L<open> pragma and | |
7af9a95b | 1179 | applying the appropriate I/O layers to the newly-opened file |
b46815fd RS |
1180 | [rt.cpan.org #66474]. |
1181 | ||
1182 | =item * | |
1183 | ||
91acaa3b | 1184 | L<IPC::Cmd> has been upgraded from version 0.70 to 0.76. |
b46815fd RS |
1185 | |
1186 | Capturing of command output (both C<STDOUT> and C<STDERR>) is now supported | |
1187 | using L<IPC::Open3> on MSWin32 without requiring L<IPC::Run>. | |
1188 | ||
1189 | =item * | |
1190 | ||
91acaa3b | 1191 | L<IPC::Open3> has been upgraded from version 1.09 to 1.12. |
b46815fd | 1192 | |
b46815fd RS |
1193 | Fixes a bug which prevented use of C<open3> on Windows when C<*STDIN>, |
1194 | C<*STDOUT> or C<*STDERR> had been localized. | |
1195 | ||
b46815fd RS |
1196 | Fixes a bug which prevented duplicating numeric file descriptors on Windows. |
1197 | ||
b46815fd RS |
1198 | C<open3> with "-" for the program name works once more. This was broken in |
1199 | version 1.06 (and hence in Perl 5.14.0) [perl #95748]. | |
1200 | ||
b46815fd RS |
1201 | =item * |
1202 | ||
91acaa3b | 1203 | L<Locale::Codes> has been upgraded from version 3.16 to 3.21. |
b46815fd RS |
1204 | |
1205 | Added Language Extension codes (langext) and Language Variation codes (langvar) | |
1206 | as defined in the IANA language registry. | |
1207 | ||
1208 | Added language codes from ISO 639-5 | |
1209 | ||
1210 | Added language/script codes from the IANA language subtag registry | |
1211 | ||
f0a7e474 | 1212 | Fixed an uninitialized value warning [rt.cpan.org #67438]. |
b46815fd | 1213 | |
f0a7e474 FC |
1214 | Fixed the return value for the all_XXX_codes and all_XXX_names functions |
1215 | [rt.cpan.org #69100]. | |
b46815fd RS |
1216 | |
1217 | Reorganized modules to move Locale::MODULE to Locale::Codes::MODULE to allow | |
1218 | for cleaner future additions. The original four modules (Locale::Language, | |
1219 | Locale::Currency, Locale::Country, Locale::Script) will continue to work, but | |
1220 | all new sets of codes will be added in the Locale::Codes namespace. | |
1221 | ||
1222 | The code2XXX, XXX2code, all_XXX_codes, and all_XXX_names functions now | |
1223 | support retired codes. All codesets may be specified by a constant or | |
1224 | by their name now. Previously, they were specified only by a constant. | |
1225 | ||
1226 | The alias_code function exists for backward compatibility. It has been | |
1227 | replaced by rename_country_code. The alias_code function will be | |
1228 | removed some time after September, 2013. | |
1229 | ||
1230 | All work is now done in the central module (Locale::Codes). Previously, | |
1231 | some was still done in the wrapper modules (Locale::Codes::*). Added | |
1232 | Language Family codes (langfam) as defined in ISO 639-5. | |
1233 | ||
1234 | =item * | |
1235 | ||
1236 | L<Math::BigFloat> has been upgraded from version 1.993 to 1.997. | |
1237 | ||
1540de7c | 1238 | The C<numify> method has been corrected to return a normalized Perl number |
b46815fd RS |
1239 | (the result of C<0 + $thing>), instead of a string [rt.cpan.org #66732]. |
1240 | ||
1241 | =item * | |
1242 | ||
1243 | L<Math::BigInt> has been upgraded from version 1.994 to 1.998. | |
1244 | ||
1245 | It provides a new C<bsgn> method that complements the C<babs> method. | |
1246 | ||
1247 | It fixes the internal C<objectify> function's handling of "foreign objects" | |
1248 | so they are converted to the appropriate class (Math::BigInt or | |
1249 | Math::BigFloat). | |
1250 | ||
1251 | =item * | |
1252 | ||
91acaa3b | 1253 | L<Math::BigRat> has been upgraded from version 0.2602 to 0.2603. |
b46815fd RS |
1254 | |
1255 | C<int()> on a Math::BigRat object containing -1/2 now creates a | |
1256 | Math::BigInt containing 0, rather than -0. L<Math::BigInt> does not even | |
1257 | support negative zero, so the resulting object was actually malformed | |
1258 | [perl #95530]. | |
1259 | ||
1260 | =item * | |
1261 | ||
91acaa3b FC |
1262 | L<Math::Complex> has been upgraded from version 1.56 to 1.59 |
1263 | and L<Math::Trig> from version 1.2 to 1.22. | |
b46815fd RS |
1264 | |
1265 | Fixes include: correct copy constructor usage; fix polarwise formatting with | |
1266 | numeric format specifier; and more stable C<great_circle_direction> algorithm. | |
1267 | ||
1268 | =item * | |
1269 | ||
1270 | L<Module::CoreList> has been upgraded from version 2.51 to 2.66. | |
1271 | ||
1272 | The C<corelist> utility now understands the C<-r> option for displaying | |
1273 | Perl release dates and the C<--diff> option to print the set of modlib | |
1274 | changes between two perl distributions. | |
1275 | ||
1276 | =item * | |
1277 | ||
9d83d6bd | 1278 | L<Module::Metadata> has been upgraded from version 1.000004 to 1.000009. |
b46815fd RS |
1279 | |
1280 | Adds C<provides> method to generate a CPAN META provides data structure | |
1281 | correctly; use of C<package_versions_from_directory> is discouraged. | |
1282 | ||
1283 | =item * | |
1284 | ||
91acaa3b | 1285 | L<ODBM_File> has been upgraded from version 1.10 to 1.12. |
b46815fd RS |
1286 | |
1287 | The XS code is now compiled with C<PERL_NO_GET_CONTEXT>, which will aid | |
1288 | performance under ithreads. | |
1289 | ||
1290 | =item * | |
1291 | ||
1292 | L<open> has been upgraded from version 1.08 to 1.10. | |
1293 | ||
62f11196 | 1294 | It no longer turns off layers on standard handles when invoked without the |
b46815fd RS |
1295 | ":std" directive. Similarly, when invoked I<with> the ":std" directive, it |
1296 | now clears layers on STDERR before applying the new ones, and not just on | |
1297 | STDIN and STDOUT [perl #92728]. | |
1298 | ||
1299 | =item * | |
1300 | ||
91acaa3b | 1301 | L<overload> has been upgraded from version 1.13 to 1.18. |
b46815fd RS |
1302 | |
1303 | C<overload::Overloaded> no longer calls C<can> on the class, but uses | |
1304 | another means to determine whether the object has overloading. It was | |
1305 | never correct for it to call C<can>, as overloading does not respect | |
1306 | AUTOLOAD. So classes that autoload methods and implement C<can> no longer | |
1307 | have to account for overloading [perl #40333]. | |
1308 | ||
1309 | A warning is now produced for invalid arguments. See L</New Diagnostics>. | |
1310 | ||
1311 | =item * | |
1312 | ||
1313 | L<PerlIO::scalar> has been upgraded from version 0.11 to 0.14. | |
1314 | ||
1315 | (This is the module that implements C<< open $fh, '>', \$scalar >>.) | |
1316 | ||
1317 | It fixes a problem with C<< open my $fh, ">", \$scalar >> not working if | |
006b5090 | 1318 | C<$scalar> is a copy-on-write scalar. (5.14.2) |
b46815fd RS |
1319 | |
1320 | It also fixes a hang that occurs with C<readline> or C<< <$fh> >> if a | |
1321 | typeglob has been assigned to $scalar [perl #92258]. | |
1322 | ||
1323 | It no longer assumes during C<seek> that $scalar is a string internally. | |
1324 | If it didn't crash, it was close to doing so [perl #92706]. Also, the | |
1325 | internal print routine no longer assumes that the position set by C<seek> | |
1326 | is valid, but extends the string to that position, filling the intervening | |
1327 | bytes (between the old length and the seek position) with nulls | |
1328 | [perl #78980]. | |
1329 | ||
1330 | Printing to an in-memory handle now works if the $scalar holds a reference, | |
1331 | stringifying the reference before modifying it. References used to be | |
1332 | treated as empty strings. | |
1333 | ||
1334 | Printing to an in-memory handle no longer crashes if the $scalar happens to | |
1335 | hold a number internally, but no string buffer. | |
1336 | ||
1337 | Printing to an in-memory handle no longer creates scalars that confuse | |
1338 | the regular expression engine [perl #108398]. | |
1339 | ||
1340 | =item * | |
1341 | ||
9d83d6bd | 1342 | L<Pod::Functions> has been upgraded from version 1.04 to 1.05. |
b46815fd RS |
1343 | |
1344 | F<Functions.pm> is now generated at perl build time from annotations in | |
71d9f308 | 1345 | F<perlfunc.pod>. This will ensure that L<Pod::Functions> and L<perlfunc> |
b46815fd RS |
1346 | remain in synchronisation. |
1347 | ||
1348 | =item * | |
1349 | ||
1350 | L<Pod::Html> has been upgraded from version 1.11 to 1.1502. | |
1351 | ||
1352 | This is an extensive rewrite of Pod::Html to use L<Pod::Simple> under | |
1353 | the hood. The output has changed significantly. | |
1354 | ||
1355 | =item * | |
1356 | ||
1357 | L<Pod::Perldoc> has been upgraded from version 3.15_03 to 3.17. | |
1358 | ||
1359 | It corrects the search paths on VMS [perl #90640]. (5.14.1) | |
1360 | ||
1361 | The B<-v> option now fetches the right section for C<$0>. | |
1362 | ||
1363 | This upgrade has numerous significant fixes. Consult its changelog on | |
1364 | the CPAN for more information. | |
1365 | ||
1366 | =item * | |
1367 | ||
91acaa3b | 1368 | L<POSIX> has been upgraded from version 1.24 to 1.30. |
b46815fd | 1369 | |
71d9f308 | 1370 | L<POSIX> no longer uses L<AutoLoader>. Any code which was relying on this |
7af9a95b | 1371 | implementation detail was buggy, and may fail because of this change. |
b46815fd | 1372 | The module's Perl code has been considerably simplified, roughly halving |
71d9f308 | 1373 | the number of lines, with no change in functionality. The XS code has |
b46815fd | 1374 | been refactored to reduce the size of the shared object by about 12%, |
71d9f308 | 1375 | with no change in functionality. More POSIX functions now have tests. |
b46815fd | 1376 | |
26be0cae | 1377 | C<sigsuspend> and C<pause> now run signal handlers before returning, as the |
b46815fd RS |
1378 | whole point of these two functions is to wait until a signal has |
1379 | arrived, and then return I<after> it has been triggered. Delayed, or | |
1380 | "safe", signals were preventing that from happening, possibly resulting in | |
1381 | race conditions [perl #107216]. | |
1382 | ||
1383 | C<POSIX::sleep> is now a direct call into the underlying OS C<sleep> | |
71d9f308 FC |
1384 | function, instead of being a Perl wrapper on C<CORE::sleep>. |
1385 | C<POSIX::dup2> now returns the correct value on Win32 (I<i.e.>, the file | |
1386 | descriptor). C<POSIX::SigSet> C<sigsuspend> and C<sigpending> and | |
1387 | C<POSIX::pause> now dispatch safe signals immediately before returning to | |
1388 | their caller. | |
b46815fd RS |
1389 | |
1390 | C<POSIX::Termios::setattr> now defaults the third argument to C<TCSANOW>, | |
7af9a95b | 1391 | instead of 0. On most platforms C<TCSANOW> is defined to be 0, but on some |
b46815fd RS |
1392 | 0 is not a valid parameter, which caused a call with defaults to fail. |
1393 | ||
1394 | =item * | |
1395 | ||
23296748 | 1396 | L<Socket> has been upgraded from version 1.94 to 2.001. |
b46815fd RS |
1397 | |
1398 | It has new functions and constants for handling IPv6 sockets: | |
1399 | ||
1400 | pack_ipv6_mreq | |
1401 | unpack_ipv6_mreq | |
1402 | IPV6_ADD_MEMBERSHIP | |
1403 | IPV6_DROP_MEMBERSHIP | |
1404 | IPV6_MTU | |
1405 | IPV6_MTU_DISCOVER | |
1406 | IPV6_MULTICAST_HOPS | |
1407 | IPV6_MULTICAST_IF | |
1408 | IPV6_MULTICAST_LOOP | |
1409 | IPV6_UNICAST_HOPS | |
1410 | IPV6_V6ONLY | |
1411 | ||
1412 | =item * | |
1413 | ||
91acaa3b | 1414 | L<Storable> has been upgraded from version 2.27 to 2.34. |
b46815fd RS |
1415 | |
1416 | It no longer turns copy-on-write scalars into read-only scalars when | |
1417 | freezing and thawing. | |
1418 | ||
1419 | =item * | |
1420 | ||
91acaa3b | 1421 | L<Sys::Syslog> has been upgraded from version 0.27 to 0.29. |
b46815fd RS |
1422 | |
1423 | This upgrade closes many outstanding bugs. | |
1424 | ||
1425 | =item * | |
1426 | ||
91acaa3b | 1427 | L<Term::ANSIColor> has been upgraded from version 3.00 to 3.01. |
b46815fd RS |
1428 | |
1429 | Only interpret an initial array reference as a list of colors, not any initial | |
1430 | reference, allowing the colored function to work properly on objects with | |
1431 | stringification defined. | |
1432 | ||
1433 | =item * | |
1434 | ||
9d83d6bd | 1435 | L<Term::ReadLine> has been upgraded from version 1.07 to 1.09. |
b46815fd RS |
1436 | |
1437 | Term::ReadLine now supports any event loop, including unpublished ones and | |
ebca2fa8 | 1438 | simple L<IO::Select>, loops without the need to rewrite existing code for |
b46815fd RS |
1439 | any particular framework [perl #108470]. |
1440 | ||
1441 | =item * | |
1442 | ||
1443 | L<threads::shared> has been upgraded from version 1.37 to 1.40. | |
1444 | ||
1445 | Destructors on shared objects used to be ignored sometimes if the objects | |
1446 | were referenced only by shared data structures. This has been mostly | |
1447 | fixed, but destructors may still be ignored if the objects still exist at | |
1448 | global destruction time [perl #98204]. | |
1449 | ||
1450 | =item * | |
1451 | ||
91acaa3b | 1452 | L<Unicode::Collate> has been upgraded from version 0.73 to 0.89. |
b46815fd RS |
1453 | |
1454 | Updated to CLDR 1.9.1 | |
1455 | ||
1456 | Locales updated to CLDR 2.0: mk, mt, nb, nn, ro, ru, sk, sr, sv, uk, | |
1457 | zh__pinyin, zh__stroke | |
1458 | ||
1459 | Newly supported locales: bn, fa, ml, mr, or, pa, sa, si, si__dictionary, | |
1460 | sr_Latn, sv__reformed, ta, te, th, ur, wae. | |
1461 | ||
1462 | Tailored compatibility ideographs as well as unified ideographs for the | |
1463 | locales: ja, ko, zh__big5han, zh__gb2312han, zh__pinyin, zh__stroke. | |
1464 | ||
1465 | Locale/*.pl files are now searched for in @INC. | |
1466 | ||
1467 | =item * | |
1468 | ||
91acaa3b | 1469 | L<Unicode::Normalize> has been upgraded from version 1.10 to 1.14. |
b46815fd RS |
1470 | |
1471 | Fixes for the removal of F<unicore/CompositionExclusions.txt> from core. | |
1472 | ||
1473 | =item * | |
1474 | ||
91acaa3b | 1475 | L<Unicode::UCD> has been upgraded from version 0.32 to 0.43. |
b46815fd | 1476 | |
ebca2fa8 | 1477 | This adds four new functions: C<prop_aliases()> and |
7af9a95b | 1478 | C<prop_value_aliases()>, which are used to find all Unicode-approved |
b46815fd | 1479 | synonyms for property names, or to convert from one name to another; |
7af9a95b | 1480 | C<prop_invlist> which returns all code points matching a given |
b46815fd RS |
1481 | Unicode binary property; and C<prop_invmap> which returns the complete |
1482 | specification of a given Unicode property. | |
1483 | ||
1484 | =item * | |
1485 | ||
91acaa3b | 1486 | L<Win32API::File> has been upgraded from version 0.1101 to 0.1200. |
b46815fd RS |
1487 | |
1488 | Added SetStdHandle and GetStdHandle functions | |
05c8f9ed RS |
1489 | |
1490 | =back | |
1491 | ||
1492 | =head2 Removed Modules and Pragmata | |
1493 | ||
1494 | As promised in Perl 5.14.0's release notes, the following modules have | |
1495 | been removed from the core distribution, and if needed should be installed | |
1496 | from CPAN instead. | |
1497 | ||
1498 | =over | |
1499 | ||
1500 | =item * | |
1501 | ||
959e5662 | 1502 | L<Devel::DProf> has been removed from the Perl core. Prior version was |
05c8f9ed RS |
1503 | 20110228.00. |
1504 | ||
1505 | =item * | |
1506 | ||
959e5662 | 1507 | L<Shell> has been removed from the Perl core. Prior version was 0.72_01. |
05c8f9ed | 1508 | |
cfcbecfc RS |
1509 | =item * |
1510 | ||
1511 | Several old perl4-style libraries which have been deprecated with 5.14 | |
1512 | are now removed: | |
1513 | ||
1514 | abbrev.pl assert.pl bigfloat.pl bigint.pl bigrat.pl cacheout.pl | |
1515 | complete.pl ctime.pl dotsh.pl exceptions.pl fastcwd.pl flush.pl | |
1516 | getcwd.pl getopt.pl getopts.pl hostname.pl importenv.pl | |
1517 | lib/find{,depth}.pl look.pl newgetopt.pl open2.pl open3.pl | |
1518 | pwd.pl shellwords.pl stat.pl tainted.pl termcap.pl timelocal.pl | |
1519 | ||
1520 | They can be found on CPAN as L<Perl4::CoreLibs>. | |
1521 | ||
05c8f9ed RS |
1522 | =back |
1523 | ||
1524 | =head1 Documentation | |
1525 | ||
1526 | =head2 New Documentation | |
1527 | ||
1528 | =head3 L<perldtrace> | |
1529 | ||
1530 | L<perldtrace> describes Perl's DTrace support, listing the provided probes | |
1531 | and gives examples of their use. | |
1532 | ||
1533 | =head3 L<perlexperiment> | |
1534 | ||
1535 | This document is intended to provide a list of experimental features in | |
1536 | Perl. It is still a work in progress. | |
1537 | ||
1538 | =head3 L<perlootut> | |
1539 | ||
1540 | This a new OO tutorial. It focuses on basic OO concepts, and then recommends | |
1541 | that readers choose an OO framework from CPAN. | |
1542 | ||
1543 | =head3 L<perlxstypemap> | |
1544 | ||
1545 | The new manual describes the XS typemapping mechanism in unprecedented | |
1546 | detail and combines new documentation with information extracted from | |
1547 | L<perlxs> and the previously unofficial list of all core typemaps. | |
1548 | ||
1549 | =head2 Changes to Existing Documentation | |
1550 | ||
1551 | =head3 L<perlapi> | |
1552 | ||
1553 | =over 4 | |
1554 | ||
1555 | =item * | |
1556 | ||
7af9a95b TC |
1557 | The HV API has long accepted negative lengths to show that the key is |
1558 | in UTF8. This is now documented. | |
05c8f9ed RS |
1559 | |
1560 | =item * | |
1561 | ||
1562 | The C<boolSV()> macro is now documented. | |
1563 | ||
1564 | =back | |
1565 | ||
1566 | =head3 L<perlfunc> | |
1567 | ||
1568 | =over 4 | |
1569 | ||
1570 | =item * | |
1571 | ||
1572 | C<dbmopen> treats a 0 mode as a special case, that prevents a nonexistent | |
1573 | file from being created. This has been the case since Perl 5.000, but was | |
1574 | never documented anywhere. Now the perlfunc entry mentions it | |
1575 | [perl #90064]. | |
1576 | ||
1577 | =item * | |
1578 | ||
21c10391 | 1579 | As an accident of history, C<open $fh, '<:', ...> applies the default |
05c8f9ed RS |
1580 | layers for the platform (C<:raw> on Unix, C<:crlf> on Windows), ignoring |
1581 | whatever is declared by L<open.pm|open>. This seems such a useful feature | |
1582 | it has been documented in L<perlfunc|perlfunc/open> and L<open>. | |
1583 | ||
1584 | =item * | |
1585 | ||
1586 | The entry for C<split> has been rewritten. It is now far clearer than | |
1587 | before. | |
1588 | ||
1589 | =back | |
1590 | ||
1591 | =head3 L<perlguts> | |
1592 | ||
1593 | =over 4 | |
1594 | ||
1595 | =item * | |
1596 | ||
1597 | A new section, L<Autoloading with XSUBs|perlguts/Autoloading with XSUBs>, | |
1598 | has been added, which explains the two APIs for accessing the name of the | |
1599 | autoloaded sub. | |
1600 | ||
1601 | =item * | |
1602 | ||
7af9a95b | 1603 | Some function descriptions in L<perlguts> were confusing, as it was |
05c8f9ed RS |
1604 | not clear whether they referred to the function above or below the |
1605 | description. This has been clarified [perl #91790]. | |
1606 | ||
1607 | =back | |
1608 | ||
1609 | =head3 L<perlobj> | |
1610 | ||
1611 | =over 4 | |
1612 | ||
1613 | =item * | |
1614 | ||
1615 | This document has been rewritten from scratch, and its coverage of various OO | |
1616 | concepts has been expanded. | |
1617 | ||
1618 | =back | |
1619 | ||
1620 | =head3 L<perlop> | |
1621 | ||
1622 | =over 4 | |
1623 | ||
1624 | =item * | |
1625 | ||
1626 | Documentation of the smartmatch operator has been reworked and moved from | |
1627 | perlsyn to perlop where it belongs. | |
1628 | ||
1629 | It has also been corrected for the case of C<undef> on the left-hand | |
1540de7c | 1630 | side. The list of different smart match behaviors had an item in the |
05c8f9ed RS |
1631 | wrong place. |
1632 | ||
1633 | =item * | |
1634 | ||
1635 | Documentation of the ellipsis statement (C<...>) has been reworked and | |
1636 | moved from perlop to perlsyn. | |
1637 | ||
1638 | =item * | |
1639 | ||
1640 | The explanation of bitwise operators has been expanded to explain how they | |
1641 | work on Unicode strings (5.14.1). | |
1642 | ||
1643 | =item * | |
1644 | ||
1645 | More examples for C<m//g> have been added (5.14.1). | |
1646 | ||
1647 | =item * | |
1648 | ||
1649 | The C<<< <<\FOO >>> here-doc syntax has been documented (5.14.1). | |
1650 | ||
1651 | =back | |
1652 | ||
1653 | =head3 L<perlpragma> | |
1654 | ||
1655 | =over 4 | |
1656 | ||
1657 | =item * | |
1658 | ||
1659 | There is now a standard convention for naming keys in the C<%^H>, | |
1660 | documented under L<Key naming|perlpragma/Key naming>. | |
1661 | ||
1662 | =back | |
1663 | ||
1664 | =head3 L<perlsec/Laundering and Detecting Tainted Data> | |
1665 | ||
1666 | =over 4 | |
1667 | ||
1668 | =item * | |
1669 | ||
1670 | The example function for checking for taintedness contained a subtle | |
1671 | error. C<$@> needs to be localized to prevent its changing this | |
1672 | global's value outside the function. The preferred method to check for | |
1673 | this remains L<Scalar::Util/tainted>. | |
1674 | ||
1675 | =back | |
1676 | ||
1677 | =head3 L<perllol> | |
1678 | ||
1679 | =over | |
1680 | ||
1681 | =item * | |
1682 | ||
1683 | L<perllol> has been expanded with examples using the new C<push $scalar> | |
1684 | syntax introduced in Perl 5.14.0 (5.14.1). | |
1685 | ||
1686 | =back | |
1687 | ||
1688 | =head3 L<perlmod> | |
1689 | ||
1690 | =over | |
1691 | ||
1692 | =item * | |
1693 | ||
1694 | L<perlmod> now states explicitly that some types of explicit symbol table | |
1695 | manipulation are not supported. This codifies what was effectively already | |
1696 | the case [perl #78074]. | |
1697 | ||
1698 | =back | |
1699 | ||
1700 | =head3 L<perlpodstyle> | |
1701 | ||
1702 | =over 4 | |
1703 | ||
1704 | =item * | |
1705 | ||
1706 | The tips on which formatting codes to use have been corrected and greatly | |
1707 | expanded. | |
1708 | ||
1709 | =item * | |
1710 | ||
1711 | There are now a couple of example one-liners for previewing POD files after | |
1712 | they have been edited. | |
1713 | ||
1714 | =back | |
1715 | ||
1716 | =head3 L<perlre> | |
1717 | ||
1718 | =over | |
1719 | ||
1720 | =item * | |
1721 | ||
1722 | The C<(*COMMIT)> directive is now listed in the right section | |
1723 | (L<Verbs without an argument|perlre/Verbs without an argument>). | |
1724 | ||
1725 | =back | |
1726 | ||
1727 | =head3 L<perlrun> | |
1728 | ||
1729 | =over | |
1730 | ||
1731 | =item * | |
1732 | ||
1733 | L<perlrun> has undergone a significant clean-up. Most notably, the | |
1734 | B<-0x...> form of the B<-0> flag has been clarified, and the final section | |
1735 | on environment variables has been corrected and expanded (5.14.1). | |
1736 | ||
1737 | =back | |
1738 | ||
1739 | =head3 L<perlsub> | |
1740 | ||
1741 | =over | |
1742 | ||
1743 | =item * | |
1744 | ||
1745 | The ($;) prototype syntax, which has existed for rather a long time, is now | |
7af9a95b | 1746 | documented in L<perlsub>. It lets a unary function have the same |
05c8f9ed RS |
1747 | precedence as a list operator. |
1748 | ||
1749 | =back | |
1750 | ||
1751 | =head3 L<perltie> | |
1752 | ||
1753 | =over | |
1754 | ||
1755 | =item * | |
1756 | ||
1757 | The required syntax for tying handles has been documented. | |
1758 | ||
1759 | =back | |
1760 | ||
1761 | =head3 L<perlvar> | |
1762 | ||
1763 | =over | |
1764 | ||
1765 | =item * | |
1766 | ||
1767 | The documentation for L<$!|perlvar/$!> has been corrected and clarified. | |
1768 | It used to state that $! could be C<undef>, which is not the case. It was | |
7af9a95b | 1769 | also unclear whether system calls set C's C<errno> or Perl's C<$!> |
05c8f9ed RS |
1770 | [perl #91614]. |
1771 | ||
1772 | =item * | |
1773 | ||
1774 | Documentation for L<$$|perlvar/$$> has been amended with additional | |
1775 | cautions regarding changing the process ID. | |
1776 | ||
1777 | =back | |
1778 | ||
1779 | =head3 Other Changes | |
1780 | ||
1781 | =over 4 | |
1782 | ||
1783 | =item * | |
1784 | ||
1785 | L<perlxs> was extended with documentation on inline typemaps. | |
1786 | ||
1787 | =item * | |
1788 | ||
1789 | L<perlref> has a new L<Circular References|perlref/Circular References> | |
1790 | section explaining how circularities may not be freed and how to solve that | |
1791 | with weak references. | |
1792 | ||
1793 | =item * | |
1794 | ||
1795 | Parts of L<perlapi> were clarified, and Perl equivalents of some C | |
1796 | functions have been added as an additional mode of exposition. | |
1797 | ||
1798 | =item * | |
1799 | ||
1800 | A few parts of L<perlre> and L<perlrecharclass> were clarified. | |
1801 | ||
1802 | =back | |
1803 | ||
1804 | =head2 Removed Documentation | |
1805 | ||
1806 | =head3 Old OO Documentation | |
1807 | ||
7af9a95b | 1808 | The old OO tutorials, perltoot, perltooc, and perlboot, have been |
05c8f9ed RS |
1809 | removed. The perlbot (bag of object tricks) document has been removed |
1810 | as well. | |
1811 | ||
1812 | =head3 Development Deltas | |
1813 | ||
1814 | The perldelta files for development releases are no longer packaged with | |
1815 | perl. These can still be found in the perl source code repository. | |
1816 | ||
1817 | =head1 Diagnostics | |
1818 | ||
1819 | The following additions or changes have been made to diagnostic output, | |
1820 | including warnings and fatal error messages. For the complete list of | |
1821 | diagnostic messages, see L<perldiag>. | |
1822 | ||
1823 | =head2 New Diagnostics | |
1824 | ||
1825 | =head3 New Errors | |
1826 | ||
1827 | =over 4 | |
1828 | ||
1829 | =item * | |
1830 | ||
1831 | L<Cannot set tied @DB::args|perldiag/"Cannot set tied @DB::args"> | |
1832 | ||
1833 | This error occurs when C<caller> tries to set C<@DB::args> but finds it | |
1834 | tied. Before this error was added, it used to crash instead. | |
1835 | ||
1836 | =item * | |
1837 | ||
1838 | L<Cannot tie unreifiable array|perldiag/"Cannot tie unreifiable array"> | |
1839 | ||
1840 | This error is part of a safety check that the C<tie> operator does before | |
1841 | tying a special array like C<@_>. You should never see this message. | |
1842 | ||
1843 | =item * | |
1844 | ||
1845 | L<&CORE::%s cannot be called directly|perldiag/"&CORE::%s cannot be called directly"> | |
1846 | ||
1847 | This occurs when a subroutine in the C<CORE::> namespace is called | |
1848 | with C<&foo> syntax or through a reference. Some subroutines | |
1849 | in this package cannot yet be called that way, but must be | |
1850 | called as barewords. See L</Subroutines in the C<CORE> namespace>, above. | |
1851 | ||
1852 | =item * | |
1853 | ||
1854 | L<Source filters apply only to byte streams|perldiag/"Source filters apply only to byte streams"> | |
1855 | ||
1856 | This new error occurs when you try to activate a source filter (usually by | |
1857 | loading a source filter module) within a string passed to C<eval> under the | |
1858 | C<unicode_eval> feature. | |
1859 | ||
1860 | =back | |
1861 | ||
1862 | =head3 New Warnings | |
1863 | ||
1864 | =over 4 | |
1865 | ||
1866 | =item * | |
1867 | ||
1868 | L<defined(@array) is deprecated|perldiag/"defined(@array) is deprecated"> | |
1869 | ||
1870 | The long-deprecated C<defined(@array)> now also warns for package variables. | |
7af9a95b | 1871 | Previously it issued a warning for lexical variables only. |
05c8f9ed RS |
1872 | |
1873 | =item * | |
1874 | ||
1875 | L<length() used on %s|perldiag/length() used on %s> | |
1876 | ||
1877 | This new warning occurs when C<length> is used on an array or hash, instead | |
1878 | of C<scalar(@array)> or C<scalar(keys %hash)>. | |
1879 | ||
1880 | =item * | |
1881 | ||
1882 | L<lvalue attribute %s already-defined subroutine|perldiag/"lvalue attribute %s already-defined subroutine"> | |
1883 | ||
1884 | L<attributes.pm|attributes> now emits this warning when the :lvalue | |
1885 | attribute is applied to a Perl subroutine that has already been defined, as | |
1886 | doing so can have unexpected side-effects. | |
1887 | ||
1888 | =item * | |
1889 | ||
1890 | L<overload arg '%s' is invalid|perldiag/"overload arg '%s' is invalid"> | |
1891 | ||
1892 | This warning, in the "overload" category, is produced when the overload | |
1893 | pragma is given an argument it doesn't recognize, presumably a mistyped | |
1894 | operator. | |
1895 | ||
1896 | =item * | |
1897 | ||
1898 | L<$[ used in %s (did you mean $] ?)|perldiag/"$[ used in %s (did you mean $] ?)"> | |
1899 | ||
1900 | This new warning exists to catch the mistaken use of C<$[> in version | |
1901 | checks. C<$]>, not C<$[>, contains the version number. | |
1902 | ||
1903 | =item * | |
1904 | ||
1905 | L<Useless assignment to a temporary|perldiag/"Useless assignment to a temporary"> | |
1906 | ||
1907 | Assigning to a temporary scalar returned | |
1908 | from an lvalue subroutine now produces this | |
1909 | warning [perl #31946]. | |
1910 | ||
1911 | =item * | |
1912 | ||
1913 | L<Useless use of \E|perldiag/"Useless use of \E"> | |
1914 | ||
1915 | C<\E> does nothing unless preceded by C<\Q>, C<\L> or C<\U>. | |
1916 | ||
1917 | =back | |
1918 | ||
1919 | =head2 Removed Errors | |
1920 | ||
1921 | =over | |
1922 | ||
1923 | =item * | |
1924 | ||
1925 | "sort is now a reserved word" | |
1926 | ||
1927 | This error used to occur when C<sort> was called without arguments, | |
1928 | followed by C<;> or C<)>. (E.g., C<sort;> would die, but C<{sort}> was | |
1929 | OK.) This error message was added in Perl 3 to catch code like | |
1930 | C<close(sort)> which would no longer work. More than two decades later, | |
1931 | this message is no longer appropriate. Now C<sort> without arguments is | |
1932 | always allowed, and returns an empty list, as it did in those cases | |
1933 | where it was already allowed [perl #90030]. | |
1934 | ||
1935 | =back | |
1936 | ||
1937 | =head2 Changes to Existing Diagnostics | |
1938 | ||
1939 | =over 4 | |
1940 | ||
1941 | =item * | |
1942 | ||
1943 | The "Applying pattern match..." or similar warning produced when an | |
1944 | array or hash is on the left-hand side of the C<=~> operator now | |
1945 | mentions the name of the variable. | |
1946 | ||
1947 | =item * | |
1948 | ||
1949 | The "Attempt to free non-existent shared string" has had the spelling | |
1950 | of "non-existent" corrected to "nonexistent". It was already listed | |
1951 | with the correct spelling in L<perldiag>. | |
1952 | ||
1953 | =item * | |
1954 | ||
7af9a95b | 1955 | The error messages for using C<default> and C<when> outside a |
1540de7c | 1956 | topicalizer have been standardized to match the messages for C<continue> |
05c8f9ed RS |
1957 | and loop controls. They now read 'Can't "default" outside a |
1958 | topicalizer' and 'Can't "when" outside a topicalizer'. They both used | |
1959 | to be 'Can't use when() outside a topicalizer' [perl #91514]. | |
1960 | ||
1961 | =item * | |
1962 | ||
1963 | The message, "Code point 0x%X is not Unicode, no properties match it; | |
1964 | all inverse properties do" has been changed to "Code point 0x%X is not | |
1965 | Unicode, all \p{} matches fail; all \P{} matches succeed". | |
1966 | ||
1967 | =item * | |
1968 | ||
1969 | Redefinition warnings for constant subroutines used to be mandatory, | |
1970 | even occurring under C<no warnings>. Now they respect the L<warnings> | |
1971 | pragma. | |
1972 | ||
1973 | =item * | |
1974 | ||
1975 | The "glob failed" warning message is now suppressible via C<no warnings> | |
1976 | [perl #111656]. | |
1977 | ||
1978 | =item * | |
1979 | ||
1980 | The L<Invalid version format|perldiag/"Invalid version format (%s)"> | |
1981 | error message now says "negative version number" within the parentheses, | |
1982 | rather than "non-numeric data", for negative numbers. | |
1983 | ||
1984 | =item * | |
1985 | ||
1986 | The two warnings | |
1987 | L<Possible attempt to put comments in qw() list|perldiag/"Possible attempt to put comments in qw() list"> | |
1988 | and | |
1989 | L<Possible attempt to separate words with commas|perldiag/"Possible attempt to separate words with commas"> | |
1990 | are no longer mutually exclusive: the same C<qw> construct may produce | |
1991 | both. | |
1992 | ||
1993 | =item * | |
1994 | ||
1995 | The uninitialized warning for C<y///r> when C<$_> is implicit and | |
1996 | undefined now mentions the variable name, just like the non-/r variation | |
1997 | of the operator. | |
1998 | ||
1999 | =item * | |
2000 | ||
2001 | The 'Use of "foo" without parentheses is ambiguous' warning has been | |
2002 | extended to apply also to user-defined subroutines with a (;$) | |
2003 | prototype, and not just to built-in functions. | |
2004 | ||
2005 | =item * | |
2006 | ||
2007 | Warnings that mention the names of lexical (C<my>) variables with | |
2008 | Unicode characters in them now respect the presence or absence of the | |
2009 | C<:utf8> layer on the output handle, instead of outputting UTF8 | |
2010 | regardless. Also, the correct names are included in the strings passed | |
2011 | to C<$SIG{__WARN__}> handlers, rather than the raw UTF8 bytes. | |
2012 | ||
2013 | =back | |
2014 | ||
2015 | =head1 Utility Changes | |
2016 | ||
2017 | =head3 L<h2ph> | |
2018 | ||
2019 | =over 4 | |
2020 | ||
2021 | =item * | |
2022 | ||
2023 | L<h2ph> used to generate code of the form | |
2024 | ||
2025 | unless(defined(&FOO)) { | |
2026 | sub FOO () {42;} | |
2027 | } | |
2028 | ||
2029 | But the subroutine is a compile-time declaration, and is hence unaffected | |
2030 | by the condition. It has now been corrected to emit a string C<eval> | |
2031 | around the subroutine [perl #99368]. | |
2032 | ||
2033 | =back | |
2034 | ||
2035 | =head3 L<splain> | |
2036 | ||
2037 | =over 4 | |
2038 | ||
2039 | =item * | |
2040 | ||
2041 | F<splain> no longer emits backtraces with the first line number repeated. | |
2042 | ||
2043 | This: | |
2044 | ||
2045 | Uncaught exception from user code: | |
2046 | Cannot fwiddle the fwuddle at -e line 1. | |
2047 | at -e line 1 | |
2048 | main::baz() called at -e line 1 | |
2049 | main::bar() called at -e line 1 | |
2050 | main::foo() called at -e line 1 | |
2051 | ||
2052 | has become this: | |
2053 | ||
2054 | Uncaught exception from user code: | |
2055 | Cannot fwiddle the fwuddle at -e line 1. | |
2056 | main::baz() called at -e line 1 | |
2057 | main::bar() called at -e line 1 | |
2058 | main::foo() called at -e line 1 | |
2059 | ||
2060 | =item * | |
2061 | ||
2062 | Some error messages consist of multiple lines that are listed as separate | |
2063 | entries in L<perldiag>. splain has been taught to find the separate | |
2064 | entries in these cases, instead of simply failing to find the message. | |
2065 | ||
2066 | =back | |
2067 | ||
2068 | =head3 L<zipdetails> | |
2069 | ||
2070 | =over 4 | |
2071 | ||
2072 | =item * | |
2073 | ||
2074 | This is a new utility, included as part of an | |
2075 | L<IO::Compress::Base> upgrade. | |
2076 | ||
2077 | L<zipdetails> displays information about the internal record structure | |
2078 | of the zip file. It is not concerned with displaying any details of | |
2079 | the compressed data stored in the zip file. | |
2080 | ||
2081 | =back | |
2082 | ||
2083 | =head1 Configuration and Compilation | |
2084 | ||
2085 | =over 4 | |
2086 | ||
2087 | =item * | |
2088 | ||
2089 | F<regexp.h> has been modified for compatibility with GCC's B<-Werror> | |
2090 | option, as used by some projects that include perl's header files (5.14.1). | |
2091 | ||
2092 | =item * | |
2093 | ||
2094 | C<USE_LOCALE{,_COLLATE,_CTYPE,_NUMERIC}> have been added the output of perl -V | |
1540de7c | 2095 | as they have affect the behavior of the interpreter binary (albeit |
7af9a95b | 2096 | in only a small area). |
05c8f9ed RS |
2097 | |
2098 | =item * | |
2099 | ||
2100 | The code and tests for L<IPC::Open2> have been moved from F<ext/IPC-Open2> | |
2101 | into F<ext/IPC-Open3>, as C<IPC::Open2::open2()> is implemented as a thin | |
2102 | wrapper around C<IPC::Open3::_open3()>, and hence is very tightly coupled to | |
2103 | it. | |
2104 | ||
2105 | =item * | |
2106 | ||
2107 | The magic types and magic vtables are now generated from data in a new script | |
2108 | F<regen/mg_vtable.pl>, instead of being maintained by hand. As different | |
2109 | EBCDIC variants can't agree on the code point for '~', the character to code | |
2110 | point conversion is done at build time by F<generate_uudmap> to a new generated | |
2111 | header F<mg_data.h>. C<PL_vtbl_bm> and C<PL_vtbl_fm> are now defined by the | |
2112 | pre-processor as C<PL_vtbl_regexp>, instead of being distinct C variables. | |
2113 | C<PL_vtbl_sig> has been removed. | |
2114 | ||
2115 | =item * | |
2116 | ||
2117 | Building with C<-DPERL_GLOBAL_STRUCT> works again. This configuration is not | |
2118 | generally used. | |
2119 | ||
2120 | =item * | |
2121 | ||
2122 | Perl configured with I<MAD> now correctly frees C<MADPROP> structures when | |
2123 | OPs are freed. C<MADPROP>s are now allocated with C<PerlMemShared_malloc()> | |
2124 | ||
2125 | =item * | |
2126 | ||
2127 | F<makedef.pl> has been refactored. This should have no noticeable affect on | |
2128 | any of the platforms that use it as part of their build (AIX, VMS, Win32). | |
2129 | ||
2130 | =item * | |
2131 | ||
2132 | C<useperlio> can no longer be disabled. | |
2133 | ||
2134 | =item * | |
2135 | ||
2136 | The file F<global.sym> is no longer needed, and has been removed. It | |
2137 | contained a list of all exported functions, one of the files generated by | |
2138 | F<regen/embed.pl> from data in F<embed.fnc> and F<regen/opcodes>. The code | |
2139 | has been refactored so that the only user of F<global.sym>, F<makedef.pl>, | |
2140 | now reads F<embed.fnc> and F<regen/opcodes> directly, removing the need to | |
2141 | store the list of exported functions in an intermediate file. | |
2142 | ||
2143 | As F<global.sym> was never installed, this change should not be visible | |
2144 | outside the build process. | |
2145 | ||
2146 | =item * | |
2147 | ||
2148 | F<pod/buildtoc>, used by the build process to build L<perltoc>, has been | |
7af9a95b | 2149 | refactored and simplified. It now contains only code to build L<perltoc>; |
05c8f9ed RS |
2150 | the code to regenerate Makefiles has been moved to F<Porting/pod_rules.pl>. |
2151 | It's a bug if this change has any material effect on the build process. | |
2152 | ||
2153 | =item * | |
2154 | ||
2155 | F<pod/roffitall> is now built by F<pod/buildtoc>, instead of being | |
2156 | shipped with the distribution. Its list of manpages is now generated | |
2157 | (and therefore current). See also RT #103202 for an unresolved related | |
2158 | issue. | |
2159 | ||
2160 | =item * | |
2161 | ||
2162 | The man page for C<XS::Typemap> is no longer installed. C<XS::Typemap> | |
2163 | is a test module which is not installed, hence installing its | |
2164 | documentation makes no sense. | |
2165 | ||
2166 | =item * | |
2167 | ||
2168 | The -Dusesitecustomize and -Duserelocatableinc options now work | |
2169 | together properly. | |
2170 | ||
2171 | =back | |
2172 | ||
2173 | =head1 Platform Support | |
2174 | ||
2175 | =head2 Platform-Specific Notes | |
2176 | ||
2177 | =head3 Cygwin | |
2178 | ||
2179 | =over 4 | |
2180 | ||
2181 | =item * | |
2182 | ||
2183 | Since version 1.7, Cygwin supports native UTF-8 paths. If Perl is built | |
2184 | under that environment, directory and filenames will be UTF-8 encoded. | |
2185 | ||
959e5662 BO |
2186 | =item * |
2187 | ||
05c8f9ed RS |
2188 | Cygwin does not initialize all original Win32 environment variables. See |
2189 | F<README.cygwin> for a discussion of the newly-added | |
2190 | C<Cygwin::sync_winenv()> function [perl #110190] and for | |
2191 | further links. | |
2192 | ||
2193 | =back | |
2194 | ||
2195 | =head3 HP-UX | |
2196 | ||
2197 | =over 4 | |
2198 | ||
2199 | =item * | |
2200 | ||
2201 | HP-UX PA-RISC/64 now supports gcc-4.x | |
2202 | ||
2203 | A fix to correct the socketsize now makes the test suite pass on HP-UX | |
006b5090 | 2204 | PA-RISC for 64bitall builds. (5.14.2) |
05c8f9ed RS |
2205 | |
2206 | =back | |
2207 | ||
2208 | =head3 VMS | |
2209 | ||
2210 | =over 4 | |
2211 | ||
2212 | =item * | |
2213 | ||
2214 | Remove unnecessary includes, fix miscellaneous compiler warnings and | |
2215 | close some unclosed comments on F<vms/vms.c>. | |
2216 | ||
959e5662 BO |
2217 | =item * |
2218 | ||
05c8f9ed RS |
2219 | Remove sockadapt layer from the VMS build. |
2220 | ||
2221 | =item * | |
2222 | ||
7af9a95b TC |
2223 | Explicit support for VMS versions before v7.0 and DEC C versions |
2224 | before v6.0 has been removed. | |
05c8f9ed RS |
2225 | |
2226 | =item * | |
2227 | ||
2228 | Since Perl 5.10.1, the home-grown C<stat> wrapper has been unable to | |
2229 | distinguish between a directory name containing an underscore and an | |
2230 | otherwise-identical filename containing a dot in the same position | |
2231 | (e.g., t/test_pl as a directory and t/test.pl as a file). This problem | |
2232 | has been corrected. | |
2233 | ||
2234 | =item * | |
2235 | ||
7af9a95b | 2236 | The build on VMS now permits names of the resulting symbols in C code for |
05c8f9ed RS |
2237 | Perl longer than 31 characters. Symbols like |
2238 | C<Perl__it_was_the_best_of_times_it_was_the_worst_of_times> can now be | |
2239 | created freely without causing the VMS linker to seize up. | |
2240 | ||
2241 | =back | |
2242 | ||
2243 | =head3 GNU/Hurd | |
2244 | ||
959e5662 BO |
2245 | =over 4 |
2246 | ||
2247 | =item * | |
2248 | ||
05c8f9ed RS |
2249 | Numerous build and test failures on GNU/Hurd have been resolved with hints |
2250 | for building DBM modules, detection of the library search path, and enabling | |
2251 | of large file support. | |
2252 | ||
959e5662 BO |
2253 | =back |
2254 | ||
05c8f9ed RS |
2255 | =head3 OpenVOS |
2256 | ||
959e5662 BO |
2257 | =over 4 |
2258 | ||
2259 | =item * | |
2260 | ||
05c8f9ed RS |
2261 | Perl is now built with dynamic linking on OpenVOS, the minimum supported |
2262 | version of which is now Release 17.1.0. | |
2263 | ||
959e5662 BO |
2264 | =back |
2265 | ||
05c8f9ed RS |
2266 | =head3 SunOS |
2267 | ||
2268 | The CC workshop C++ compiler is now detected and used on systems that ship | |
2269 | without cc. | |
2270 | ||
2271 | =head1 Internal Changes | |
2272 | ||
2273 | =over 4 | |
2274 | ||
2275 | =item * | |
2276 | ||
2277 | The compiled representation of formats is now stored via the C<mg_ptr> of | |
2278 | their C<PERL_MAGIC_fm>. Previously it was stored in the string buffer, | |
2279 | beyond C<SvLEN()>, the regular end of the string. C<SvCOMPILED()> and | |
2280 | C<SvCOMPILED_{on,off}()> now exist solely for compatibility for XS code. | |
2281 | The first is always 0, the other two now no-ops. (5.14.1) | |
2282 | ||
2283 | =item * | |
2284 | ||
2285 | Some global variables have been marked C<const>, members in the interpreter | |
2286 | structure have been re-ordered, and the opcodes have been re-ordered. The | |
2287 | op C<OP_AELEMFAST> has been split into C<OP_AELEMFAST> and C<OP_AELEMFAST_LEX>. | |
2288 | ||
2289 | =item * | |
2290 | ||
7af9a95b | 2291 | When empting a hash of its elements (e.g., via undef(%h), or %h=()), HvARRAY |
05c8f9ed RS |
2292 | field is no longer temporarily zeroed. Any destructors called on the freed |
2293 | elements see the remaining elements. Thus, %h=() becomes more like | |
2294 | C<delete $h{$_} for keys %h>. | |
2295 | ||
2296 | =item * | |
2297 | ||
2298 | Boyer-Moore compiled scalars are now PVMGs, and the Boyer-Moore tables are now | |
2299 | stored via the mg_ptr of their C<PERL_MAGIC_bm>. | |
2300 | Previously they were PVGVs, with the tables stored in | |
2301 | the string buffer, beyond C<SvLEN()>. This eliminates | |
2302 | the last place where the core stores data beyond C<SvLEN()>. | |
2303 | ||
2304 | =item * | |
2305 | ||
2306 | Simplified logic in C<Perl_sv_magic()> introduces a small change of | |
1540de7c | 2307 | behavior for error cases involving unknown magic types. Previously, if |
05c8f9ed RS |
2308 | C<Perl_sv_magic()> was passed a magic type unknown to it, it would |
2309 | ||
2310 | =over | |
2311 | ||
2312 | =item 1. | |
2313 | ||
2314 | Croak "Modification of a read-only value attempted" if read only | |
2315 | ||
2316 | =item 2. | |
2317 | ||
2318 | Return without error if the SV happened to already have this magic | |
2319 | ||
2320 | =item 3. | |
2321 | ||
2322 | otherwise croak "Don't know how to handle magic of type \\%o" | |
2323 | ||
2324 | =back | |
2325 | ||
2326 | Now it will always croak "Don't know how to handle magic of type \\%o", even | |
7af9a95b | 2327 | on read-only values, or SVs which already have the unknown magic type. |
05c8f9ed RS |
2328 | |
2329 | =item * | |
2330 | ||
2331 | The experimental C<fetch_cop_label> function has been renamed to | |
2332 | C<cop_fetch_label>. | |
2333 | ||
2334 | =item * | |
2335 | ||
2336 | The C<cop_store_label> function has been added to the API, but is | |
2337 | experimental. | |
2338 | ||
2339 | =item * | |
2340 | ||
2341 | F<embedvar.h> has been simplified, and one level of macro indirection for | |
2342 | PL_* variables has been removed for the default (non-multiplicity) | |
2343 | configuration. PERLVAR*() macros now directly expand their arguments to | |
2344 | tokens such as C<PL_defgv>, instead of expanding to C<PL_Idefgv>, with | |
2345 | F<embedvar.h> defining a macro to map C<PL_Idefgv> to C<PL_defgv>. XS code | |
2346 | which has unwarranted chumminess with the implementation may need updating. | |
2347 | ||
2348 | =item * | |
2349 | ||
7af9a95b | 2350 | An API has been added to explicitly choose whether to export XSUB |
05c8f9ed RS |
2351 | symbols. More detail can be found in the comments for commit e64345f8. |
2352 | ||
2353 | =item * | |
2354 | ||
2355 | The C<is_gv_magical_sv> function has been eliminated and merged with | |
2356 | C<gv_fetchpvn_flags>. It used to be called to determine whether a GV | |
2357 | should be autovivified in rvalue context. Now it has been replaced with a | |
2358 | new C<GV_ADDMG> flag (not part of the API). | |
2359 | ||
2360 | =item * | |
2361 | ||
2362 | The returned code point from the function C<utf8n_to_uvuni()> | |
449d5120 RS |
2363 | when the input is malformed UTF-8, malformations are allowed, and |
2364 | C<utf8> warnings are off is now the Unicode REPLACEMENT CHARACTER | |
05c8f9ed RS |
2365 | whenever the malformation is such that no well-defined code point can be |
2366 | computed. Previously the returned value was essentially garbage. The | |
2367 | only malformations that have well-defined values are a zero-length | |
2368 | string (0 is the return), and overlong UTF-8 sequences. | |
2369 | ||
2370 | =item * | |
2371 | ||
2372 | Padlists are now marked C<AvREAL>; i.e., reference-counted. They have | |
2373 | always been reference-counted, but were not marked real, because F<pad.c> | |
2374 | did its own clean-up, instead of using the usual clean-up code in F<sv.c>. | |
2375 | That caused problems in thread cloning, so now the C<AvREAL> flag is on, | |
2376 | but is turned off in F<pad.c> right before the padlist is freed (after | |
2377 | F<pad.c> has done its custom freeing of the pads). | |
2378 | ||
2379 | =item * | |
2380 | ||
7af9a95b | 2381 | All C files that make up the Perl core have been converted to UTF-8. |
05c8f9ed RS |
2382 | |
2383 | =item * | |
2384 | ||
2385 | These new functions have been added as part of the work on Unicode symbols: | |
2386 | ||
2387 | HvNAMELEN | |
2388 | HvNAMEUTF8 | |
2389 | HvENAMELEN | |
2390 | HvENAMEUTF8 | |
2391 | gv_init_pv | |
2392 | gv_init_pvn | |
2393 | gv_init_pvsv | |
2394 | gv_fetchmeth_pv | |
2395 | gv_fetchmeth_pvn | |
2396 | gv_fetchmeth_sv | |
2397 | gv_fetchmeth_pv_autoload | |
2398 | gv_fetchmeth_pvn_autoload | |
2399 | gv_fetchmeth_sv_autoload | |
2400 | gv_fetchmethod_pv_flags | |
2401 | gv_fetchmethod_pvn_flags | |
2402 | gv_fetchmethod_sv_flags | |
2403 | gv_autoload_pv | |
2404 | gv_autoload_pvn | |
2405 | gv_autoload_sv | |
2406 | newGVgen_flags | |
2407 | sv_derived_from_pv | |
2408 | sv_derived_from_pvn | |
2409 | sv_derived_from_sv | |
2410 | sv_does_pv | |
2411 | sv_does_pvn | |
2412 | sv_does_sv | |
2413 | whichsig_pv | |
2414 | whichsig_pvn | |
2415 | whichsig_sv | |
2416 | newCONSTSUB_flags | |
2417 | ||
2418 | The gv_fetchmethod_*_flags functions, like gv_fetchmethod_flags, are | |
2419 | experimental and may change in a future release. | |
2420 | ||
2421 | =item * | |
2422 | ||
2423 | The following functions were added. These are I<not> part of the API: | |
2424 | ||
2425 | GvNAMEUTF8 | |
2426 | GvENAMELEN | |
2427 | GvENAME_HEK | |
2428 | CopSTASH_flags | |
2429 | CopSTASH_flags_set | |
2430 | PmopSTASH_flags | |
2431 | PmopSTASH_flags_set | |
2432 | sv_sethek | |
2433 | HEKfARG | |
2434 | ||
2435 | There is also a C<HEKf> macro corresponding to C<SVf>, for | |
2436 | interpolating HEKs in formatted strings. | |
2437 | ||
2438 | =item * | |
2439 | ||
2440 | C<sv_catpvn_flags> takes a couple of new internal-only flags, | |
2441 | C<SV_CATBYTES> and C<SV_CATUTF8>, which tell it whether the char array to | |
2442 | be concatenated is UTF8. This allows for more efficient concatenation than | |
2443 | creating temporary SVs to pass to C<sv_catsv>. | |
2444 | ||
2445 | =item * | |
2446 | ||
2447 | For XS AUTOLOAD subs, $AUTOLOAD is set once more, as it was in 5.6.0. This | |
2448 | is in addition to setting C<SvPVX(cv)>, for compatibility with 5.8 to 5.14. | |
2449 | See L<perlguts/Autoloading with XSUBs>. | |
2450 | ||
2451 | =item * | |
2452 | ||
1540de7c | 2453 | Perl now checks whether the array (the linearized isa) returned by a MRO |
05c8f9ed RS |
2454 | plugin begins with the name of the class itself, for which the array was |
2455 | created, instead of assuming that it does. This prevents the first element | |
2456 | from being skipped during method lookup. It also means that | |
2457 | C<mro::get_linear_isa> may return an array with one more element than the | |
2458 | MRO plugin provided [perl #94306]. | |
2459 | ||
2460 | =item * | |
2461 | ||
2462 | C<PL_curstash> is now reference-counted. | |
2463 | ||
2464 | =item * | |
2465 | ||
2466 | There are now feature bundle hints in C<PL_hints> (C<$^H>) that version | |
2467 | declarations use, to avoid having to load F<feature.pm>. One setting of | |
2468 | the hint bits indicates a "custom" feature bundle, which means that the | |
2469 | entries in C<%^H> still apply. F<feature.pm> uses that. | |
2470 | ||
2471 | The C<HINT_FEATURE_MASK> macro is defined in F<perl.h> along with other | |
2472 | hints. Other macros for setting and testing features and bundles are in | |
2473 | the new F<feature.h>. C<FEATURE_IS_ENABLED> (which has moved to | |
2474 | F<feature.h>) is no longer used throughout the codebase, but more specific | |
2475 | macros, e.g., C<FEATURE_SAY_IS_ENABLED>, that are defined in F<feature.h>. | |
2476 | ||
2477 | =item * | |
2478 | ||
2479 | F<lib/feature.pm> is now a generated file, created by the new | |
2480 | F<regen/feature.pl> script, which also generates F<feature.h>. | |
2481 | ||
2482 | =item * | |
2483 | ||
2484 | Tied arrays are now always C<AvREAL>. If C<@_> or C<DB::args> is tied, it | |
2485 | is reified first, to make sure this is always the case. | |
2486 | ||
2487 | =item * | |
2488 | ||
2489 | Two new functions C<utf8_to_uvchr_buf()> and C<utf8_to_uvuni_buf()> have | |
2490 | been added. These are the same as C<utf8_to_uvchr> and | |
2491 | C<utf8_to_uvuni> (which are now deprecated), but take an extra parameter | |
2492 | that is used to guard against reading beyond the end of the input | |
2493 | string. | |
2494 | See L<perlapi/utf8_to_uvchr_buf> and L<perlapi/utf8_to_uvuni_buf>. | |
2495 | ||
2496 | =item * | |
2497 | ||
2498 | The regular expression engine now does TRIE case insensitive matches | |
2499 | under Unicode. This may change the output of C<< use re 'debug'; >>, | |
2500 | and will speed up various things. | |
2501 | ||
2502 | =item * | |
2503 | ||
2504 | There is a new C<wrap_op_checker()> function, which provides a thread-safe | |
2505 | alternative to writing to C<PL_check> directly. | |
2506 | ||
2507 | =back | |
2508 | ||
2509 | =head1 Selected Bug Fixes | |
2510 | ||
2511 | =head2 Array and hash | |
2512 | ||
2513 | =over | |
2514 | ||
2515 | =item * | |
2516 | ||
2517 | A bug has been fixed that would cause a "Use of freed value in iteration" | |
2518 | error if the next two hash elements that would be iterated over are | |
2519 | deleted [perl #85026]. (5.14.1) | |
2520 | ||
2521 | =item * | |
2522 | ||
7af9a95b | 2523 | Deleting the current hash iterator (the hash element that would be returned |
05c8f9ed RS |
2524 | by the next call to C<each>) in void context used not to free it |
2525 | [perl #85026]. | |
2526 | ||
2527 | =item * | |
2528 | ||
2529 | Deletion of methods via C<delete $Class::{method}> syntax used to update | |
2530 | method caches if called in void context, but not scalar or list context. | |
2531 | ||
2532 | =item * | |
2533 | ||
2534 | When hash elements are deleted in void context, the internal hash entry is | |
2535 | now freed before the value is freed, to prevent destructors called by that | |
2536 | latter freeing from seeing the hash in an inconsistent state. It was | |
2537 | possible to cause double-frees if the destructor freed the hash itself | |
2538 | [perl #100340]. | |
2539 | ||
2540 | =item * | |
2541 | ||
1540de7c | 2542 | A C<keys> optimization in Perl 5.12.0 to make it faster on empty hashes |
05c8f9ed RS |
2543 | caused C<each> not to reset the iterator if called after the last element |
2544 | was deleted. | |
2545 | ||
2546 | =item * | |
2547 | ||
2548 | Freeing deeply nested hashes no longer crashes [perl #44225]. | |
2549 | ||
2550 | =item * | |
2551 | ||
2552 | It is possible from XS code to create hashes with elements that have no | |
2553 | values. The hash element and slice operators used to crash | |
2554 | when handling these in lvalue context. They now | |
2555 | produce a "Modification of non-creatable hash value attempted" error | |
2556 | message. | |
2557 | ||
2558 | =item * | |
2559 | ||
2560 | If list assignment to a hash or array triggered destructors that freed the | |
2561 | hash or array itself, a crash would ensue. This is no longer the case | |
2562 | [perl #107440]. | |
2563 | ||
2564 | =item * | |
2565 | ||
1540de7c | 2566 | It used to be possible to free the typeglob of a localized array or hash |
05c8f9ed RS |
2567 | (e.g., C<local @{"x"}; delete $::{x}>), resulting in a crash on scope exit. |
2568 | ||
2569 | =item * | |
2570 | ||
2571 | Some core bugs affecting L<Hash::Util> have been fixed: locking a hash | |
7af9a95b | 2572 | element that is a glob copy no longer causes the next assignment to it to |
006b5090 FC |
2573 | corrupt the glob (5.14.2), and unlocking a hash element that holds a |
2574 | copy-on-write scalar no longer causes modifications to that scalar to | |
2575 | modify other scalars that were sharing the same string buffer. | |
05c8f9ed RS |
2576 | |
2577 | =back | |
2578 | ||
2579 | =head2 C API fixes | |
2580 | ||
2581 | =over | |
2582 | ||
2583 | =item * | |
2584 | ||
2585 | The C<newHVhv> XS function now works on tied hashes, instead of crashing or | |
2586 | returning an empty hash. | |
2587 | ||
2588 | =item * | |
2589 | ||
2590 | The C<SvIsCOW> C macro now returns false for read-only copies of typeglobs, | |
2591 | such as those created by: | |
2592 | ||
2593 | $hash{elem} = *foo; | |
2594 | Hash::Util::lock_value %hash, 'elem'; | |
2595 | ||
2596 | It used to return true. | |
2597 | ||
2598 | =item * | |
2599 | ||
2600 | The C<SvPVutf8> C function no longer tries to modify its argument, | |
2601 | resulting in errors [perl #108994]. | |
2602 | ||
2603 | =item * | |
2604 | ||
2605 | C<SvPVutf8> now works properly with magical variables. | |
2606 | ||
2607 | =item * | |
2608 | ||
2609 | C<SvPVbyte> now works properly non-PVs. | |
2610 | ||
2611 | =item * | |
2612 | ||
2613 | When presented with malformed UTF-8 input, the XS-callable functions | |
2614 | C<is_utf8_string()>, C<is_utf8_string_loc()>, and | |
2615 | C<is_utf8_string_loclen()> could read beyond the end of the input | |
2616 | string by up to 12 bytes. This no longer happens. [perl #32080]. | |
2617 | However, currently, C<is_utf8_char()> still has this defect, see | |
2618 | L</is_utf8_char()> above. | |
2619 | ||
2620 | =item * | |
2621 | ||
7af9a95b | 2622 | The C-level C<pregcomp> function could become confused about whether the |
05c8f9ed RS |
2623 | pattern was in UTF8 if the pattern was an overloaded, tied, or otherwise |
2624 | magical scalar [perl #101940]. | |
2625 | ||
2626 | =back | |
2627 | ||
2628 | =head2 Compile-time hints | |
2629 | ||
2630 | =over | |
2631 | ||
2632 | =item * | |
2633 | ||
2634 | Tying C<%^H> no longer causes perl to crash or ignore the contents of | |
2635 | C<%^H> when entering a compilation scope [perl #106282]. | |
2636 | ||
2637 | =item * | |
2638 | ||
2639 | C<eval $string> and C<require> used not to | |
1540de7c | 2640 | localize C<%^H> during compilation if it |
05c8f9ed RS |
2641 | was empty at the time the C<eval> call itself was compiled. This could |
2642 | lead to scary side effects, like C<use re "/m"> enabling other flags that | |
2643 | the surrounding code was trying to enable for its caller [perl #68750]. | |
2644 | ||
2645 | =item * | |
2646 | ||
1540de7c | 2647 | C<eval $string> and C<require> no longer localize hints (C<$^H> and C<%^H>) |
05c8f9ed RS |
2648 | at run time, but only during compilation of the $string or required file. |
2649 | This makes C<BEGIN { $^H{foo}=7 }> equivalent to | |
2650 | C<BEGIN { eval '$^H{foo}=7' }> [perl #70151]. | |
2651 | ||
2652 | =item * | |
2653 | ||
2654 | Creating a BEGIN block from XS code (via C<newXS> or C<newATTRSUB>) would, | |
2655 | on completion, make the hints of the current compiling code the current | |
2656 | hints. This could cause warnings to occur in a non-warning scope. | |
2657 | ||
2658 | =back | |
2659 | ||
2660 | =head2 Copy-on-write scalars | |
2661 | ||
2662 | Copy-on-write or shared hash key scalars | |
2663 | were introduced in 5.8.0, but most Perl code | |
2664 | did not encounter them (they were used mostly internally). Perl | |
2665 | 5.10.0 extended them, such that assigning C<__PACKAGE__> or a | |
2666 | hash key to a scalar would make it copy-on-write. Several parts | |
2667 | of Perl were not updated to account for them, but have now been fixed. | |
2668 | ||
2669 | =over | |
2670 | ||
2671 | =item * | |
2672 | ||
2673 | C<utf8::decode> had a nasty bug that would modify copy-on-write scalars' | |
2674 | string buffers in place (i.e., skipping the copy). This could result in | |
006b5090 | 2675 | hashes having two elements with the same key [perl #91834]. (5.14.2) |
05c8f9ed RS |
2676 | |
2677 | =item * | |
2678 | ||
2679 | Lvalue subroutines were not allowing COW scalars to be returned. This was | |
2680 | fixed for lvalue scalar context in Perl 5.12.3 and 5.14.0, but list context | |
2681 | was not fixed until this release. | |
2682 | ||
2683 | =item * | |
2684 | ||
2685 | Elements of restricted hashes (see the L<fields> pragma) containing | |
2686 | copy-on-write values couldn't be deleted, nor could such hashes be cleared | |
006b5090 | 2687 | (C<%hash = ()>). (5.14.2) |
05c8f9ed RS |
2688 | |
2689 | =item * | |
2690 | ||
1540de7c | 2691 | Localizing a tied variable used to make it read-only if it contained a |
006b5090 | 2692 | copy-on-write string. (5.14.2) |
05c8f9ed RS |
2693 | |
2694 | =item * | |
2695 | ||
2696 | Assigning a copy-on-write string to a stash | |
2697 | element no longer causes a double free. Regardless of this change, the | |
2698 | results of such assignments are still undefined. | |
2699 | ||
2700 | =item * | |
2701 | ||
2702 | Assigning a copy-on-write string to a tied variable no longer stops that | |
2703 | variable from being tied if it happens to be a PVMG or PVLV internally. | |
2704 | ||
2705 | =item * | |
2706 | ||
2707 | Doing a substitution on a tied variable returning a copy-on-write | |
2708 | scalar used to cause an assertion failure or an "Attempt to free | |
2709 | nonexistent shared string" warning. | |
2710 | ||
2711 | =item * | |
2712 | ||
2713 | This one is a regression from 5.12: In 5.14.0, the bitwise assignment | |
2714 | operators C<|=>, C<^=> and C<&=> started leaving the left-hand side | |
2715 | undefined if it happened to be a copy-on-write string [perl #108480]. | |
2716 | ||
2717 | =item * | |
2718 | ||
2719 | L<Storable>, L<Devel::Peek> and L<PerlIO::scalar> had similar problems. | |
2720 | See L</Updated Modules and Pragmata>, above. | |
2721 | ||
2722 | =back | |
2723 | ||
2724 | =head2 The debugger | |
2725 | ||
2726 | =over | |
2727 | ||
2728 | =item * | |
2729 | ||
7af9a95b | 2730 | F<dumpvar.pl>, and therefore the C<x> command in the debugger, have been |
05c8f9ed RS |
2731 | fixed to handle objects blessed into classes whose names contain "=". The |
2732 | contents of such objects used not to be dumped [perl #101814]. | |
2733 | ||
2734 | =item * | |
2735 | ||
2736 | The "R" command for restarting a debugger session has been fixed to work on | |
2737 | Windows, or any other system lacking a C<POSIX::_SC_OPEN_MAX> constant | |
2738 | [perl #87740]. | |
2739 | ||
2740 | =item * | |
2741 | ||
2742 | The C<#line 42 foo> directive used not to update the arrays of lines used | |
2743 | by the debugger if it occurred in a string eval. This was partially fixed | |
7af9a95b | 2744 | in 5.14, but it worked only for a single C<#line 42 foo> in each eval. Now |
05c8f9ed RS |
2745 | it works for multiple. |
2746 | ||
2747 | =item * | |
2748 | ||
2749 | When subroutine calls are intercepted by the debugger, the name of the | |
2750 | subroutine or a reference to it is stored in C<$DB::sub>, for the debugger | |
7af9a95b | 2751 | to access. Sometimes (such as C<$foo = *bar; undef *bar; &$foo>) |
05c8f9ed RS |
2752 | C<$DB::sub> would be set to a name that could not be used to find the |
2753 | subroutine, and so the debugger's attempt to call it would fail. Now the | |
2754 | check to see whether a reference is needed is more robust, so those | |
2755 | problems should not happen anymore [rt.cpan.org #69862]. | |
2756 | ||
2757 | =item * | |
2758 | ||
2759 | Every subroutine has a filename associated with it that the debugger uses. | |
2760 | The one associated with constant subroutines used to be misallocated when | |
2761 | cloned under threads. Consequently, debugging threaded applications could | |
2762 | result in memory corruption [perl #96126]. | |
2763 | ||
2764 | =back | |
2765 | ||
2766 | =head2 Dereferencing operators | |
2767 | ||
2768 | =over | |
2769 | ||
2770 | =item * | |
2771 | ||
2772 | C<defined(${"..."})>, C<defined(*{"..."})>, etc., used to | |
2773 | return true for most, but not all built-in variables, if | |
2774 | they had not been used yet. This bug affected C<${^GLOBAL_PHASE}> and | |
2775 | C<${^UTF8CACHE}>, among others. It also used to return false if the | |
2776 | package name was given as well (C<${"::!"}>) [perl #97978, #97492]. | |
2777 | ||
2778 | =item * | |
2779 | ||
2780 | Perl 5.10.0 introduced a similar bug: C<defined(*{"foo"})> where "foo" | |
2781 | represents the name of a built-in global variable used to return false if | |
2782 | the variable had never been used before, but only on the I<first> call. | |
2783 | This, too, has been fixed. | |
2784 | ||
2785 | =item * | |
2786 | ||
2787 | Since 5.6.0, C<*{ ... }> has been inconsistent in how it treats undefined | |
2788 | values. It would die in strict mode or lvalue context for most undefined | |
2789 | values, but would be treated as the empty string (with a warning) for the | |
2790 | specific scalar return by C<undef()> (C<&PL_sv_undef> internally). This | |
2791 | has been corrected. C<undef()> is now treated like other undefined | |
2792 | scalars, as in Perl 5.005. | |
2793 | ||
2794 | =back | |
2795 | ||
2796 | =head2 Filehandle, last-accessed | |
2797 | ||
2798 | Perl has an internal variable that stores the last filehandle to be | |
2799 | accessed. It is used by C<$.> and by C<tell> and C<eof> without | |
2800 | arguments. | |
2801 | ||
2802 | =over | |
2803 | ||
2804 | =item * | |
2805 | ||
2806 | It used to be possible to set this internal variable to a glob copy and | |
2807 | then modify that glob copy to be something other than a glob, and still | |
2808 | have the last-accessed filehandle associated with the variable after | |
2809 | assigning a glob to it again: | |
2810 | ||
2811 | my $foo = *STDOUT; # $foo is a glob copy | |
2812 | <$foo>; # $foo is now the last-accessed handle | |
2813 | $foo = 3; # no longer a glob | |
2814 | $foo = *STDERR; # still the last-accessed handle | |
2815 | ||
2816 | Now the C<$foo = 3> assignment unsets that internal variable, so there | |
2817 | is no last-accessed filehandle, just as if C<< <$foo> >> had never | |
2818 | happened. | |
2819 | ||
2820 | This also prevents some unrelated handle from becoming the last-accessed | |
2821 | handle if $foo falls out of scope and the same internal SV gets used for | |
2822 | another handle [perl #97988]. | |
2823 | ||
2824 | =item * | |
2825 | ||
2826 | A regression in 5.14 caused these statements not to set that internal | |
2827 | variable: | |
2828 | ||
2829 | my $fh = *STDOUT; | |
2830 | tell $fh; | |
2831 | eof $fh; | |
2832 | seek $fh, 0,0; | |
2833 | tell *$fh; | |
2834 | eof *$fh; | |
2835 | seek *$fh, 0,0; | |
2836 | readline *$fh; | |
2837 | ||
2838 | This is now fixed, but C<tell *{ *$fh }> still has the problem, and it | |
2839 | is not clear how to fix it [perl #106536]. | |
2840 | ||
2841 | =back | |
2842 | ||
2843 | =head2 Filetests and C<stat> | |
2844 | ||
2845 | The term "filetests" refers to the operators that consist of a hyphen | |
2846 | followed by a single letter: C<-r>, C<-x>, C<-M>, etc. The term "stacked" | |
2847 | when applied to filetests means followed by another filetest operator | |
2848 | sharing the same operand, as in C<-r -x -w $fooo>. | |
2849 | ||
2850 | =over | |
2851 | ||
2852 | =item * | |
2853 | ||
2854 | C<stat> produces more consistent warnings. It no longer warns for "_" | |
2855 | [perl #71002] and no longer skips the warning at times for other unopened | |
2856 | handles. It no longer warns about an unopened handle when the operating | |
2857 | system's C<fstat> function fails. | |
2858 | ||
2859 | =item * | |
2860 | ||
2861 | C<stat> would sometimes return negative numbers for large inode numbers, | |
2862 | because it was using the wrong internal C type. [perl #84590] | |
2863 | ||
2864 | =item * | |
2865 | ||
2866 | C<lstat> is documented to fall back to C<stat> (with a warning) when given | |
2867 | a filehandle. When passed an IO reference, it was actually doing the | |
2868 | equivalent of S<C<stat _>> and ignoring the handle. | |
2869 | ||
2870 | =item * | |
2871 | ||
2872 | C<-T _> with no preceding C<stat> used to produce a | |
2873 | confusing "uninitialized" warning, even though there | |
2874 | is no visible uninitialized value to speak of. | |
2875 | ||
2876 | =item * | |
2877 | ||
2878 | C<-T>, C<-B>, C<-l> and C<-t> now work | |
2879 | when stacked with other filetest operators | |
2880 | [perl #77388]. | |
2881 | ||
2882 | =item * | |
2883 | ||
2884 | In 5.14.0, filetest ops (C<-r>, C<-x>, etc.) started calling FETCH on a | |
2885 | tied argument belonging to the previous argument to a list operator, if | |
2886 | called with a bareword argument or no argument at all. This has been | |
2887 | fixed, so C<push @foo, $tied, -r> no longer calls FETCH on C<$tied>. | |
2888 | ||
2889 | =item * | |
2890 | ||
2891 | In Perl 5.6, C<-l> followed by anything other than a bareword would treat | |
2892 | its argument as a file name. That was changed in 5.8 for glob references | |
2893 | (C<\*foo>), but not for globs themselves (C<*foo>). C<-l> started | |
2894 | returning C<undef> for glob references without setting the last | |
2895 | stat buffer that the "_" handle uses, but only if warnings | |
2896 | were turned on. With warnings off, it was the same as 5.6. | |
2897 | In other words, it was simply buggy and inconsistent. Now the 5.6 | |
1540de7c | 2898 | behavior has been restored. |
05c8f9ed RS |
2899 | |
2900 | =item * | |
2901 | ||
2902 | C<-l> followed by a bareword no longer "eats" the previous argument to | |
2903 | the list operator in whose argument list it resides. Hence, | |
2904 | C<print "bar", -l foo> now actually prints "bar", because C<-l> | |
2905 | on longer eats it. | |
2906 | ||
2907 | =item * | |
2908 | ||
2909 | Perl keeps several internal variables to keep track of the last stat | |
2910 | buffer, from which file(handle) it originated, what type it was, and | |
2911 | whether the last stat succeeded. | |
2912 | ||
2913 | There were various cases where these could get out of synch, resulting in | |
1540de7c | 2914 | inconsistent or erratic behavior in edge cases (every mention of C<-T> |
05c8f9ed RS |
2915 | applies to C<-B> as well): |
2916 | ||
2917 | =over | |
2918 | ||
2919 | =item * | |
2920 | ||
2921 | C<-T I<HANDLE>>, even though it does a C<stat>, was not resetting the last | |
2922 | stat type, so an C<lstat _> following it would merrily return the wrong | |
2923 | results. Also, it was not setting the success status. | |
2924 | ||
2925 | =item * | |
2926 | ||
2927 | Freeing the handle last used by C<stat> or a filetest could result in | |
2928 | S<C<-T _>> using an unrelated handle. | |
2929 | ||
2930 | =item * | |
2931 | ||
2932 | C<stat> with an IO reference would not reset the stat type or record the | |
2933 | filehandle for S<C<-T _>> to use. | |
2934 | ||
2935 | =item * | |
2936 | ||
2937 | Fatal warnings could cause the stat buffer not to be reset | |
2938 | for a filetest operator on an unopened filehandle or C<-l> on any handle. | |
2939 | Fatal warnings also stopped C<-T> from setting C<$!>. | |
2940 | ||
2941 | =item * | |
2942 | ||
2943 | When the last stat was on an unreadable file, C<-T _> is supposed to | |
2944 | return C<undef>, leaving the last stat buffer unchanged. But it was | |
2945 | setting the stat type, causing C<lstat _> to stop working. | |
2946 | ||
2947 | =item * | |
2948 | ||
2949 | C<-T I<FILENAME>> was not resetting the internal stat buffers for | |
2950 | unreadable files. | |
2951 | ||
2952 | =back | |
2953 | ||
2954 | These have all been fixed. | |
2955 | ||
2956 | =back | |
2957 | ||
2958 | =head2 Formats | |
2959 | ||
2960 | =over | |
2961 | ||
2962 | =item * | |
2963 | ||
7af9a95b | 2964 | Several edge cases have been fixed with formats and C<formline>; |
05c8f9ed RS |
2965 | in particular, where the format itself is potentially variable (such as |
2966 | with ties and overloading), and where the format and data differ in their | |
2967 | encoding. In both these cases, it used to possible for the output to be | |
2968 | corrupted [perl #91032]. | |
2969 | ||
2970 | =item * | |
2971 | ||
2972 | C<formline> no longer converts its argument into a string in-place. So | |
2973 | passing a reference to C<formline> no longer destroys the reference | |
2974 | [perl #79532]. | |
2975 | ||
2976 | =item * | |
2977 | ||
2978 | Assignment to C<$^A> (the format output accumulator) now recalculates | |
2979 | the number of lines output. | |
2980 | ||
2981 | =back | |
2982 | ||
2983 | =head2 C<given> and C<when> | |
2984 | ||
2985 | =over | |
2986 | ||
2987 | =item * | |
2988 | ||
2989 | C<given> was not scoping its implicit $_ properly, resulting in memory | |
2990 | leaks or "Variable is not available" warnings [perl #94682]. | |
2991 | ||
2992 | =item * | |
2993 | ||
2994 | C<given> was not calling set-magic on the implicit lexical C<$_> that it | |
2995 | uses. This meant, for example, that C<pos> would be remembered from one | |
2996 | execution of the same C<given> block to the next, even if the input were a | |
2997 | different variable [perl #84526]. | |
2998 | ||
2999 | =item * | |
3000 | ||
3001 | C<when> blocks are now capable of returning variables declared inside the | |
3002 | enclosing C<given> block [perl #93548]. | |
3003 | ||
3004 | =back | |
3005 | ||
3006 | =head2 The C<glob> operator | |
3007 | ||
3008 | =over | |
3009 | ||
3010 | =item * | |
3011 | ||
3012 | On OSes other than VMS, Perl's C<glob> operator (and the C<< <...> >> form) | |
3013 | use L<File::Glob> underneath. L<File::Glob> splits the pattern into words, | |
3014 | before feeding each word to its C<bsd_glob> function. | |
3015 | ||
3016 | There were several inconsistencies in the way the split was done. Now | |
3017 | quotation marks (' and ") are always treated as shell-style word delimiters | |
3018 | (that allow whitespace as part of a word) and backslashes are always | |
3019 | preserved, unless they exist to escape quotation marks. Before, those | |
3020 | would only sometimes be the case, depending on whether the pattern | |
3021 | contained whitespace. Also, escaped whitespace at the end of the pattern | |
3022 | is no longer stripped [perl #40470]. | |
3023 | ||
3024 | =item * | |
3025 | ||
3026 | C<CORE::glob> now works as a way to call the default globbing function. It | |
3027 | used to respect overrides, despite the C<CORE::> prefix. | |
3028 | ||
3029 | =item * | |
3030 | ||
3031 | Under miniperl (used to configure modules when perl itself is built), | |
3032 | C<glob> now clears %ENV before calling csh, since the latter croaks on some | |
7af9a95b | 3033 | systems if it does not like the contents of the LS_COLORS environment |
05c8f9ed RS |
3034 | variable [perl #98662]. |
3035 | ||
3036 | =back | |
3037 | ||
3038 | =head2 Lvalue subroutines | |
3039 | ||
3040 | =over | |
3041 | ||
3042 | =item * | |
3043 | ||
3044 | Explicit return now returns the actual argument passed to return, instead | |
3045 | of copying it [perl #72724, #72706]. | |
3046 | ||
3047 | =item * | |
3048 | ||
3049 | Lvalue subroutines used to enforce lvalue syntax (i.e., whatever can go on | |
3050 | the left-hand side of C<=>) for the last statement and the arguments to | |
3051 | return. Since lvalue subroutines are not always called in lvalue context, | |
3052 | this restriction has been lifted. | |
3053 | ||
3054 | =item * | |
3055 | ||
7af9a95b | 3056 | Lvalue subroutines are less restrictive about what values can be returned. |
05c8f9ed RS |
3057 | It used to croak on values returned by C<shift> and C<delete> and from |
3058 | other subroutines, but no longer does so [perl #71172]. | |
3059 | ||
3060 | =item * | |
3061 | ||
3062 | Empty lvalue subroutines (C<sub :lvalue {}>) used to return C<@_> in list | |
7af9a95b | 3063 | context. All subroutines used to do this, but regular subs were fixed in |
05c8f9ed RS |
3064 | Perl 5.8.2. Now lvalue subroutines have been likewise fixed. |
3065 | ||
3066 | =item * | |
3067 | ||
3068 | Autovivification now works on values returned from lvalue subroutines | |
3069 | [perl #7946], as does returning C<keys> in lvalue context. | |
3070 | ||
3071 | =item * | |
3072 | ||
3073 | Lvalue subroutines used to copy their return values in rvalue context. Not | |
3074 | only was this a waste of CPU cycles, but it also caused bugs. A C<($)> | |
3075 | prototype would cause an lvalue sub to copy its return value [perl #51408], | |
3076 | and C<while(lvalue_sub() =~ m/.../g) { ... }> would loop endlessly | |
3077 | [perl #78680]. | |
3078 | ||
3079 | =item * | |
3080 | ||
3081 | When called in potential lvalue context | |
3082 | (e.g., subroutine arguments or a list | |
3083 | passed to C<for>), lvalue subroutines used to copy | |
3084 | any read-only value that was returned. E.g., C< sub :lvalue { $] } > | |
3085 | would not return C<$]>, but a copy of it. | |
3086 | ||
3087 | =item * | |
3088 | ||
3089 | When called in potential lvalue context, an lvalue subroutine returning | |
3090 | arrays or hashes used to bind the arrays or hashes to scalar variables, | |
3091 | resulting in bugs. This was fixed in 5.14.0 if an array were the first | |
3092 | thing returned from the subroutine (but not for C<$scalar, @array> or | |
3093 | hashes being returned). Now a more general fix has been applied | |
3094 | [perl #23790]. | |
3095 | ||
3096 | =item * | |
3097 | ||
3098 | Method calls whose arguments were all surrounded with C<my()> or C<our()> | |
3099 | (as in C<< $object->method(my($a,$b)) >>) used to force lvalue context on | |
3100 | the subroutine. This would prevent lvalue methods from returning certain | |
3101 | values. | |
3102 | ||
3103 | =item * | |
3104 | ||
3105 | Lvalue sub calls that are not determined to be such at compile time | |
3106 | (C<&$name> or &{"name"}) are no longer exempt from strict refs if they | |
3107 | occur in the last statement of an lvalue subroutine [perl #102486]. | |
3108 | ||
3109 | =item * | |
3110 | ||
3111 | Sub calls whose subs are not visible at compile time, if | |
3112 | they occurred in the last statement of an lvalue subroutine, | |
3113 | would reject non-lvalue subroutines and die with "Can't modify non-lvalue | |
3114 | subroutine call" [perl #102486]. | |
3115 | ||
3116 | Non-lvalue sub calls whose subs I<are> visible at compile time exhibited | |
3117 | the opposite bug. If the call occurred in the last statement of an lvalue | |
3118 | subroutine, there would be no error when the lvalue sub was called in | |
3119 | lvalue context. Perl would blindly assign to the temporary value returned | |
3120 | by the non-lvalue subroutine. | |
3121 | ||
3122 | =item * | |
3123 | ||
3124 | C<AUTOLOAD> routines used to take precedence over the actual sub being | |
3125 | called (i.e., when autoloading wasn't needed), for sub calls in lvalue or | |
3126 | potential lvalue context, if the subroutine was not visible at compile | |
3127 | time. | |
3128 | ||
3129 | =item * | |
3130 | ||
3131 | Applying the C<:lvalue> attribute to an XSUB or to an aliased subroutine | |
3132 | stub with C<< sub foo :lvalue; >> syntax stopped working in Perl 5.12. | |
3133 | This has been fixed. | |
3134 | ||
3135 | =item * | |
3136 | ||
3137 | Applying the :lvalue attribute to subroutine that is already defined does | |
3138 | not work properly, as the attribute changes the way the sub is compiled. | |
3139 | Hence, Perl 5.12 began warning when an attempt is made to apply the | |
3140 | attribute to an already defined sub. In such cases, the attribute is | |
3141 | discarded. | |
3142 | ||
3143 | But the change in 5.12 missed the case where custom attributes are also | |
3144 | present: that case still silently and ineffectively applied the attribute. | |
3145 | That omission has now been corrected. C<sub foo :lvalue :Whatever> (when | |
3146 | C<foo> is already defined) now warns about the :lvalue attribute, and does | |
3147 | not apply it. | |
3148 | ||
3149 | =item * | |
3150 | ||
3151 | A bug affecting lvalue context propagation through nested lvalue subroutine | |
3152 | calls has been fixed. Previously, returning a value in nested rvalue | |
3153 | context would be treated as lvalue context by the inner subroutine call, | |
3154 | resulting in some values (such as read-only values) being rejected. | |
3155 | ||
3156 | =back | |
3157 | ||
3158 | =head2 Overloading | |
3159 | ||
3160 | =over | |
3161 | ||
3162 | =item * | |
3163 | ||
3164 | Arithmetic assignment (C<$left += $right>) involving overloaded objects | |
3165 | that rely on the 'nomethod' override no longer segfault when the left | |
3166 | operand is not overloaded. | |
3167 | ||
3168 | =item * | |
3169 | ||
3170 | Errors that occur when methods cannot be found during overloading now | |
3171 | mention the correct package name, as they did in 5.8.x, instead of | |
3172 | erroneously mentioning the "overload" package, as they have since 5.10.0. | |
3173 | ||
3174 | =item * | |
3175 | ||
3176 | Undefining C<%overload::> no longer causes a crash. | |
3177 | ||
3178 | =back | |
3179 | ||
3180 | =head2 Prototypes of built-in keywords | |
3181 | ||
3182 | =over | |
3183 | ||
3184 | =item * | |
3185 | ||
3186 | The C<prototype> function no longer dies for the C<__FILE__>, C<__LINE__> | |
3187 | and C<__PACKAGE__> directives. It now returns an empty-string prototype | |
3188 | for them, because they are syntactically indistinguishable from nullary | |
3189 | functions like C<time>. | |
3190 | ||
3191 | =item * | |
3192 | ||
3193 | C<prototype> now returns C<undef> for all overridable infix operators, | |
3194 | such as C<eq>, which are not callable in any way resembling functions. | |
3195 | It used to return incorrect prototypes for some and die for others | |
3196 | [perl #94984]. | |
3197 | ||
3198 | =item * | |
3199 | ||
3200 | The prototypes of several built-in functions--C<getprotobynumber>, C<lock>, | |
3201 | C<not> and C<select>--have been corrected, or at least are now closer to | |
3202 | reality than before. | |
3203 | ||
3204 | =back | |
3205 | ||
3206 | =head2 Regular expressions | |
3207 | ||
3208 | =for comment Is it possible to merge some of these items? | |
3209 | ||
3210 | =over 4 | |
3211 | ||
3212 | =item * | |
3213 | ||
3214 | C</[[:ascii:]]/> and C</[[:blank:]]/> now use locale rules under | |
3215 | C<use locale> when the platform supports that. Previously, they used | |
3216 | the platform's native character set. | |
3217 | ||
3218 | =item * | |
3219 | ||
3220 | C<m/[[:ascii:]]/i> and C</\p{ASCII}/i> now match identically (when not | |
3221 | under a differing locale). This fixes a regression introduced in 5.14 | |
3222 | in which the first expression could match characters outside of ASCII, | |
3223 | such as the KELVIN SIGN. | |
3224 | ||
3225 | =item * | |
3226 | ||
3227 | C</.*/g> would sometimes refuse to match at the end of a string that ends | |
3228 | with "\n". This has been fixed [perl #109206]. | |
3229 | ||
3230 | =item * | |
3231 | ||
3232 | Starting with 5.12.0, Perl used to get its internal bookkeeping muddled up | |
3233 | after assigning C<${ qr// }> to a hash element and locking it with | |
7af9a95b | 3234 | L<Hash::Util>. This could result in double frees, crashes, or erratic |
1540de7c | 3235 | behavior. |
05c8f9ed RS |
3236 | |
3237 | =item * | |
3238 | ||
3239 | The new (in 5.14.0) regular expression modifier C</a> when repeated like | |
3240 | C</aa> forbids the characters outside the ASCII range that match | |
3241 | characters inside that range from matching under C</i>. This did not | |
3242 | work under some circumstances, all involving alternation, such as: | |
3243 | ||
3244 | "\N{KELVIN SIGN}" =~ /k|foo/iaa; | |
3245 | ||
3246 | succeeded inappropriately. This is now fixed. | |
3247 | ||
3248 | =item * | |
3249 | ||
3250 | 5.14.0 introduced some memory leaks in regular expression character | |
3251 | classes such as C<[\w\s]>, which have now been fixed. (5.14.1) | |
3252 | ||
3253 | =item * | |
3254 | ||
3255 | An edge case in regular expression matching could potentially loop. | |
3256 | This happened only under C</i> in bracketed character classes that have | |
3257 | characters with multi-character folds, and the target string to match | |
3258 | against includes the first portion of the fold, followed by another | |
3259 | character that has a multi-character fold that begins with the remaining | |
3260 | portion of the fold, plus some more. | |
3261 | ||
3262 | "s\N{U+DF}" =~ /[\x{DF}foo]/i | |
3263 | ||
3264 | is one such case. C<\xDF> folds to C<"ss">. (5.14.1) | |
3265 | ||
3266 | =item * | |
3267 | ||
3268 | A few characters in regular expression pattern matches did not | |
3269 | match correctly in some circumstances, all involving C</i>. The | |
3270 | affected characters are: | |
3271 | COMBINING GREEK YPOGEGRAMMENI, | |
3272 | GREEK CAPITAL LETTER IOTA, | |
3273 | GREEK CAPITAL LETTER UPSILON, | |
3274 | GREEK PROSGEGRAMMENI, | |
3275 | GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA, | |
3276 | GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS, | |
3277 | GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA, | |
3278 | GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS, | |
3279 | LATIN SMALL LETTER LONG S, | |
3280 | LATIN SMALL LIGATURE LONG S T, | |
3281 | and | |
3282 | LATIN SMALL LIGATURE ST. | |
3283 | ||
3284 | =item * | |
3285 | ||
3286 | A memory leak regression in regular expression compilation | |
3287 | under threading has been fixed. | |
3288 | ||
3289 | =item * | |
3290 | ||
3620abf9 | 3291 | A regression introduced in 5.14.0 has |
05c8f9ed RS |
3292 | been fixed. This involved an inverted |
3293 | bracketed character class in a regular expression that consisted solely | |
3294 | of a Unicode property. That property wasn't getting inverted outside the | |
3295 | Latin1 range. | |
3296 | ||
3297 | =item * | |
3298 | ||
7af9a95b | 3299 | Three problematic Unicode characters now work better in regex pattern matching under C</i>. |
05c8f9ed RS |
3300 | |
3301 | In the past, three Unicode characters: | |
3302 | LATIN SMALL LETTER SHARP S, | |
3303 | GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS, | |
3304 | and | |
3305 | GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS, | |
3306 | along with the sequences that they fold to | |
7af9a95b | 3307 | (including "ss" for LATIN SMALL LETTER SHARP S), |
05c8f9ed RS |
3308 | did not properly match under C</i>. 5.14.0 fixed some of these cases, |
3309 | but introduced others, including a panic when one of the characters or | |
3310 | sequences was used in the C<(?(DEFINE)> regular expression predicate. | |
3311 | The known bugs that were introduced in 5.14 have now been fixed; as well | |
7af9a95b | 3312 | as some other edge cases that have never worked until now. These all |
05c8f9ed RS |
3313 | involve using the characters and sequences outside bracketed character |
3314 | classes under C</i>. This closes [perl #98546]. | |
3315 | ||
3316 | There remain known problems when using certain characters with | |
3317 | multi-character folds inside bracketed character classes, including such | |
3318 | constructs as C<qr/[\N{LATIN SMALL LETTER SHARP}a-z]/i>. These | |
3319 | remaining bugs are addressed in [perl #89774]. | |
3320 | ||
3321 | =item * | |
3322 | ||
3323 | RT #78266: The regex engine has been leaking memory when accessing | |
3324 | named captures that weren't matched as part of a regex ever since 5.10 | |
7af9a95b | 3325 | when they were introduced; e.g., this would consume over a hundred MB of |
05c8f9ed RS |
3326 | memory: |
3327 | ||
3328 | for (1..10_000_000) { | |
3329 | if ("foo" =~ /(foo|(?<capture>bar))?/) { | |
3330 | my $capture = $+{capture} | |
3331 | } | |
3332 | } | |
3333 | system "ps -o rss $$"' | |
3334 | ||
3335 | =item * | |
3336 | ||
3337 | In 5.14, C</[[:lower:]]/i> and C</[[:upper:]]/i> no longer matched the | |
3338 | opposite case. This has been fixed [perl #101970]. | |
3339 | ||
3340 | =item * | |
3341 | ||
3342 | A regular expression match with an overloaded object on the right-hand side | |
7af9a95b | 3343 | would sometimes stringify the object too many times. |
05c8f9ed RS |
3344 | |
3345 | =item * | |
3346 | ||
3347 | A regression has been fixed that was introduced in 5.14, in C</i> | |
3348 | regular expression matching, in which a match improperly fails if the | |
3349 | pattern is in UTF-8, the target string is not, and a Latin-1 character | |
3350 | precedes a character in the string that should match the pattern. | |
3351 | [perl #101710] | |
3352 | ||
3353 | =item * | |
3354 | ||
3355 | In case-insensitive regular expression pattern matching, no longer on | |
7af9a95b | 3356 | UTF-8 encoded strings does the scan for the start of match look only at |
05c8f9ed RS |
3357 | the first possible position. This caused matches such as |
3358 | C<"f\x{FB00}" =~ /ff/i> to fail. | |
3359 | ||
3360 | =item * | |
3361 | ||
1540de7c | 3362 | The regexp optimizer no longer crashes on debugging builds when merging |
05c8f9ed RS |
3363 | fixed-string nodes with inconvenient contents. |
3364 | ||
3365 | =item * | |
3366 | ||
3367 | A panic involving the combination of the regular expression modifiers | |
3368 | C</aa> and the C<\b> escape sequence introduced in 5.14.0 has been | |
006b5090 | 3369 | fixed [perl #95964]. (5.14.2) |
05c8f9ed RS |
3370 | |
3371 | =item * | |
3372 | ||
3373 | The combination of the regular expression modifiers C</aa> and the C<\b> | |
3374 | and C<\B> escape sequences did not work properly on UTF-8 encoded | |
3375 | strings. All non-ASCII characters under C</aa> should be treated as | |
3376 | non-word characters, but what was happening was that Unicode rules were | |
3377 | used to determine wordness/non-wordness for non-ASCII characters. This | |
3378 | is now fixed [perl #95968]. | |
3379 | ||
3380 | =item * | |
3381 | ||
3382 | C<< (?foo: ...) >> no longer loses passed in character set. | |
3383 | ||
3384 | =item * | |
3385 | ||
1540de7c | 3386 | The trie optimization used to have problems with alternations containing |
05c8f9ed RS |
3387 | an empty C<(?:)>, causing C<< "x" =~ /\A(?>(?:(?:)A|B|C?x))\z/ >> not to |
3388 | match, whereas it should [perl #111842]. | |
3389 | ||
3390 | =item * | |
3391 | ||
3392 | Use of lexical (C<my>) variables in code blocks embedded in regular | |
3393 | expressions will no longer result in memory corruption or crashes. | |
3394 | ||
3395 | Nevertheless, these code blocks are still experimental, as there are still | |
3396 | problems with the wrong variables being closed over (in loops for instance) | |
3397 | and with abnormal exiting (e.g., C<die>) causing memory corruption. | |
3398 | ||
3399 | =item * | |
3400 | ||
3401 | The C<\h>, C<\H>, C<\v> and C<\V> regular expression metacharacters used to | |
7af9a95b | 3402 | cause a panic error message when trying to match at the end of the |
05c8f9ed RS |
3403 | string [perl #96354]. |
3404 | ||
3405 | =item * | |
3406 | ||
3407 | The abbreviations for four C1 control characters C<MW> C<PM>, C<RI>, and | |
3408 | C<ST> were previously unrecognized by C<\N{}>, vianame(), and | |
3409 | string_vianame(). | |
3410 | ||
3411 | =item * | |
3412 | ||
3413 | Mentioning a variable named "&" other than C<$&> (i.e., C<@&> or C<%&>) no | |
3414 | longer stops C<$&> from working. The same applies to variables named "'" | |
3415 | and "`" [perl #24237]. | |
3416 | ||
3417 | =item * | |
3418 | ||
3419 | Creating a C<UNIVERSAL::AUTOLOAD> sub no longer stops C<%+>, C<%-> and | |
3420 | C<%!> from working some of the time [perl #105024]. | |
3421 | ||
3422 | =back | |
3423 | ||
3424 | =head2 Smartmatching | |
3425 | ||
3426 | =over | |
3427 | ||
3428 | =item * | |
3429 | ||
3430 | C<~~> now correctly handles the precedence of Any~~Object, and is not tricked | |
3431 | by an overloaded object on the left-hand side. | |
3432 | ||
3433 | =item * | |
3434 | ||
3435 | In Perl 5.14.0, C<$tainted ~~ @array> stopped working properly. Sometimes | |
3436 | it would erroneously fail (when C<$tainted> contained a string that occurs | |
3437 | in the array I<after> the first element) or erroneously succeed (when | |
3438 | C<undef> occurred after the first element) [perl #93590]. | |
3439 | ||
3440 | =back | |
3441 | ||
3442 | =head2 The C<sort> operator | |
3443 | ||
3444 | =over | |
3445 | ||
3446 | =item * | |
3447 | ||
3448 | C<sort> was not treating C<sub {}> and C<sub {()}> as equivalent when | |
3449 | such a sub was provided as the comparison routine. It used to croak on | |
3450 | C<sub {()}>. | |
3451 | ||
3452 | =item * | |
3453 | ||
3454 | C<sort> now works once more with custom sort routines that are XSUBs. It | |
3455 | stopped working in 5.10.0. | |
3456 | ||
3457 | =item * | |
3458 | ||
3459 | C<sort> with a constant for a custom sort routine, although it produces | |
3460 | unsorted results, no longer crashes. It started crashing in 5.10.0. | |
3461 | ||
3462 | =item * | |
3463 | ||
3464 | Warnings emitted by C<sort> when a custom comparison routine returns a | |
3465 | non-numeric value now contain "in sort" and show the line number of the | |
3466 | C<sort> operator, rather than the last line of the comparison routine. The | |
7af9a95b | 3467 | warnings also now occur only if warnings are enabled in the scope where |
05c8f9ed RS |
3468 | C<sort> occurs. Previously the warnings would occur if enabled in the |
3469 | comparison routine's scope. | |
3470 | ||
3471 | =item * | |
3472 | ||
1540de7c | 3473 | C<< sort { $a <=> $b } >>, which is optimized internally, now produces |
05c8f9ed RS |
3474 | "uninitialized" warnings for NaNs (not-a-number values), since C<< <=> >> |
3475 | returns C<undef> for those. This brings it in line with | |
3476 | S<C<< sort { 1; $a <=> $b } >>> and other more complex cases, which are not | |
1540de7c | 3477 | optimized [perl #94390]. |
05c8f9ed RS |
3478 | |
3479 | =back | |
3480 | ||
3481 | =head2 The C<substr> operator | |
3482 | ||
3483 | =over | |
3484 | ||
3485 | =item * | |
88c5c971 | 3486 | |
05c8f9ed RS |
3487 | Tied (and otherwise magical) variables are no longer exempt from the |
3488 | "Attempt to use reference as lvalue in substr" warning. | |
8f12b018 | 3489 | |
05c8f9ed | 3490 | =item * |
8f12b018 | 3491 | |
05c8f9ed | 3492 | That warning now occurs when the returned lvalue is assigned to, not |
7af9a95b TC |
3493 | when C<substr> itself is called. This makes a difference only if the |
3494 | return value of C<substr> is referenced and later assigned to. | |
26afcec5 | 3495 | |
05c8f9ed | 3496 | =item * |
8f12b018 | 3497 | |
05c8f9ed RS |
3498 | Passing a substring of a read-only value or a typeglob to a function |
3499 | (potential lvalue context) no longer causes an immediate "Can't coerce" | |
7af9a95b TC |
3500 | or "Modification of a read-only value" error. That error occurs only |
3501 | if the passed value is assigned to. | |
d7fbd56d | 3502 | |
05c8f9ed | 3503 | The same thing happens with the "substr outside of string" error. If |
7af9a95b | 3504 | the lvalue is only read from, not written to, it is now just a warning, as |
05c8f9ed | 3505 | with rvalue C<substr>. |
d7fbd56d | 3506 | |
05c8f9ed | 3507 | =item * |
d5dc7001 | 3508 | |
05c8f9ed RS |
3509 | C<substr> assignments no longer call FETCH twice if the first argument |
3510 | is a tied variable, just once. | |
d5dc7001 | 3511 | |
05c8f9ed | 3512 | =back |
711a3903 | 3513 | |
05c8f9ed | 3514 | =head2 Support for embedded nulls |
977c1d31 | 3515 | |
05c8f9ed RS |
3516 | Some parts of Perl did not work correctly with nulls (C<chr 0>) embedded in |
3517 | strings. That meant that, for instance, C<< $m = "a\0b"; foo->$m >> would | |
3518 | call the "a" method, instead of the actual method name contained in $m. | |
3519 | These parts of perl have been fixed to support nulls: | |
27f00e3d | 3520 | |
05c8f9ed | 3521 | =over |
6ba817f3 | 3522 | |
05c8f9ed | 3523 | =item * |
2630d42b | 3524 | |
05c8f9ed | 3525 | Method names |
7620cb10 | 3526 | |
05c8f9ed | 3527 | =item * |
d7c042c9 | 3528 | |
05c8f9ed | 3529 | Typeglob names (including filehandle and subroutine names) |
d7c042c9 | 3530 | |
05c8f9ed | 3531 | =item * |
d7c042c9 | 3532 | |
05c8f9ed | 3533 | Package names, including the return value of C<ref()> |
985213f2 | 3534 | |
05c8f9ed | 3535 | =item * |
977c1d31 | 3536 | |
05c8f9ed | 3537 | Typeglob elements (C<*foo{"THING\0stuff"}>) |
977c1d31 | 3538 | |
05c8f9ed | 3539 | =item * |
985213f2 | 3540 | |
05c8f9ed | 3541 | Signal names |
985213f2 | 3542 | |
204b72a4 | 3543 | =item * |
2e2b2571 | 3544 | |
05c8f9ed RS |
3545 | Various warnings and error messages that mention variable names or values, |
3546 | methods, etc. | |
2e2b2571 | 3547 | |
204b72a4 | 3548 | =back |
b240fc0f | 3549 | |
05c8f9ed RS |
3550 | One side effect of these changes is that blessing into "\0" no longer |
3551 | causes C<ref()> to return false. | |
27f00e3d | 3552 | |
05c8f9ed | 3553 | =head2 Threading bugs |
27f00e3d | 3554 | |
05c8f9ed | 3555 | =over |
cadced9f | 3556 | |
05c8f9ed | 3557 | =item * |
cadced9f | 3558 | |
05c8f9ed RS |
3559 | Typeglobs returned from threads are no longer cloned if the parent thread |
3560 | already has a glob with the same name. This means that returned | |
3561 | subroutines will now assign to the right package variables [perl #107366]. | |
3562 | ||
3563 | =item * | |
3564 | ||
3565 | Some cases of threads crashing due to memory allocation during cloning have | |
3566 | been fixed [perl #90006]. | |
632c5d30 NC |
3567 | |
3568 | =item * | |
3569 | ||
05c8f9ed | 3570 | Thread joining would sometimes emit "Attempt to free unreferenced scalar" |
7af9a95b | 3571 | warnings if C<caller> had been used from the C<DB> package before thread |
05c8f9ed RS |
3572 | creation [perl #98092]. |
3573 | ||
3574 | =item * | |
3575 | ||
3576 | Locking a subroutine (via C<lock &sub>) is no longer a compile-time error | |
3577 | for regular subs. For lvalue subroutines, it no longer tries to return the | |
3578 | sub as a scalar, resulting in strange side effects like C<ref \$_> | |
3579 | returning "CODE" in some instances. | |
3580 | ||
3581 | C<lock &sub> is now a run-time error if L<threads::shared> is loaded (a | |
3582 | no-op otherwise), but that may be rectified in a future version. | |
95ce428c | 3583 | |
2630d42b | 3584 | =back |
95ce428c | 3585 | |
05c8f9ed | 3586 | =head2 Tied variables |
4e6e9b23 | 3587 | |
05c8f9ed | 3588 | =over |
4e6e9b23 | 3589 | |
c88a046d | 3590 | =item * |
4e6e9b23 | 3591 | |
05c8f9ed RS |
3592 | Various cases in which FETCH was being ignored or called too many times |
3593 | have been fixed: | |
1887da8c | 3594 | |
05c8f9ed | 3595 | =over |
58856662 | 3596 | |
05c8f9ed | 3597 | =item * |
c88a046d | 3598 | |
05c8f9ed | 3599 | C<PerlIO::get_layers> [perl #97956] |
58856662 NC |
3600 | |
3601 | =item * | |
3602 | ||
05c8f9ed RS |
3603 | C<$tied =~ y/a/b/>, C<chop $tied> and C<chomp $tied> when $tied holds a |
3604 | reference. | |
d333a655 | 3605 | |
05c8f9ed | 3606 | =item * |
589c1691 | 3607 | |
05c8f9ed | 3608 | When calling C<local $_> [perl #105912] |
fae9e8f4 | 3609 | |
05c8f9ed | 3610 | =item * |
fae9e8f4 | 3611 | |
05c8f9ed | 3612 | Four-argument C<select> |
58856662 | 3613 | |
05c8f9ed RS |
3614 | =item * |
3615 | ||
3616 | A tied buffer passed to C<sysread> | |
c11980ad | 3617 | |
05c8f9ed | 3618 | =item * |
c11980ad | 3619 | |
05c8f9ed | 3620 | C<< $tied .= <> >> |
c88a046d | 3621 | |
05c8f9ed | 3622 | =item * |
c88a046d | 3623 | |
05c8f9ed RS |
3624 | Three-argument C<open>, the third being a tied file handle |
3625 | (as in C<< open $fh, ">&", $tied >>) | |
2630d42b | 3626 | |
05c8f9ed | 3627 | =item * |
c88a046d | 3628 | |
05c8f9ed | 3629 | C<sort> with a reference to a tied glob for the comparison routine. |
c88a046d A |
3630 | |
3631 | =item * | |
3632 | ||
05c8f9ed | 3633 | C<..> and C<...> in list context [perl #53554]. |
c88a046d | 3634 | |
05c8f9ed | 3635 | =item * |
c88a046d | 3636 | |
05c8f9ed RS |
3637 | C<${$tied}>, C<@{$tied}>, C<%{$tied}> and C<*{$tied}> where the tied |
3638 | variable returns a string (C<&{}> was unaffected) | |
c88a046d | 3639 | |
05c8f9ed | 3640 | =item * |
c88a046d | 3641 | |
05c8f9ed RS |
3642 | C<defined ${ $tied_variable }> |
3643 | ||
3644 | =item * | |
c88a046d | 3645 | |
05c8f9ed RS |
3646 | Various functions that take a filehandle argument in rvalue context |
3647 | (C<close>, C<readline>, etc.) [perl #97482] | |
c88a046d | 3648 | |
05c8f9ed | 3649 | =item * |
c11980ad | 3650 | |
05c8f9ed RS |
3651 | Some cases of dereferencing a complex expression, such as |
3652 | C<${ (), $tied } = 1>, used to call C<FETCH> multiple times, but now call | |
3653 | it once. | |
c11980ad | 3654 | |
05c8f9ed | 3655 | =item * |
c88a046d | 3656 | |
05c8f9ed RS |
3657 | C<$tied-E<gt>method> where $tied returns a package name--even resulting in |
3658 | a failure to call the method, due to memory corruption | |
6c69e197 | 3659 | |
05c8f9ed | 3660 | =item * |
c88a046d | 3661 | |
05c8f9ed | 3662 | Assignments like C<*$tied = \&{"..."}> and C<*glob = $tied> |
c88a046d A |
3663 | |
3664 | =item * | |
3665 | ||
05c8f9ed RS |
3666 | C<chdir>, C<chmod>, C<chown>, C<utime>, C<truncate>, C<stat>, C<lstat> and |
3667 | the filetest ops (C<-r>, C<-x>, etc.) | |
c88a046d | 3668 | |
2630d42b | 3669 | =back |
c88a046d | 3670 | |
05c8f9ed | 3671 | =item * |
2630d42b | 3672 | |
05c8f9ed RS |
3673 | C<caller> sets C<@DB::args> to the subroutine arguments when called from |
3674 | the DB package. It used to crash when doing so if C<@DB::args> happened to | |
3675 | be tied. Now it croaks instead. | |
84ecb73f | 3676 | |
fae9e8f4 A |
3677 | =item * |
3678 | ||
05c8f9ed RS |
3679 | Tying an element of %ENV or C<%^H> and then deleting that element would |
3680 | result in a call to the tie object's DELETE method, even though tying the | |
3681 | element itself is supposed to be equivalent to tying a scalar (the element | |
3682 | is, of course, a scalar) [perl #67490]. | |
fae9e8f4 | 3683 | |
05c8f9ed | 3684 | =item * |
a3cc0403 | 3685 | |
05c8f9ed RS |
3686 | When Perl autovivifies an element of a tied array or hash (which entails |
3687 | calling STORE with a new reference), it now calls FETCH immediately after | |
3688 | the STORE, instead of assuming that FETCH would have returned the same | |
3689 | reference. This can make it easier to implement tied objects [perl #35865, #43011]. | |
c88a046d | 3690 | |
05c8f9ed | 3691 | =item * |
75ff5956 | 3692 | |
05c8f9ed RS |
3693 | Four-argument C<select> no longer produces its "Non-string passed as |
3694 | bitmask" warning on tied or tainted variables that are strings. | |
3695 | ||
3696 | =item * | |
3697 | ||
1540de7c | 3698 | Localizing a tied scalar that returns a typeglob no longer stops it from |
05c8f9ed RS |
3699 | being tied till the end of the scope. |
3700 | ||
3701 | =item * | |
3702 | ||
3703 | Attempting to C<goto> out of a tied handle method used to cause memory | |
3704 | corruption or crashes. Now it produces an error message instead | |
3705 | [perl #8611]. | |
75ff5956 | 3706 | |
2630d42b | 3707 | =item * |
c11980ad | 3708 | |
05c8f9ed RS |
3709 | A bug has been fixed that occurs when a tied variable is used as a |
3710 | subroutine reference: if the last thing assigned to or returned from the | |
3711 | variable was a reference or typeglob, the C<\&$tied> could either crash or | |
3712 | return the wrong subroutine. The reference case is a regression introduced | |
3713 | in Perl 5.10.0. For typeglobs, it has probably never worked till now. | |
843331c7 | 3714 | |
2630d42b | 3715 | =back |
c11980ad | 3716 | |
05c8f9ed | 3717 | =head2 Version objects and vstrings |
2a7afa74 | 3718 | |
05c8f9ed | 3719 | =over |
ecd144ea | 3720 | |
05c8f9ed | 3721 | =item * |
c11980ad | 3722 | |
05c8f9ed RS |
3723 | The bitwise complement operator (and possibly other operators, too) when |
3724 | passed a vstring would leave vstring magic attached to the return value, | |
3725 | even though the string had changed. This meant that | |
3726 | C<< version->new(~v1.2.3) >> would create a version looking like "v1.2.3" | |
3727 | even though the string passed to C<< version->new >> was actually | |
3728 | "\376\375\374". This also caused L<B::Deparse> to deparse C<~v1.2.3> | |
3729 | incorrectly, without the C<~> [perl #29070]. | |
c11980ad | 3730 | |
05c8f9ed RS |
3731 | =item * |
3732 | ||
3733 | Assigning a vstring to a magic (e.g., tied, C<$!>) variable and then | |
7af9a95b | 3734 | assigning something else used to blow away all magic. This meant that |
05c8f9ed RS |
3735 | tied variables would come undone, C<$!> would stop getting updated on |
3736 | failed system calls, C<$|> would stop setting autoflush, and other | |
3737 | mischief would take place. This has been fixed. | |
3738 | ||
3739 | =item * | |
3740 | ||
3741 | C<< version->new("version") >> and C<printf "%vd", "version"> no longer | |
3742 | crash [perl #102586]. | |
ecd144ea FC |
3743 | |
3744 | =item * | |
3745 | ||
05c8f9ed RS |
3746 | Version comparisons, such as those that happen implicitly with C<use |
3747 | v5.43>, no longer cause locale settings to change [perl #105784]. | |
3748 | ||
3749 | =item * | |
3750 | ||
3751 | Version objects no longer cause memory leaks in boolean context | |
3752 | [perl #109762]. | |
9dea6244 | 3753 | |
204b72a4 | 3754 | =back |
9dea6244 | 3755 | |
05c8f9ed | 3756 | =head2 Warnings, redefinition |
c11980ad | 3757 | |
05c8f9ed | 3758 | =over |
2a7afa74 | 3759 | |
05c8f9ed | 3760 | =item * |
e9e4ee62 | 3761 | |
05c8f9ed RS |
3762 | Subroutines from the C<autouse> namespace are once more exempt from |
3763 | redefinition warnings. This used to work in 5.005, but was broken in | |
3764 | 5.6 for most subroutines. For subs created via XS that redefine | |
3765 | subroutines from the C<autouse> package, this stopped working in 5.10. | |
937a45d0 | 3766 | |
ef337e16 CBW |
3767 | =item * |
3768 | ||
05c8f9ed RS |
3769 | New XSUBs now produce redefinition warnings if they overwrite existing |
3770 | subs, as they did in 5.8.x. (The C<autouse> logic was reversed in | |
3771 | 5.10-14. Only subroutines from the C<autouse> namespace would warn | |
3772 | when clobbered.) | |
ef337e16 | 3773 | |
05c8f9ed | 3774 | =item * |
679b54e7 | 3775 | |
05c8f9ed RS |
3776 | C<newCONSTSUB> used to use compile-time warning hints, instead of |
3777 | run-time hints. The following code should never produce a redefinition | |
3778 | warning, but it used to, if C<newCONSTSUB> redefined an existing | |
3779 | subroutine: | |
39de7394 | 3780 | |
05c8f9ed RS |
3781 | use warnings; |
3782 | BEGIN { | |
3783 | no warnings; | |
3784 | some_XS_function_that_calls_new_CONSTSUB(); | |
3785 | } | |
2630d42b | 3786 | |
05c8f9ed | 3787 | =item * |
2630d42b | 3788 | |
05c8f9ed | 3789 | Redefinition warnings for constant subroutines are on by default (what |
7af9a95b | 3790 | are known as severe warnings in L<perldiag>). This occurred only |
05c8f9ed RS |
3791 | when it was a glob assignment or declaration of a Perl subroutine that |
3792 | caused the warning. If the creation of XSUBs triggered the warning, it | |
3793 | was not a default warning. This has been corrected. | |
52272450 | 3794 | |
84ecb73f S |
3795 | =item * |
3796 | ||
05c8f9ed RS |
3797 | The internal check to see whether a redefinition warning should occur |
3798 | used to emit "uninitialized" warnings in cases like this: | |
3799 | ||
3800 | use warnings "uninitialized"; | |
3801 | use constant {u => undef, v => undef}; | |
3802 | sub foo(){u} | |
3803 | sub foo(){v} | |
84ecb73f | 3804 | |
52deee2e | 3805 | =back |
5dd80d85 | 3806 | |
05c8f9ed | 3807 | =head2 Warnings, "Uninitialized" |
52272450 | 3808 | |
05c8f9ed | 3809 | =over |
249950d7 | 3810 | |
05c8f9ed RS |
3811 | =item * |
3812 | ||
3813 | Various functions that take a filehandle argument in rvalue context | |
3814 | (C<close>, C<readline>, etc.) used to warn twice for an undefined handle | |
3815 | [perl #97482]. | |
a1d95121 | 3816 | |
05c8f9ed | 3817 | =item * |
977c1d31 | 3818 | |
05c8f9ed RS |
3819 | C<dbmopen> now only warns once, rather than three times, if the mode |
3820 | argument is C<undef> [perl #90064]. | |
977c1d31 | 3821 | |
05c8f9ed RS |
3822 | =item * |
3823 | ||
3824 | The C<+=> operator does not usually warn when the left-hand side is | |
3825 | C<undef>, but it was doing so for tied variables. This has been fixed | |
3826 | [perl #44895]. | |
3827 | ||
3828 | =item * | |
977c1d31 | 3829 | |
05c8f9ed RS |
3830 | A bug fix in Perl 5.14 introduced a new bug, causing "uninitialized" |
3831 | warnings to report the wrong variable if the operator in question had | |
3832 | two operands and one was C<%{...}> or C<@{...}>. This has been fixed | |
3833 | [perl #103766]. | |
39ea6a4b | 3834 | |
05c8f9ed RS |
3835 | =item * |
3836 | ||
3837 | C<..> and C<...> in list context now mention the name of the variable in | |
3838 | "uninitialized" warnings for string (as opposed to numeric) ranges. | |
39ea6a4b | 3839 | |
977c1d31 | 3840 | =back |
ea317ccb | 3841 | |
05c8f9ed | 3842 | =head2 Weak references |
a7bff800 | 3843 | |
05c8f9ed | 3844 | =over |
0aae26c1 | 3845 | |
05c8f9ed RS |
3846 | =item * |
3847 | ||
3848 | Weakening the first argument to an automatically-invoked C<DESTROY> method | |
3849 | could result in erroneous "DESTROY created new reference" errors or | |
3850 | crashes. Now it is an error to weaken a read-only reference. | |
3851 | ||
3852 | =item * | |
3853 | ||
3854 | Weak references to lexical hashes going out of scope were not going stale | |
3855 | (becoming undefined), but continued to point to the hash. | |
0aae26c1 | 3856 | |
05c8f9ed RS |
3857 | =item * |
3858 | ||
3859 | Weak references to lexical variables going out of scope are now broken | |
3860 | before any magical methods (e.g., DESTROY on a tie object) are called. | |
3861 | This prevents such methods from modifying the variable that will be seen | |
3862 | the next time the scope is entered. | |
3863 | ||
3864 | =item * | |
d5dc7001 | 3865 | |
05c8f9ed RS |
3866 | Creating a weak reference to an @ISA array or accessing the array index |
3867 | (C<$#ISA>) could result in confused internal bookkeeping for elements | |
7af9a95b | 3868 | later added to the @ISA array. For instance, creating a weak |
05c8f9ed RS |
3869 | reference to the element itself could push that weak reference on to @ISA; |
3870 | and elements added after use of C<$#ISA> would be ignored by method lookup | |
3871 | [perl #85670]. | |
d5dc7001 | 3872 | |
2630d42b | 3873 | =back |
d5dc7001 | 3874 | |
05c8f9ed | 3875 | =head2 Other notable fixes |
d5dc7001 | 3876 | |
05c8f9ed | 3877 | =over |
d5dc7001 | 3878 | |
05c8f9ed | 3879 | =item * |
d5dc7001 | 3880 | |
05c8f9ed RS |
3881 | C<quotemeta> now quotes consistently the same non-ASCII characters under |
3882 | C<use feature 'unicode_strings'>, regardless of whether the string is | |
3883 | encoded in UTF-8 or not, hence fixing the last vestiges (we hope) of the | |
7af9a95b | 3884 | notorious L<perlunicode/The "Unicode Bug">. [perl #77654]. |
d5dc7001 | 3885 | |
05c8f9ed RS |
3886 | Which of these code points is quoted has changed, based on Unicode's |
3887 | recommendations. See L<perlfunc/quotemeta> for details. | |
d5dc7001 | 3888 | |
05c8f9ed | 3889 | =item * |
d5dc7001 | 3890 | |
e58efd23 RS |
3891 | C<study> is now a no-op, presumably fixing all outstanding bugs related to |
3892 | study causing regex matches to behave incorrectly! | |
3893 | ||
3894 | =item * | |
3895 | ||
05c8f9ed RS |
3896 | When one writes C<open foo || die>, which used to work in Perl 4, a |
3897 | "Precedence problem" warning is produced. This warning used erroneously to | |
3898 | apply to fully-qualified bareword handle names not followed by C<||>. This | |
3899 | has been corrected. | |
d5dc7001 | 3900 | |
05c8f9ed | 3901 | =item * |
d5dc7001 | 3902 | |
05c8f9ed RS |
3903 | After package aliasing (C<*foo:: = *bar::>), C<select> with 0 or 1 argument |
3904 | would sometimes return a name that could not be used to refer to the | |
3905 | filehandle, or sometimes it would return C<undef> even when a filehandle | |
3906 | was selected. Now it returns a typeglob reference in such cases. | |
d5dc7001 | 3907 | |
05c8f9ed RS |
3908 | =item * |
3909 | ||
3910 | C<PerlIO::get_layers> no longer ignores some arguments that it thinks are | |
3911 | numeric, while treating others as filehandle names. It is now consistent | |
3912 | for flat scalars (i.e., not references). | |
d5dc7001 A |
3913 | |
3914 | =item * | |
3915 | ||
1540de7c | 3916 | Unrecognized switches on C<#!> line |
0aae26c1 | 3917 | |
05c8f9ed RS |
3918 | If a switch, such as B<-x>, that cannot occur on the C<#!> line is used |
3919 | there, perl dies with "Can't emulate...". | |
0aae26c1 | 3920 | |
05c8f9ed | 3921 | It used to produce the same message for switches that perl did not |
1540de7c | 3922 | recognize at all, whether on the command line or the C<#!> line. |
e2e06450 | 3923 | |
05c8f9ed | 3924 | Now it produces the "Unrecognized switch" error message [perl #104288]. |
ccfdda5c | 3925 | |
05c8f9ed | 3926 | =item * |
e2e06450 | 3927 | |
05c8f9ed RS |
3928 | C<system> now temporarily blocks the SIGCHLD signal handler, to prevent the |
3929 | signal handler from stealing the exit status [perl #105700]. | |
3930 | ||
3931 | =item * | |
3932 | ||
3933 | The %n formatting code for C<printf> and C<sprintf>, which causes the number | |
3934 | of characters to be assigned to the next argument, now actually | |
3935 | assigns the number of characters, instead of the number of bytes. | |
3936 | ||
3937 | It also works now with special lvalue functions like C<substr> and with | |
3938 | nonexistent hash and array elements [perl #3471, #103492]. | |
3939 | ||
3940 | =item * | |
3941 | ||
3942 | Perl skips copying values returned from a subroutine, for the sake of | |
7af9a95b | 3943 | speed, if doing so would make no observable difference. Because of faulty |
05c8f9ed RS |
3944 | logic, this would happen with the |
3945 | result of C<delete>, C<shift> or C<splice>, even if the result was | |
3946 | referenced elsewhere. It also did so with tied variables about to be freed | |
3947 | [perl #91844, #95548]. | |
3948 | ||
3949 | =item * | |
3950 | ||
3951 | C<utf8::decode> now refuses to modify read-only scalars [perl #91850]. | |
3952 | ||
3953 | =item * | |
3954 | ||
3955 | Freeing $_ inside a C<grep> or C<map> block, a code block embedded in a | |
3956 | regular expression, or an @INC filter (a subroutine returned by a | |
3957 | subroutine in @INC) used to result in double frees or crashes | |
3958 | [perl #91880, #92254, #92256]. | |
3959 | ||
3960 | =item * | |
3961 | ||
3962 | C<eval> returns C<undef> in scalar context or an empty list in list | |
3963 | context when there is a run-time error. When C<eval> was passed a | |
3964 | string in list context and a syntax error occurred, it used to return a | |
3965 | list containing a single undefined element. Now it returns an empty | |
3966 | list in list context for all errors [perl #80630]. | |
3967 | ||
3968 | =item * | |
3969 | ||
3970 | C<goto &func> no longer crashes, but produces an error message, when | |
3971 | the unwinding of the current subroutine's scope fires a destructor that | |
3972 | undefines the subroutine being "goneto" [perl #99850]. | |
3973 | ||
3974 | =item * | |
3975 | ||
3976 | Perl now holds an extra reference count on the package that code is | |
3977 | currently compiling in. This means that the following code no longer | |
3978 | crashes [perl #101486]: | |
3979 | ||
3980 | package Foo; | |
3981 | BEGIN {*Foo:: = *Bar::} | |
3982 | sub foo; | |
3983 | ||
3984 | =item * | |
3985 | ||
3986 | The C<x> repetition operator no longer crashes on 64-bit builds with large | |
3987 | repeat counts [perl #94560]. | |
3988 | ||
3989 | =item * | |
3990 | ||
3991 | Calling C<require> on an implicit C<$_> when C<*CORE::GLOBAL::require> has | |
3992 | been overridden does not segfault anymore, and C<$_> is now passed to the | |
3993 | overriding subroutine [perl #78260]. | |
3994 | ||
3995 | =item * | |
3996 | ||
3997 | C<use> and C<require> are no longer affected by the I/O layers active in | |
3998 | the caller's scope (enabled by L<open.pm|open>) [perl #96008]. | |
3999 | ||
4000 | =item * | |
4001 | ||
4002 | C<our $::é; $é> (which is invalid) no longer produces the "Compilation | |
4003 | error at lib/utf8_heavy.pl..." error message, which it started emitting in | |
4004 | 5.10.0 [perl #99984]. | |
4005 | ||
4006 | =item * | |
4007 | ||
4008 | On 64-bit systems, C<read()> now understands large string offsets beyond | |
4009 | the 32-bit range. | |
4010 | ||
4011 | =item * | |
4012 | ||
4013 | Errors that occur when processing subroutine attributes no longer cause the | |
4014 | subroutine's op tree to leak. | |
4015 | ||
4016 | =item * | |
4017 | ||
4018 | Passing the same constant subroutine to both C<index> and C<formline> no | |
4019 | longer causes one or the other to fail [perl #89218]. (5.14.1) | |
4020 | ||
4021 | =item * | |
4022 | ||
4023 | List assignment to lexical variables declared with attributes in the same | |
4024 | statement (C<my ($x,@y) : blimp = (72,94)>) stopped working in Perl 5.8.0. | |
4025 | It has now been fixed. | |
4026 | ||
4027 | =item * | |
4028 | ||
4029 | Perl 5.10.0 introduced some faulty logic that made "U*" in the middle of | |
4030 | a pack template equivalent to "U0" if the input string was empty. This has | |
006b5090 | 4031 | been fixed [perl #90160]. (5.14.2) |
05c8f9ed RS |
4032 | |
4033 | =item * | |
4034 | ||
4035 | Destructors on objects were not called during global destruction on objects | |
4036 | that were not referenced by any scalars. This could happen if an array | |
4037 | element were blessed (e.g., C<bless \$a[0]>) or if a closure referenced a | |
4038 | blessed variable (C<bless \my @a; sub foo { @a }>). | |
4039 | ||
4040 | Now there is an extra pass during global destruction to fire destructors on | |
4041 | any objects that might be left after the usual passes that check for | |
4042 | objects referenced by scalars [perl #36347]. | |
4043 | ||
4044 | =item * | |
4045 | ||
4046 | Fixed a case where it was possible that a freed buffer may have been read | |
4047 | from when parsing a here document [perl #90128]. (5.14.1) | |
4048 | ||
4049 | =item * | |
4050 | ||
4051 | C<each(I<ARRAY>)> is now wrapped in C<defined(...)>, like C<each(I<HASH>)>, | |
4052 | inside a C<while> condition [perl #90888]. | |
4053 | ||
4054 | =item * | |
4055 | ||
4056 | A problem with context propagation when a C<do> block is an argument to | |
4057 | C<return> has been fixed. It used to cause C<undef> to be returned in | |
7af9a95b | 4058 | certain cases of a C<return> inside an C<if> block which itself is followed by |
05c8f9ed |