Commit | Line | Data |
---|---|---|
30682cc3 RS |
1 | =encoding utf8 |
2 | ||
3 | =head1 NAME | |
4 | ||
92221470 | 5 | perl5160delta - what is new for perl v5.16.0 |
30682cc3 RS |
6 | |
7 | =head1 DESCRIPTION | |
8 | ||
9 | This document describes differences between the 5.14.0 release and | |
10 | the 5.16.0 release. | |
11 | ||
12 | If you are upgrading from an earlier release such as 5.12.0, first read | |
13 | L<perl5140delta>, which describes differences between 5.12.0 and | |
14 | 5.14.0. | |
15 | ||
16 | =head1 Notice | |
17 | ||
18 | XXX Any important notices here | |
19 | ||
20 | =head1 Core Enhancements | |
21 | ||
b325a3a2 RS |
22 | =head2 More consistent C<eval> |
23 | ||
24 | The C<eval> operator sometimes treats a string argument as a sequence of | |
25 | characters and sometimes as a sequence of bytes, depending on the internal | |
26 | encoding. The internal encoding is not supposed to make any difference, | |
27 | but there is code that relies on this inconsistency. | |
28 | ||
29 | Under C<use v5.15> and higher, the C<unicode_eval> and C<evalbytes> | |
30 | features resolve this. The C<unicode_eval> feature causes C<eval $string> | |
31 | to treat the string always as Unicode. The C<evalbytes> features provides | |
32 | a function, itself called C<evalbytes>, which evaluates its argument always | |
33 | as a string of bytes. | |
34 | ||
35 | These features also fix oddities with source filters leaking to outer | |
36 | dynamic scopes. | |
37 | ||
38 | See L<feature> for more detail. | |
39 | ||
12477442 RS |
40 | =head2 $^X converted to an absolute path on FreeBSD, OS X and Solaris |
41 | ||
42 | C<$^X> is now converted to an absolute path on OS X, FreeBSD (without | |
43 | needing F</proc> mounted) and Solaris 10 and 11. This augments the | |
44 | previous approach of using F</proc> on Linux, FreeBSD and NetBSD | |
45 | (in all cases, where mounted). | |
46 | ||
47 | This makes relocatable perl installations more useful on these platforms. | |
48 | (See "Relocatable @INC" in F<INSTALL>) | |
49 | ||
50 | =head2 Unicode Symbol Names | |
51 | ||
52 | Perl now has proper support for Unicode in symbol names. It used to be | |
53 | that C<*{$foo}> would ignore the internal UTF8 flag and use the bytes of | |
54 | the underlying representation to look up the symbol. That meant that | |
55 | C<*{"\x{100}"}> and C<*{"\xc4\x80"}> would return the same thing. All | |
56 | these parts of Perl have been fixed to account for Unicode: | |
57 | ||
58 | =over | |
59 | ||
60 | =item * | |
61 | ||
62 | Method names (including those passed to C<use overload>) | |
63 | ||
64 | =item * | |
65 | ||
66 | Typeglob names (including names of variables, subroutines and filehandles) | |
67 | ||
68 | =item * | |
69 | ||
70 | Package names | |
71 | ||
72 | =item * | |
73 | ||
74 | Constant subroutine names (not null-clean yet) | |
75 | ||
76 | =item * | |
77 | ||
78 | C<goto> | |
79 | ||
80 | =item * | |
81 | ||
82 | Symbolic dereferencing | |
83 | ||
84 | =item * | |
85 | ||
86 | Second argument to C<bless()> and C<tie()> | |
87 | ||
88 | =item * | |
89 | ||
90 | Return value of C<ref()> | |
91 | ||
92 | =item * | |
93 | ||
94 | Package names returned by C<caller()> | |
95 | ||
96 | =item * | |
97 | ||
98 | Subroutine prototypes | |
99 | ||
100 | =item * | |
101 | ||
102 | Attributes | |
103 | ||
104 | =item * | |
105 | ||
106 | Various warnings and error messages that mention variable names or values, | |
107 | methods, etc. | |
108 | ||
109 | =back | |
110 | ||
111 | In addition, a parsing bug has been fixed that prevented C<*{é}> from | |
112 | implicitly quoting the name, but instead interpreted it as C<*{+é}>, which | |
113 | would cause a strict violation. | |
114 | ||
115 | C<*{"*a::b"}> automatically strips off the * if it is followed by an ASCII | |
116 | letter. That has been extended to all Unicode identifier characters. | |
117 | ||
118 | C<$é> is now subject to "Used only once" warnings. It used to be exempt, | |
119 | as it was treated as a punctuation variable. | |
120 | ||
121 | Also, single-character Unicode punctuation variables (like $‰) are now | |
122 | supported [perl #69032]. They are also supported with C<our> and C<my>, | |
123 | but that is a mistake that will be fixed before 5.16. | |
124 | ||
125 | =head2 Support for Embedded Nulls | |
126 | ||
127 | Some parts of Perl did not work correctly with nulls (C<chr 0>) embedded in | |
128 | strings. That meant that, for instance, C<< $m = "a\0b"; foo->$m >> would | |
129 | call the "a" method, instead of the actual method name contained in $m. | |
130 | These parts of perl have been fixed to support nulls: | |
131 | ||
132 | =over | |
133 | ||
134 | =item * | |
135 | ||
136 | Method names | |
137 | ||
138 | =item * | |
139 | ||
140 | Typeglob names (including filehandle names) | |
141 | ||
142 | =item * | |
143 | ||
144 | Package names | |
145 | ||
146 | =item * | |
147 | ||
148 | Autoloading | |
149 | ||
150 | =item * | |
151 | ||
152 | Return value of C<ref()> | |
153 | ||
154 | =item * | |
155 | ||
156 | Package names returned by C<caller()> | |
157 | ||
158 | =item * | |
159 | ||
160 | Filehandle warnings | |
161 | ||
162 | =item * | |
163 | ||
164 | Typeglob elements (C<*foo{"THING\0stuff"}>) | |
165 | ||
166 | =item * | |
167 | ||
168 | Signal names | |
169 | ||
170 | =item * | |
171 | ||
172 | Various warnings and error messages that mention variable names or values, | |
173 | methods, etc. | |
174 | ||
175 | =back | |
176 | ||
177 | One side effect of these changes is that blessing into "\0" no longer | |
178 | causes C<ref()> to return false. | |
179 | ||
180 | =head2 Autoloaded sort Subroutines | |
181 | ||
182 | Custom sort subroutines can now be autoloaded [perl #30661]: | |
183 | ||
184 | sub AUTOLOAD { ... } | |
185 | @sorted = sort foo @list; # uses AUTOLOAD | |
186 | ||
187 | =head2 Improved typemaps for Some Builtin Types | |
188 | ||
189 | Most XS authors will be aware that there is a longstanding bug | |
190 | in the OUTPUT typemap for T_AVREF (C<AV*>), T_HVREF (C<HV*>), | |
191 | T_CVREF (C<CV*>), and T_SVREF (C<SVREF> or C<\$foo>) that requires | |
192 | manually decrementing the reference count of the return value | |
193 | instead of the typemap taking care of this. For | |
194 | backwards-compatibility, this cannot be changed in the default | |
195 | typemaps. But we now provide additional typemaps | |
196 | C<T_AVREF_REFCOUNT_FIXED>, etc. that do not exhibit this bug. | |
197 | Using them in your extension is as simple as having one line | |
198 | in your C<TYPEMAP> section: | |
199 | ||
200 | HV* T_HVREF_REFCOUNT_FIXED | |
201 | ||
202 | =head1 Performance Enhancements | |
203 | ||
204 | =over 4 | |
205 | ||
206 | =item * | |
207 | ||
208 | C<substr> no longer calculates a value to return when called in void | |
209 | context. | |
210 | ||
211 | =back | |
212 | ||
a14d7d4a RS |
213 | =head2 C<CORE::> works on all keywords |
214 | ||
215 | The C<CORE::> prefix can now be used on keywords enabled by | |
216 | L<feature.pm|feature>, even outside the scope of C<use feature>. Relevant | |
217 | documentation files L<CORE>, L<feature>, L<perlfunc>, L<perlsub>, and | |
218 | L<perlsyn> have been updated. | |
219 | ||
4bbade93 RS |
220 | Perl 5.15.2 introduced subroutines in the CORE namespace. Most of them |
221 | could only be called as barewords; i.e., they could be aliased at compile | |
222 | time and then inlined under new names. | |
223 | ||
224 | Almost all of these functions can now be called through references and via | |
225 | C<&foo()> syntax, bypassing the prototype. See L<CORE> for a list of the | |
226 | exceptions. | |
227 | ||
a14d7d4a RS |
228 | =head2 C<continue> no longer requires the "switch" feature |
229 | ||
230 | The C<continue> keyword has two meanings. It can introduce a C<continue> | |
231 | block after a loop, or it can exit the current C<when> block. Up till now, | |
232 | the latter meaning was only valid with the "switch" feature enabled, and | |
233 | was a syntax error otherwise. Since the main purpose of feature.pm is to | |
234 | avoid conflicts with user-defined subroutines, there is no reason for | |
235 | C<continue> to depend on it. | |
236 | ||
4bbade93 RS |
237 | =head2 New debugger commands |
238 | ||
239 | The debugger now has C<disable> and C<enable> commands for disabling | |
240 | existing breakpoints and reënabling them. See L<perldebug>. | |
241 | ||
a14d7d4a RS |
242 | =head2 C<$$> can be assigned to |
243 | ||
244 | C<$$> was made read-only in Perl 5.8.0. But only sometimes: C<local $$> | |
245 | would make it writable again. Some CPAN modules were using C<local $$> or | |
246 | XS code to bypass the read-only check, so there is no reason to keep C<$$> | |
247 | read-only. (This change also allowed a bug to be fixed while maintaining | |
248 | backward compatibility.) | |
249 | ||
250 | =head2 Features inside the debugger | |
251 | ||
252 | The current Perl's feature bundle is now enabled for commands entered in | |
253 | the interactive debugger. | |
254 | ||
255 | =head2 C<\N{...}> can now have Unicode loose name matching | |
256 | ||
257 | This is described in the C<charnames> item in | |
258 | L</Updated Modules and Pragmata> below. | |
259 | ||
260 | =head2 Breakpoints with file names | |
261 | ||
262 | The debugger's "b" command for setting breakpoints now allows a line number | |
263 | to be prefixed with a file name. See | |
264 | L<perldebug/"b [file]:[line] [condition]">. | |
30682cc3 | 265 | |
ccad93fd RS |
266 | =head2 C<splice()> doesn't warn when truncating |
267 | ||
268 | You can now limit the size of an array using C<splice(@a,MAX_LEN)> without | |
269 | worrying about warnings. | |
270 | ||
271 | =head2 The C<\$> prototype accepts any scalar lvalue | |
272 | ||
273 | The C<\$> and C<\[$]> subroutine prototypes now accept any scalar lvalue | |
274 | argument. Previously they only accepted scalars beginning with C<$> and | |
275 | hash and array elements. This change makes them consistent with the way | |
276 | the built-in C<read> and C<recv> functions (among others) parse their | |
277 | arguments. This means that one can override the built-in functions with | |
278 | custom subroutines that parse their arguments the same way. | |
279 | ||
280 | =head2 You can now C<study> more than one string | |
281 | ||
282 | The restriction that you can only have one C<study> active at a time has been | |
283 | removed. You can now usefully C<study> as many strings as you want (until you | |
284 | exhaust memory). | |
285 | ||
286 | =head2 The Unicode C<Script_Extensions> property is now supported. | |
287 | ||
288 | New in Unicode 6.0, this is an improved C<Script> property. Details | |
289 | are in L<perlunicode/Scripts>. | |
290 | ||
291 | =head2 DTrace probes for interpreter phase change | |
292 | ||
293 | The C<phase-change> probes will fire when the interpreter's phase | |
294 | changes, which tracks the C<${^GLOBAL_PHASE}> variable. C<arg0> is | |
295 | the new phase name; C<arg1> is the old one. This is useful mostly | |
296 | for limiting your instrumentation to one or more of: compile time, | |
297 | run time, destruct time. | |
298 | ||
299 | =head2 New Pad API | |
300 | ||
301 | Many new functions have been added to the API for manipulating lexical | |
302 | pads. See L<perlapi/Pad Data Structures> for more information. | |
30682cc3 | 303 | |
94c11dd4 RS |
304 | =head2 Subroutines in the CORE namespace |
305 | ||
306 | Many Perl keywords are now available as subroutines in the CORE namespace. | |
307 | Most of these cannot be called through references or via C<&foo> syntax | |
308 | yet, but must be called as barewords. In other words, you can now do | |
309 | this: | |
310 | ||
311 | BEGIN { *entangle = \&CORE::tie } | |
312 | entangle $variable, $package, @args; | |
313 | ||
314 | This currently works for overridable keywords other than C<dump> and the | |
315 | infix operators. Calling through references only works for functions that | |
316 | take no arguments (like C<wantarray>). | |
317 | ||
318 | Work is under way to allow more of these subroutines to be called through | |
319 | references. | |
320 | ||
321 | =head2 C<__FILE__()> Syntax | |
322 | ||
323 | The C<__FILE__>, C<__LINE__> and C<__PACKAGE__> tokens can now be written | |
324 | with an empty pair of parentheses after them. This makes them parse the | |
325 | same way as C<time>, C<fork> and other built-in functions. | |
326 | ||
30682cc3 RS |
327 | =head1 Security |
328 | ||
b325a3a2 RS |
329 | =head2 Privileges are now set correctly when assigning to C<$(> |
330 | ||
331 | A hypothetical bug (probably non-exploitable in practice) due to the | |
332 | incorrect setting of the effective group ID while setting C<$(> has been | |
333 | fixed. The bug would only have affected systems that have C<setresgid()> | |
334 | but not C<setregid()>, but no such systems are known of. | |
30682cc3 | 335 | |
4bbade93 RS |
336 | =head2 C<File::Glob::bsd_glob()> memory error with GLOB_ALTDIRFUNC (CVE-2011-2728). |
337 | ||
338 | Calling C<File::Glob::bsd_glob> with the unsupported flag | |
339 | GLOB_ALTDIRFUNC would cause an access violation / segfault. A Perl | |
340 | program that accepts a flags value from an external source could expose | |
341 | itself to denial of service or arbitrary code execution attacks. There | |
342 | are no known exploits in the wild. The problem has been corrected by | |
343 | explicitly disabling all unsupported flags and setting unused function | |
344 | pointers to null. Bug reported by Clément Lecigne. | |
30682cc3 RS |
345 | |
346 | =head1 Incompatible Changes | |
347 | ||
b325a3a2 RS |
348 | =head2 Certain deprecated Unicode properties are no longer supported by default |
349 | ||
350 | Perl should never have exposed certain Unicode properties that are used | |
351 | by Unicode internally and not meant to be publicly available. Use of | |
352 | these has generated deprecated warning messages since Perl 5.12. The | |
353 | removed properties are Other_Alphabetic, | |
354 | Other_Default_Ignorable_Code_Point, Other_Grapheme_Extend, | |
355 | Other_ID_Continue, Other_ID_Start, Other_Lowercase, Other_Math, and | |
356 | Other_Uppercase. | |
357 | ||
358 | Perl may be recompiled to include any or all of them; instructions are | |
359 | given in | |
360 | L<perluniprops/Unicode character properties that are NOT accepted by Perl>. | |
361 | ||
362 | =head2 Dereferencing IO thingies as typeglobs | |
363 | ||
364 | The C<*{...}> operator, when passed a reference to an IO thingy (as in | |
365 | C<*{*STDIN{IO}}>), creates a new typeglob containing just that IO object. | |
366 | ||
367 | Previously, it would stringify as an empty string, but some operators would | |
368 | treat it as undefined, producing an "uninitialized" warning. | |
369 | ||
370 | Having a typeglob appear as an empty string is a side effect of the | |
371 | implementation that has caused various bugs over the years. | |
372 | ||
373 | The solution was to make it stringify like a normal anonymous typeglob, | |
374 | like those produced by C<< open($foo->{bar}, ...) >> [perl #96326]. | |
375 | ||
376 | ||
4bbade93 RS |
377 | =head2 User-defined case changing operations. |
378 | ||
379 | This feature was deprecated in Perl 5.14, and has now been removed. | |
380 | The CPAN module L<Unicode::Casing> provides better functionality without | |
381 | the drawbacks that this feature had, as are detailed in the 5.14 | |
382 | documentation: | |
383 | L<http://perldoc.perl.org/5.14.0/perlunicode.html#User-Defined-Case-Mappings-%28for-serious-hackers-only%29> | |
384 | ||
385 | =head2 XSUBs are now 'static' | |
386 | ||
387 | XSUB C functions are now 'static', that is, they are not visible from | |
388 | outside the compilation unit. Users can use the new C<XS_EXTERNAL(name)> | |
389 | and C<XS_INTERNAL(name)> macros to pick the desired linking behaviour. | |
390 | The ordinary C<XS(name)> declaration for XSUBs will continue to declare | |
391 | non-'static' XSUBs for compatibility, but the XS compiler, | |
392 | C<ExtUtils::ParseXS> (C<xsubpp>) will emit 'static' XSUBs by default. | |
393 | C<ExtUtils::ParseXS>'s behaviour can be reconfigured from XS using the | |
394 | C<EXPORT_XSUB_SYMBOLS> keyword, see L<perlxs> for details. | |
395 | ||
396 | =head2 Borland compiler | |
397 | ||
398 | All support for the Borland compiler has been dropped. The code had not | |
399 | worked for a long time anyway. | |
400 | ||
401 | =head2 Weakening read-only references | |
402 | ||
403 | Weakening read-only references is no longer permitted. It should never | |
404 | hove worked anyway, and in some cases could result in crashes. | |
405 | ||
a14d7d4a RS |
406 | =head2 Tying scalars that hold typeglobs |
407 | ||
408 | Attempting to tie a scalar after a typeglob was assigned to it would | |
409 | instead tie the handle in the typeglob's IO slot. This meant that it was | |
410 | impossible to tie the scalar itself. Similar problems affected C<tied> and | |
411 | C<untie>: C<tied $scalar> would return false on a tied scalar if the last | |
412 | thing returned was a typeglob, and C<untie $scalar> on such a tied scalar | |
413 | would do nothing. | |
30682cc3 | 414 | |
a14d7d4a RS |
415 | We fixed this problem before Perl 5.14.0, but it caused problems with some |
416 | CPAN modules, so we put in a deprecation cycle instead. | |
30682cc3 | 417 | |
a14d7d4a RS |
418 | Now the deprecation has been removed and this bug has been fixed. So |
419 | C<tie $scalar> will always tie the scalar, not the handle it holds. To tie | |
420 | the handle, use C<tie *$scalar> (with an explicit asterisk). The same | |
421 | applies to C<tied *$scalar> and C<untie *$scalar>. | |
422 | ||
423 | =head2 IPC::Open3 no longer provides C<xfork()>, C<xclose_on_exec()> | |
424 | and C<xpipe_anon()> | |
425 | ||
426 | All three functions were private, undocumented and unexported. They do | |
427 | not appear to be used by any code on CPAN. Two have been inlined and one | |
428 | deleted entirely. | |
429 | ||
430 | =head2 C<$$> no longer caches PID | |
431 | ||
432 | Previously, if one embeds Perl or uses XS and calls fork(3) from C, Perls | |
433 | notion of C<$$> could go out of sync with what getpid() returns. By always | |
434 | fetching the value of C<$$> via getpid(), this potential bug is eliminated. | |
435 | Code that depends on the caching behavior will break. As described in | |
436 | L</Core Enhancements>, C<$$> is now writable, but it will be reset during a | |
437 | fork. | |
30682cc3 RS |
438 | |
439 | =head1 Deprecations | |
440 | ||
b325a3a2 | 441 | =head2 Don't read the Unicode data base files in F<lib/unicore> |
30682cc3 | 442 | |
b325a3a2 RS |
443 | It is now deprecated to directly read the Unicode data base files. |
444 | These are stored in the F<lib/unicore> directory. Instead, you should | |
445 | use the new functions in L<Unicode::UCD>. These provide a stable API, | |
446 | and give complete information. (This API is, however, subject to change | |
447 | somewhat during the 5.15 development cycle, as we gain experience and | |
448 | get feedback from using it.) | |
449 | ||
450 | Perl may at some point in the future change or remove the files. The | |
451 | file most likely for applications to have used is F<lib/unicore/ToDigit.pl>. | |
452 | L<Unicode::UCD/prop_invmap()> can be used to get at its data instead. | |
30682cc3 RS |
453 | |
454 | =head1 Future Deprecations | |
455 | ||
456 | This section serves as a notice of feature that are I<likely> to be | |
457 | L<deprecated|perlpolicy/deprecated> in the next release of perl (5.18.0). If | |
458 | your code depends on these features, you should contact the Perl 5 Porters via | |
459 | the L<mailing list|http://lists.perl.org/list/perl5-porters.html> or L<perlbug> | |
460 | to explain your use case and inform the deprecation process. | |
461 | ||
462 | =head1 Performance Enhancements | |
463 | ||
ccad93fd | 464 | =over 4 |
30682cc3 | 465 | |
ccad93fd | 466 | =item * |
30682cc3 | 467 | |
b325a3a2 RS |
468 | Due to changes in L<File::Glob>, Perl's C<glob> function and its |
469 | C<< <...> >> equivalent are now much faster. The splitting of the pattern | |
470 | into words has been rewritten in C, resulting in speed-ups of 20% in some | |
471 | cases. | |
472 | ||
473 | This does not affect VMS, as it does not use File::Glob. | |
474 | ||
475 | =item * | |
476 | ||
ccad93fd RS |
477 | The short-circuiting operators C<&&>, C<||>, and C<//>, when chained |
478 | (such as C<$a || $b || $c>), are now considerably faster to short-circuit, | |
479 | due to reduced optree traversal. | |
30682cc3 RS |
480 | |
481 | =item * | |
482 | ||
ccad93fd RS |
483 | The implementation of C<s///r> makes one fewer copy of the scalar's value. |
484 | ||
485 | =item * | |
486 | ||
487 | If a studied scalar is C<split> with a regex, the engine will now take | |
488 | advantage of the C<study> data. | |
489 | ||
490 | =item * | |
491 | ||
492 | C<study> now uses considerably less memory for shorter strings. Strings shorter | |
493 | than 65535 characters use roughly half the memory than previously, strings | |
494 | shorter than 255 characters use roughly one quarter of the memory. | |
495 | ||
496 | =item * | |
497 | ||
498 | Recursive calls to lvalue subroutines in lvalue scalar context use less | |
499 | memory. | |
30682cc3 RS |
500 | |
501 | =back | |
502 | ||
503 | =head1 Modules and Pragmata | |
504 | ||
505 | XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/> | |
506 | go here. If Module::CoreList is updated, generate an initial draft of the | |
507 | following sections using F<Porting/corelist-perldelta.pl>, which prints stub | |
508 | entries to STDOUT. Results can be pasted in place of the '=head2' entries | |
509 | below. A paragraph summary for important changes should then be added by hand. | |
510 | In an ideal world, dual-life modules would have a F<Changes> file that could be | |
511 | cribbed. | |
512 | ||
513 | [ Within each section, list entries as a =item entry ] | |
514 | ||
515 | =head2 New Modules and Pragmata | |
516 | ||
517 | =over 4 | |
518 | ||
519 | =item * | |
520 | ||
b325a3a2 | 521 | L<arybase> -- this new module implements the C<$[> variable. |
30682cc3 RS |
522 | |
523 | =back | |
524 | ||
525 | =head2 Updated Modules and Pragmata | |
526 | ||
527 | =over 4 | |
528 | ||
529 | =item * | |
530 | ||
531 | L<XXX> has been upgraded from version 0.69 to version 0.70. | |
532 | ||
533 | =back | |
534 | ||
535 | =head2 Removed Modules and Pragmata | |
536 | ||
a14d7d4a RS |
537 | As promised in Perl 5.14.0's release notes, the following modules have |
538 | been removed from the core distribution, and if needed should be installed | |
539 | from CPAN instead. | |
540 | ||
541 | =over | |
30682cc3 RS |
542 | |
543 | =item * | |
544 | ||
a14d7d4a RS |
545 | C<Devel::DProf> has been removed from the Perl core. Prior version was 20110228.00. |
546 | ||
547 | =item * | |
548 | ||
549 | C<Shell> has been removed from the Perl core. Prior version was 0.72_01. | |
30682cc3 RS |
550 | |
551 | =back | |
552 | ||
553 | =head1 Documentation | |
554 | ||
30682cc3 RS |
555 | =head2 New Documentation |
556 | ||
4bbade93 RS |
557 | =head3 L<perlootut> |
558 | ||
559 | This a new OO tutorial. It focuses on basic OO concepts, and then recommends | |
560 | that readers choose an OO framework from CPAN. | |
561 | ||
ccad93fd | 562 | =head3 L<perldtrace> |
30682cc3 | 563 | |
ccad93fd RS |
564 | L<perldtrace> describes Perl's DTrace support, listing the provided probes |
565 | and gives examples of their use. | |
30682cc3 | 566 | |
94c11dd4 RS |
567 | =head3 L<perlexperiment> |
568 | ||
569 | This document is intended to provide a list of experimental features in | |
570 | Perl. It is still a work in progress. | |
571 | ||
30682cc3 RS |
572 | =head2 Changes to Existing Documentation |
573 | ||
12477442 RS |
574 | =head3 L<perlfunc>, L<open> |
575 | ||
576 | =over 4 | |
577 | ||
578 | =item * | |
579 | ||
580 | As an accident of history, C<open $fh, "<:", ...> applies the default | |
581 | layers for the platform (C<:raw> on Unix, C<:crlf> on Windows), ignoring | |
582 | whatever is declared by L<open.pm|open>. This seems such a useful feature | |
583 | it has been documented in L<perlfunc|perlfunc/open> and L<open>. | |
584 | ||
585 | =back | |
586 | ||
587 | =head3 L<perlapi> | |
588 | ||
589 | =over 4 | |
590 | ||
591 | =item * | |
592 | ||
593 | The HV API has long accepted negative lengths to indicate that the key is | |
594 | in UTF8. Now this is documented. | |
595 | ||
596 | =item * | |
597 | ||
598 | The C<boolSV()> macro is now documented. | |
599 | ||
600 | =back | |
601 | ||
602 | =head3 L<perlguts> | |
603 | ||
604 | =over 4 | |
605 | ||
606 | =item * | |
607 | ||
608 | A new section, L<Autoloading with XSUBs|perlguts/Autoloading with XSUBs>, | |
609 | has been added, which explains the two APIs for accessing the name of the | |
610 | autoloaded sub. | |
611 | ||
612 | =back | |
613 | ||
4bbade93 RS |
614 | =head3 L<perlobj> |
615 | ||
616 | =over 4 | |
617 | ||
618 | =item * | |
619 | ||
620 | This document has been rewritten from scratch, and its coverage of various OO | |
621 | concepts has been expanded. | |
622 | ||
623 | =back | |
624 | ||
625 | =head3 L<perlpragma> | |
626 | ||
627 | =over 4 | |
628 | ||
629 | =item * | |
630 | ||
631 | There is now a standard convention for naming keys in the C<%^H>, | |
632 | documented under L<Key naming|perlpragma/Key naming>. | |
633 | ||
634 | =back | |
635 | ||
ccad93fd | 636 | =head3 L<perlguts> |
30682cc3 | 637 | |
ccad93fd RS |
638 | =over |
639 | ||
640 | =item * | |
641 | ||
642 | Some of the function descriptions in L<perlguts> were confusing, as it was | |
643 | not clear whether they referred to the function above or below the | |
644 | description. This has been clarified [perl #91790]. | |
645 | ||
646 | =back | |
647 | ||
648 | =head3 L<perllol> | |
649 | ||
650 | =over | |
651 | ||
652 | =item * | |
653 | ||
654 | L<perllol> has been expanded with examples using the new C<push $scalar> | |
655 | syntax introduced in Perl 5.14.0 (5.14.1). | |
656 | ||
657 | =back | |
658 | ||
659 | =head3 L<perlmod> | |
660 | ||
661 | =over | |
662 | ||
663 | =item * | |
664 | ||
665 | L<perlmod> now states explicitly that some types of explicit symbol table | |
666 | manipulation are not supported. This codifies what was effectively already | |
667 | the case [perl #78074]. | |
668 | ||
669 | =back | |
670 | ||
671 | =head3 L<perlop> | |
672 | ||
673 | =over 4 | |
674 | ||
675 | =item * | |
676 | ||
677 | The explanation of bitwise operators has been expanded to explain how they | |
678 | work on Unicode strings (5.14.1). | |
679 | ||
680 | =item * | |
681 | ||
682 | The section on the triple-dot or yada-yada operator has been moved up, as | |
683 | it used to separate two closely related sections about the comma operator | |
684 | (5.14.1). | |
685 | ||
686 | =item * | |
687 | ||
688 | More examples for C<m//g> have been added (5.14.1). | |
689 | ||
690 | =item * | |
691 | ||
692 | The C<<< <<\FOO >>> here-doc syntax has been documented (5.14.1). | |
693 | ||
694 | =back | |
695 | ||
696 | =head3 L<perlpodstyle> | |
697 | ||
698 | =over 4 | |
699 | ||
700 | =item * | |
701 | ||
702 | The tips on which formatting codes to use have been corrected and greatly | |
703 | expanded. | |
704 | ||
705 | =item * | |
706 | ||
707 | There are now a couple of example one-liners for previewing POD files after | |
708 | they have been edited. | |
709 | ||
710 | =back | |
711 | ||
712 | =head3 L<perlsub> | |
713 | ||
714 | =over | |
715 | ||
716 | =item * | |
717 | ||
718 | The L<perlsub/"Lvalue subroutines"> section has been amended to reflect | |
719 | changes and bug fixes introduced in Perl 5.15.0. | |
720 | ||
94c11dd4 RS |
721 | =item * |
722 | ||
723 | The ($;) prototype syntax, which has existed for rather a long time, is now | |
724 | documented in L<perlsub>. It allows a unary function to have the same | |
725 | precedence as a list operator. | |
726 | ||
ccad93fd RS |
727 | =back |
728 | ||
729 | =head3 L<perlre> | |
730 | ||
731 | =over | |
732 | ||
733 | =item * | |
734 | ||
735 | The C<(*COMMIT)> directive is now listed in the right section | |
736 | (L<Verbs without an argument|perlre/Verbs without an argument>). | |
737 | ||
738 | =back | |
739 | ||
740 | =head3 L<perlrun> | |
741 | ||
742 | =over | |
743 | ||
744 | =item * | |
745 | ||
746 | L<perlrun> has undergone a significant clean-up. Most notably, the | |
747 | B<-0x...> form of the B<-0> flag has been clarified, and the final section | |
748 | on environment variables has been corrected and expanded (5.14.1). | |
749 | ||
750 | =back | |
751 | ||
752 | =head3 L<perltie> | |
753 | ||
754 | =over | |
755 | ||
756 | =item * | |
757 | ||
758 | Documented the required syntax for tying handles. | |
759 | ||
760 | =back | |
761 | ||
762 | =head3 L<perlvar> | |
763 | ||
764 | =over | |
765 | ||
766 | =item * | |
767 | ||
768 | The documentation for L<$!|perlvar/$!> has been corrected and clarified. | |
769 | It used to state that $! could be C<undef>, which is not the case. It was | |
770 | also unclear as to whether system calls set C's C<errno> or Perl's C<$!> | |
771 | [perl #91614]. | |
772 | ||
773 | =item * | |
774 | ||
775 | Documentation for L<$$|perlvar/$$> has been amended with additional | |
776 | cautions regarding changing the process ID. | |
777 | ||
778 | =back | |
30682cc3 RS |
779 | |
780 | =over 4 | |
781 | ||
782 | =item * | |
783 | ||
ccad93fd RS |
784 | L<perlxs> was extended with documentation on inline typemaps. |
785 | ||
786 | =item * | |
787 | ||
788 | L<perlref> has a new L<Circular References|perlref/Circular References> | |
789 | section explaining how circularities may not be freed and how to solve that | |
790 | with weak references. | |
791 | ||
792 | =item * | |
793 | ||
794 | The documentation for smart match in L<perlsyn> has been corrected for the | |
795 | case of C<undef> on the left-hand side. The list of different smart match | |
796 | behaviours had an item in the wrong place. | |
797 | ||
798 | =item * | |
799 | ||
800 | Parts of L<perlapi> were clarified, and Perl equivalents of some C | |
801 | functions have been added as an additional mode of exposition. | |
802 | ||
803 | =item * | |
804 | ||
805 | A few parts of L<perlre> and L<perlrecharclass> were clarified. | |
30682cc3 RS |
806 | |
807 | =back | |
808 | ||
4bbade93 RS |
809 | =head2 Removed Documentation |
810 | ||
811 | =head3 Old OO Documentation | |
812 | ||
813 | All the old OO tutorials, perltoot, perltooc, and perlboot, have been | |
814 | removed. The perlbot (bag of object tricks) document has been removed as well. | |
815 | ||
816 | =head3 Development Deltas | |
817 | ||
818 | The old perldelta files for development cycles prior to 5.15 have been | |
819 | removed. | |
820 | ||
30682cc3 RS |
821 | =head1 Diagnostics |
822 | ||
823 | The following additions or changes have been made to diagnostic output, | |
824 | including warnings and fatal error messages. For the complete list of | |
825 | diagnostic messages, see L<perldiag>. | |
826 | ||
827 | XXX New or changed warnings emitted by the core's C<C> code go here. Also | |
828 | include any changes in L<perldiag> that reconcile it to the C<C> code. | |
829 | ||
830 | [ Within each section, list entries as a =item entry that links to perldiag, | |
831 | e.g. | |
832 | ||
833 | =item * | |
834 | ||
835 | L<Invalid version object|perldiag/"Invalid version object"> | |
836 | ] | |
837 | ||
838 | =head2 New Diagnostics | |
839 | ||
840 | XXX Newly added diagnostic messages go here | |
841 | ||
842 | =head3 New Errors | |
843 | ||
844 | =over 4 | |
845 | ||
846 | =item * | |
847 | ||
b325a3a2 RS |
848 | L<Source filters apply only to byte streams|perldiag/"Source filters apply only to byte streams"> |
849 | ||
850 | This new error occurs when you try to activate a source filter (usually by | |
851 | loading a source filter module) within a string passed to C<eval> under the | |
852 | C<unicode_eval> feature. | |
853 | ||
854 | =item * | |
855 | ||
856 | L<That use of $[ is unsupported|perldiag/"That use of $[ is unsupported"> | |
857 | ||
858 | This previously removed error has been restored with the re-implementation | |
859 | of C<$[> as a module. | |
860 | ||
861 | =item * | |
862 | ||
94c11dd4 RS |
863 | L<&CORE::%s cannot be called directly|perldiag/"&CORE::%s cannot be called directly"> |
864 | ||
865 | (F) You tried to call a subroutine in the C<CORE::> namespace | |
866 | with C<&foo> syntax or through a reference. The subroutines | |
867 | in this package cannot yet be called that way, but must be | |
868 | called as barewords. Something like this will work: | |
869 | ||
870 | BEGIN { *shove = \&CORE::push; } | |
871 | shove @array, 1,2,3; # pushes on to @array | |
30682cc3 RS |
872 | |
873 | =back | |
874 | ||
875 | =head3 New Warnings | |
876 | ||
877 | =over 4 | |
878 | ||
b325a3a2 RS |
879 | =item * |
880 | ||
881 | L<Useless assignment to a temporary|perldiag/"Useless assignment to a temporary"> | |
30682cc3 | 882 | |
a14d7d4a RS |
883 | Assigning to a temporary returned from an XS lvalue subroutine now produces a |
884 | warning [perl #31946]. | |
885 | ||
b325a3a2 RS |
886 | =item * |
887 | ||
888 | L<length() used on %s|perldiag/length() used on %s> | |
889 | ||
890 | This new warning occurs when C<length> is used on an array or hash, instead | |
891 | of C<scalar(@array)> or C<scalar(keys %hash)>. | |
892 | ||
893 | =item * | |
894 | ||
895 | L<$[ used in %s (did you mean $] ?)|perldiag/"$[ used in %s (did you mean $] ?)"> | |
896 | ||
897 | This new warning exists to catch the mistaken use of C<$[> in version | |
898 | checks. C<$]>, not C<$[>, contains the version number. C<$[> in a numeric | |
899 | comparison is almost always wrong. | |
900 | ||
901 | =item * | |
902 | ||
903 | L<Use of assignment to $[ is deprecated|perldiag/"Use of assignment to $[ is deprecated"> | |
904 | ||
905 | This previously removed warning has been restored with the re-implementation | |
906 | of C<$[> as a module. | |
907 | ||
a14d7d4a | 908 | =back |
30682cc3 | 909 | |
30682cc3 RS |
910 | =head2 Changes to Existing Diagnostics |
911 | ||
ccad93fd RS |
912 | =over 4 |
913 | ||
914 | =item * | |
915 | ||
b325a3a2 RS |
916 | The uninitialized warning for C<y///r> when C<$_> is implicit and undefined |
917 | now mentions the variable name, just like the non-/r variation of the | |
918 | operator. | |
919 | ||
920 | =item * | |
921 | ||
922 | The "Applying pattern match..." or similar warning produced when an array | |
923 | or hash is on the left-hand side of the C<=~> operator now mentions the | |
924 | name of the variable. | |
925 | ||
926 | =item * | |
927 | ||
ccad93fd RS |
928 | The L<Invalid version format|perldiag/"Invalid version format (%s)"> |
929 | error message now says "negative version number" within the parentheses, | |
930 | rather than "non-numeric data", for negative numbers. | |
931 | ||
932 | =item * | |
933 | ||
934 | The two warnings | |
935 | L<Possible attempt to put comments in qw() list|perldiag/"Possible attempt to put comments in qw() list"> | |
936 | and | |
937 | L<Possible attempt to separate words with commas|perldiag/"Possible attempt to separate words with commas"> | |
938 | are no longer mutually exclusive: the same C<qw> construct may produce | |
939 | both. | |
940 | ||
941 | =item * | |
942 | ||
12477442 RS |
943 | The message, |
944 | "Code point 0x%X is not Unicode, no properties match it; all inverse | |
945 | prop erties do" has been changed to "Code point 0x%X is not Unicode, all | |
946 | \p{} matches fail; all \P{} matches succeed" | |
947 | ||
948 | =item * | |
949 | ||
ccad93fd RS |
950 | Warnings that mention the names of lexical (C<my>) variables with Unicode |
951 | characters in them now respect the presence or absence of the C<:utf8> | |
952 | layer on the output handle, instead of outputting UTF8 regardless. Also, | |
953 | the correct names are included in the strings passed to C<$SIG{__WARN__}> | |
954 | handlers, rather than the raw UTF8 bytes. | |
955 | ||
956 | =back | |
30682cc3 RS |
957 | |
958 | =over 4 | |
959 | ||
960 | =item * | |
961 | ||
962 | XXX Describe change here | |
963 | ||
964 | =back | |
965 | ||
966 | =head1 Utility Changes | |
967 | ||
968 | XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go | |
969 | here. Most of these are built within the directories F<utils> and F<x2p>. | |
970 | ||
971 | [ List utility changes as a =head3 entry for each utility and =item | |
972 | entries for each change | |
973 | Use L<XXX> with program names to get proper documentation linking. ] | |
974 | ||
4bbade93 | 975 | =head3 L<h2ph> |
30682cc3 RS |
976 | |
977 | =over 4 | |
978 | ||
979 | =item * | |
980 | ||
4bbade93 RS |
981 | L<h2ph> used to generate code of the form |
982 | ||
983 | unless(defined(&FOO)) { | |
984 | sub FOO () {42;} | |
985 | } | |
986 | ||
987 | But the subroutine is a compile-time declaration, and is hence unaffected | |
988 | by the condition. It has now been corrected to emit a string C<eval> | |
989 | around the subroutine [perl #99368]. | |
30682cc3 RS |
990 | |
991 | =back | |
992 | ||
993 | =head1 Configuration and Compilation | |
994 | ||
a14d7d4a | 995 | =over 4 |
30682cc3 | 996 | |
a14d7d4a | 997 | =item * |
30682cc3 | 998 | |
a14d7d4a RS |
999 | F<regexp.h> has been modified for compatibility with GCC's B<-Werror> |
1000 | option, as used by some projects that include perl's header files (5.14.1). | |
30682cc3 RS |
1001 | |
1002 | =item * | |
1003 | ||
a14d7d4a RS |
1004 | C<USE_LOCALE{,_COLLATE,_CTYPE,_NUMERIC}> have been added the output of perl -V |
1005 | as they have affect the behaviour of the interpreter binary (albeit only | |
1006 | in a small area). | |
1007 | ||
1008 | =item * | |
1009 | ||
1010 | The code and tests for L<IPC::Open2> have been moved from F<ext/IPC-Open2> | |
1011 | into F<ext/IPC-Open3>, as C<IPC::Open2::open2()> is implemented as a thin | |
1012 | wrapper around C<IPC::Open3::_open3()>, and hence is very tightly coupled to | |
1013 | it. | |
1014 | ||
1015 | =item * | |
1016 | ||
1017 | The magic types and magic vtables are now generated from data in a new script | |
1018 | F<regen/mg_vtable.pl>, instead of being maintained by hand. As different EBCDIC | |
1019 | variants can't agree on the code point for '~', the character to code point | |
1020 | conversion is done at build time by F<generate_uudmap> to a new generated header | |
1021 | F<mg_data.h>. C<PL_vtbl_bm> and C<PL_vtbl_fm> are now defined by the | |
1022 | pre-processor as C<PL_vtbl_regexp>, instead of being distinct C variables. | |
1023 | C<PL_vtbl_sig> has been removed. | |
1024 | ||
1025 | =item * | |
1026 | ||
1027 | Building with C<-DPERL_GLOBAL_STRUCT> works again. This configuration is not | |
1028 | generally used. | |
1029 | ||
1030 | =item * | |
1031 | ||
1032 | Perl configured with I<MAD> now correctly frees C<MADPROP> structures when | |
1033 | OPs are freed. C<MADPROP>s are now allocated with C<PerlMemShared_malloc()> | |
1034 | ||
1035 | =back | |
30682cc3 | 1036 | |
30682cc3 RS |
1037 | =head1 Testing |
1038 | ||
1039 | XXX Any significant changes to the testing of a freshly built perl should be | |
1040 | listed here. Changes which create B<new> files in F<t/> go here as do any | |
1041 | large changes to the testing harness (e.g. when parallel testing was added). | |
1042 | Changes to existing files in F<t/> aren't worth summarising, although the bugs | |
1043 | that they represent may be covered elsewhere. | |
1044 | ||
1045 | [ List each test improvement as a =item entry ] | |
1046 | ||
1047 | =over 4 | |
1048 | ||
1049 | =item * | |
1050 | ||
1051 | XXX | |
1052 | ||
1053 | =back | |
1054 | ||
1055 | =head1 Platform Support | |
1056 | ||
1057 | XXX Any changes to platform support should be listed in the sections below. | |
1058 | ||
1059 | [ Within the sections, list each platform as a =item entry with specific | |
1060 | changes as paragraphs below it. ] | |
1061 | ||
1062 | =head2 New Platforms | |
1063 | ||
1064 | XXX List any platforms that this version of perl compiles on, that previous | |
1065 | versions did not. These will either be enabled by new files in the F<hints/> | |
1066 | directories, or new subdirectories and F<README> files at the top level of the | |
1067 | source tree. | |
1068 | ||
1069 | =over 4 | |
1070 | ||
1071 | =item XXX-some-platform | |
1072 | ||
1073 | XXX | |
1074 | ||
1075 | =back | |
1076 | ||
1077 | =head2 Discontinued Platforms | |
1078 | ||
1079 | XXX List any platforms that this version of perl no longer compiles on. | |
1080 | ||
1081 | =over 4 | |
1082 | ||
1083 | =item XXX-some-platform | |
1084 | ||
1085 | XXX | |
1086 | ||
1087 | =back | |
1088 | ||
1089 | =head2 Platform-Specific Notes | |
1090 | ||
30682cc3 RS |
1091 | =over 4 |
1092 | ||
4bbade93 | 1093 | =item VMS |
30682cc3 | 1094 | |
4bbade93 RS |
1095 | Remove unnecessary includes, fix miscellaneous compiler warnings and |
1096 | close some unclosed comments on F<vms/vms.c>. | |
1097 | ||
1098 | Remove sockadapt layer from the VMS build. | |
30682cc3 | 1099 | |
b325a3a2 RS |
1100 | =item GNU/Hurd |
1101 | ||
1102 | Numerous build and test failures on GNU/Hurd have been resolved with hints | |
1103 | for building DBM modules, detection of the library search path, and enabling | |
1104 | of large file support. | |
1105 | ||
1106 | =item OpenVOS | |
1107 | ||
1108 | Perl is now built with dynamic linking on OpenVOS, the minimum supported | |
1109 | version of which is now Release 17.1.0. | |
1110 | ||
1111 | =item SunOS | |
1112 | ||
1113 | The CC workshop C++ compiler is now detected and used on systems that ship | |
1114 | without cc. | |
1115 | ||
30682cc3 RS |
1116 | =back |
1117 | ||
1118 | =head1 Internal Changes | |
1119 | ||
4bbade93 | 1120 | =over 4 |
30682cc3 | 1121 | |
4bbade93 | 1122 | =item * |
30682cc3 | 1123 | |
4bbade93 RS |
1124 | The C<is_gv_magical_sv> function has been eliminated and merged with |
1125 | C<gv_fetchpvn_flags>. It used to be called to determine whether a GV | |
1126 | should be autovivified in rvalue context. Now it has been replaced with a | |
1127 | new C<GV_ADDMG> flag (not part of the API). | |
30682cc3 RS |
1128 | |
1129 | =item * | |
1130 | ||
4bbade93 RS |
1131 | Padlists are now marked C<AvREAL>; i.e., reference-counted. They have |
1132 | always been reference-counted, but were not marked real, because F<pad.c> | |
1133 | did its own clean-up, instead of using the usual clean-up code in F<sv.c>. | |
1134 | That caused problems in thread cloning, so now the C<AvREAL> flag is on, | |
1135 | but is turned off in F<pad.c> right before the padlist is freed (after | |
1136 | F<pad.c> has done its custom freeing of the pads). | |
1137 | ||
1138 | =item * | |
1139 | ||
1140 | All the C files that make up the Perl core have been converted to UTF-8. | |
30682cc3 RS |
1141 | |
1142 | =back | |
1143 | ||
1144 | =head1 Selected Bug Fixes | |
1145 | ||
a14d7d4a | 1146 | =head2 Regular expressions and character classes |
30682cc3 RS |
1147 | |
1148 | =over 4 | |
1149 | ||
1150 | =item * | |
1151 | ||
a14d7d4a RS |
1152 | The new (in 5.14.0) regular expression modifier C</a> when repeated like |
1153 | C</aa> forbids the characters outside the ASCII range that match | |
1154 | characters inside that range from matching under C</i>. This did not | |
1155 | work under some circumstances, all involving alternation, such as: | |
1156 | ||
1157 | "\N{KELVIN SIGN}" =~ /k|foo/iaa; | |
1158 | ||
1159 | succeeded inappropriately. This is now fixed. | |
1160 | ||
1161 | =item * | |
1162 | ||
1163 | 5.14.0 introduced some memory leaks in regular expression character | |
1164 | classes such as C<[\w\s]>, which have now been fixed (5.14.1) | |
1165 | ||
1166 | =item * | |
1167 | ||
1168 | An edge case in regular expression matching could potentially loop. | |
1169 | This happened only under C</i> in bracketed character classes that have | |
1170 | characters with multi-character folds, and the target string to match | |
1171 | against includes the first portion of the fold, followed by another | |
1172 | character that has a multi-character fold that begins with the remaining | |
1173 | portion of the fold, plus some more. | |
1174 | ||
1175 | "s\N{U+DF}" =~ /[\x{DF}foo]/i | |
1176 | ||
1177 | is one such case. C<\xDF> folds to C<"ss">. (5.14.1) | |
1178 | ||
1179 | =item * | |
1180 | ||
1181 | A few characters in regular expression pattern matches did not | |
1182 | match correctly in some circumstances, all involving C</i>. The | |
1183 | affected characters are: | |
1184 | COMBINING GREEK YPOGEGRAMMENI, | |
1185 | GREEK CAPITAL LETTER IOTA, | |
1186 | GREEK CAPITAL LETTER UPSILON, | |
1187 | GREEK PROSGEGRAMMENI, | |
1188 | GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA, | |
1189 | GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS, | |
1190 | GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA, | |
1191 | GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS, | |
1192 | LATIN SMALL LETTER LONG S, | |
1193 | LATIN SMALL LIGATURE LONG S T, | |
1194 | and | |
1195 | LATIN SMALL LIGATURE ST. | |
1196 | ||
1197 | =item * | |
1198 | ||
1199 | Fixed memory leak regression in regular expression compilation | |
1200 | under threading | |
1201 | ||
1202 | =back | |
1203 | ||
1204 | =head2 Formats | |
1205 | ||
1206 | =over | |
1207 | ||
1208 | =item * | |
1209 | ||
1210 | A number of edge cases have been fixed with formats and C<formline>; | |
1211 | in particular, where the format itself is potentially variable (such as | |
1212 | with ties and overloading), and where the format and data differ in their | |
1213 | encoding. In both these cases, it used to possible for the output to be | |
1214 | corrupted [perl #91032]. | |
1215 | ||
1216 | =item * | |
1217 | ||
1218 | C<formline> no longer converts its argument into a string in-place. So | |
1219 | passing a reference to C<formline> no longer destroys the reference | |
1220 | [perl #79532]. | |
1221 | ||
1222 | =back | |
1223 | ||
1224 | =head2 Copy-on-write scalars | |
1225 | ||
1226 | Copy-on-write scalars were introduced in 5.8.0, but most Perl code | |
1227 | did not encounter them (they were used mostly internally). Perl | |
1228 | 5.10.0 extended them, such that assigning C<__PACKAGE__> or a | |
1229 | hash key to a scalar would make it copy-on-write. Several parts | |
1230 | of Perl were not updated to account for them, but have now been fixed. | |
1231 | ||
1232 | =over | |
1233 | ||
1234 | =item * | |
1235 | ||
1236 | C<utf8::decode> had a nasty bug that would modify copy-on-write scalars' | |
1237 | string buffers in place (i.e., skipping the copy). This could result in | |
1238 | hashes having two elements with the same key [perl #91834]. | |
1239 | ||
1240 | =item * | |
1241 | ||
1242 | Lvalue subroutines were not allowing COW scalars to be returned. This was | |
1243 | fixed for lvalue scalar context in Perl 5.12.3 and 5.14.0, but list context | |
1244 | was not fixed until this release. | |
1245 | ||
1246 | =item * | |
1247 | ||
1248 | Elements of restricted hashes (see the L<fields> pragma) containing | |
1249 | copy-on-write values couldn't be deleted, nor could such hashes be cleared | |
1250 | (C<%hash = ()>). | |
1251 | ||
1252 | =item * | |
1253 | ||
1254 | Localising a tied variable used to make it read-only if it contained a | |
1255 | copy-on-write string. | |
1256 | ||
1257 | =item * | |
1258 | ||
1259 | L<Storable>, L<Devel::Peek> and L<PerlIO::scalar> had similar problems. | |
1260 | See L</Updated Modules and Pragmata>, above. | |
1261 | ||
1262 | =back | |
1263 | ||
1264 | =head2 lvalue subroutines | |
1265 | ||
1266 | There have been various fixes to lvalue subroutines. | |
1267 | ||
1268 | =over | |
1269 | ||
1270 | =item * | |
1271 | ||
1272 | Explicit return now returns the actual argument passed to return, instead | |
1273 | of copying it [perl #72724] [perl #72706]. | |
1274 | ||
1275 | B<Note:> There are still some discrepancies between explicit and implicit | |
1276 | return, which will hopefully be resolved soon. So the exact behaviour is | |
1277 | not set in stone yet. | |
1278 | ||
1279 | =item * | |
1280 | ||
1281 | Lvalue subroutines used to enforce lvalue syntax (i.e., whatever can go on | |
1282 | the left-hand side of C<=>) for the last statement and the arguments to | |
1283 | return. Since lvalue subroutines are not always called in lvalue context, | |
1284 | this restriction has been lifted. | |
1285 | ||
1286 | =item * | |
1287 | ||
1288 | Lvalue subroutines are less restrictive as to what values can be returned. | |
1289 | It used to croak on values returned by C<shift> and C<delete> and from | |
1290 | other subroutines, but no longer does so [perl #71172]. | |
1291 | ||
1292 | =item * | |
1293 | ||
1294 | Empty lvalue subroutines (C<sub :lvalue {}>) used to return C<@_> in list | |
1295 | context. In fact, all subroutines used to, but regular subs were fixed in | |
1296 | Perl 5.8.2. Now lvalue subroutines have been likewise fixed. | |
1297 | ||
1298 | =item * | |
1299 | ||
1300 | Lvalue subroutines used to copy their return values in rvalue context. Not | |
1301 | only was this a waste of CPU cycles, but it also caused bugs. A C<($)> | |
1302 | prototype would cause an lvalue sub to copy its return value [perl #51408], | |
1303 | and C<while(lvalue_sub() =~ m/.../g) { ... }> would loop endlessly | |
1304 | [perl #78680]. | |
1305 | ||
1306 | =item * | |
1307 | ||
1308 | Autovivification now works on values returned from lvalue subroutines | |
1309 | [perl #7946]. | |
1310 | ||
1311 | =item * | |
1312 | ||
1313 | When called in pass-by-reference context (e.g., subroutine arguments or a list | |
1314 | passed to C<for>), an lvalue subroutine returning arrays or hashes used to bind | |
1315 | the arrays (or hashes) to scalar variables--something that is not supposed to | |
1316 | happen. This could result in "Bizarre copy of ARRAY" errors or C<print> | |
1317 | ignoring its arguments. It also made nonsensical code like C<@{\$_}> "work". | |
1318 | This was fixed in 5.14.0 if an array were the first thing returned from the | |
1319 | subroutine (but not for C<$scalar, @array> or hashes being returned). Now a | |
1320 | more general fix has been applied [perl #23790]. | |
1321 | ||
1322 | =item * | |
1323 | ||
1324 | When called in pass-by-reference context, lvalue subroutines used to copy | |
1325 | any read-only value that was returned. E.g., C< sub :lvalue { $] } > | |
1326 | would not return C<$]>, but a copy of it. | |
1327 | ||
1328 | =item * | |
1329 | ||
1330 | Assignment to C<keys> returned from an lvalue sub used not to work, but now | |
1331 | it does. | |
1332 | ||
1333 | =item * | |
1334 | ||
1335 | Applying the C<:lvalue> attribute to an XSUB or to an aliased subroutine | |
1336 | stub with C<< sub foo :lvalue; >> syntax stopped working in Perl 5.12. | |
1337 | This has been fixed. | |
1338 | ||
1339 | =back | |
1340 | ||
1341 | =head2 Fixes related to hashes | |
1342 | ||
1343 | =over | |
1344 | ||
1345 | =item * | |
1346 | ||
1347 | A bug has been fixed that would cause a "Use of freed value in iteration" | |
1348 | error if the next two hash elements that would be iterated over are | |
1349 | deleted [perl #85026]. (5.14.1) | |
1350 | ||
1351 | =item * | |
1352 | ||
1353 | Freeing deeply nested hashes no longer crashes [perl #44225]. | |
1354 | ||
1355 | =item * | |
1356 | ||
1357 | Deleting the current hash iterator (the hash element that would be returend | |
1358 | by the next call to C<each>) in void context used not to free it. The hash | |
1359 | would continue to reference it until the next iteration. This has been | |
1360 | fixed [perl #85026]. | |
1361 | ||
1362 | =back | |
1363 | ||
1364 | =head2 Other notable fixes | |
1365 | ||
1366 | =over | |
1367 | ||
1368 | =item * | |
1369 | ||
b325a3a2 RS |
1370 | Perl now holds an extra reference count on the package that code is |
1371 | currently compiling in. This means that the following code no longer crashes [perl #101486]: | |
1372 | ||
1373 | package Foo; | |
1374 | BEGIN {*Foo:: = *Bar::} | |
1375 | sub foo; | |
1376 | ||
1377 | =item * | |
1378 | ||
1379 | F<dumpvar.pl>, and consequently the C<x> command in the debugger, have been | |
1380 | fixed to handle objects blessed into classes whose names contain "=". The | |
1381 | contents of such objects used not to be dumped [perl #101814]. | |
1382 | ||
1383 | =item * | |
1384 | ||
1385 | The C<x> repetition operator no longer crashes on 64-bit builds with large | |
1386 | repeat counts [perl #94560]. | |
1387 | ||
1388 | =item * | |
1389 | ||
1390 | A fix to C<glob> under miniperl (used to configure modules when perl itself | |
1391 | is built) in Perl 5.15.3 stopped C<< <~> >> from returning the home | |
1392 | directory, because it cleared %ENV before calling csh. Now C<$ENV{HOME}> | |
1393 | is preserved. This fix probably does not affect anything. If | |
1394 | L<File::Glob> fails to load for some reason, Perl reverts to using csh. | |
1395 | So it would apply in that case. | |
1396 | ||
1397 | =item * | |
1398 | ||
1399 | On OSes other than VMS, Perl's C<glob> operator (and the C<< <...> >> form) | |
1400 | use L<File::Glob> underneath. L<File::Glob> splits the pattern into words, | |
1401 | before feeding each word to its C<bsd_glob> function. | |
1402 | ||
1403 | There were several inconsistencies in the way the split was done. Now | |
1404 | quotation marks (' and ") are always treated as shell-style word delimiters | |
1405 | (that allow whitespace as part of a word) and backslashes are always | |
1406 | preserved, unless they exist to escape quotation marks. Before, those | |
1407 | would only sometimes be the case, depending on whether the pattern | |
1408 | contained whitespace. Also, escaped whitespace at the end of the pattern | |
1409 | is no longer stripped [perl #40470]. | |
1410 | ||
1411 | =item * | |
1412 | ||
1413 | C<CORE::glob> now works as a way to call the default globbing function. It | |
1414 | used to respect overrides, despite the C<CORE::> prefix. | |
1415 | ||
1416 | =item * | |
1417 | ||
1418 | In 5.14, C</[[:lower:]]/i> and C</[[:upper:]]/i> no longer matched the | |
1419 | opposite case. This has been fixed [perl #101970]. | |
1420 | ||
1421 | =item * | |
1422 | ||
1423 | A regular expression match with an overloaded object on the right-hand side | |
1424 | would in some cases stringify the object too many times. | |
1425 | ||
1426 | =item * | |
1427 | ||
1428 | The C-level C<pregcomp> function could become confused as to whether the | |
1429 | pattern was in UTF8 if the pattern was an overloaded, tied, or otherwise | |
1430 | magical scalar [perl #101940]. | |
1431 | ||
1432 | =item * | |
1433 | ||
1434 | A regression has been fixed that was introduced in 5.14, in C</i> | |
1435 | regular expression matching, in which a match improperly fails if the | |
1436 | pattern is in UTF-8, the target string is not, and a Latin-1 character | |
1437 | precedes a character in the string that should match the pattern. [perl | |
1438 | #101710] | |
1439 | ||
1440 | =item * | |
1441 | ||
1442 | C<@{"..."} = reverse ...> started crashing in 5.15.3. This has been fixed. | |
1443 | ||
1444 | =item * | |
1445 | ||
1446 | C<ref> in a tainted expression started producing an "sv_upgrade" error in | |
1447 | 5.15.4. This has been fixed. | |
1448 | ||
1449 | =item * | |
1450 | ||
1451 | Weak references to lexical hashes going out of scope were not going stale | |
1452 | (becoming undefined), but continued to point to the hash. | |
1453 | ||
1454 | =item * | |
1455 | ||
1456 | Weak references to lexical variables going out of scope are now broken | |
1457 | before any magical methods (e.g., DESTROY on a tie object) are called. | |
1458 | This prevents such methods from modifying the variable that will be seen | |
1459 | the next time the scope is entered. | |
1460 | ||
1461 | =item * | |
1462 | ||
1463 | A C<keys> optimisation in Perl 5.12.0 to make it faster on empty hashes | |
1464 | caused C<each> not to reset the iterator if called after the last element | |
1465 | was deleted. This has been fixed. | |
1466 | ||
1467 | =item * | |
1468 | ||
1469 | The C<#line 42 foo> directive used not to update the arrays of lines used | |
1470 | by the debugger if it occurred in a string eval. This was partially fixed | |
1471 | in 5.14, but it only worked for a single C<#line 42 foo> in each eval. Now | |
1472 | it works for multiple. | |
1473 | ||
1474 | =item * | |
1475 | ||
1476 | String eval used not to localise C<%^H> when compiling its argument if it | |
1477 | was empty at the time the C<eval> call itself was compiled. This could | |
1478 | lead to scary side effects, like C<use re "/m"> enabling other flags that | |
1479 | the surrounding code was trying to enable for its caller [perl #68750]. | |
1480 | ||
1481 | =item * | |
1482 | ||
1483 | Creating a BEGIN block from XS code (via C<newXS> or C<newATTRSUB>) would, | |
1484 | on completion, make the hints of the current compiling code the current | |
1485 | hints. This could cause warnings to occur in a non-warning scope. | |
1486 | ||
1487 | =item * | |
1488 | ||
1489 | C<eval $string> and C<require> no longer localise hints (C<$^H> and C<%^H>) | |
1490 | at run time, but only during compilation of the $string or required file. | |
1491 | This makes C<BEGIN { $^H{foo}=7 }> equivalent to | |
1492 | C<BEGIN { eval '$^H{foo}=7' }> [perl #70151]. | |
1493 | ||
1494 | =item * | |
1495 | ||
1496 | When subroutine calls are intercepted by the debugger, the name of the | |
1497 | subroutine or a reference to it is stored in C<$DB::sub>, for the debugger | |
1498 | to access. In some cases (such as C<$foo = *bar; undef *bar; &$foo>) | |
1499 | C<$DB::sub> would be set to a name that could not be used to find the | |
1500 | subroutine, and so the debugger's attempt to call it would fail. Now the | |
1501 | check to see whether a reference is needed is more robust, so those | |
1502 | problems should not happen anymore [rt.cpan.org #69862]. | |
1503 | ||
1504 | =item * | |
1505 | ||
1506 | Localising a tied scalar that returns a typeglob no longer stops it from | |
1507 | being tied till the end of the scope. | |
1508 | ||
1509 | =item * | |
1510 | ||
1511 | When C<open> is called with three arguments, the third being a file handle | |
1512 | (as in C<< open $fh, ">&", $fh2 >>), if the third argument is tied or a | |
1513 | reference to a tied variable, FETCH is now called exactly once, instead of | |
1514 | 0, 2, or 3 times (all of which could occur in various circumstances). | |
1515 | ||
1516 | =item * | |
1517 | ||
1518 | C<sort> no longer ignores FETCH when passed a reference to a tied glob for | |
1519 | the comparison routine. | |
1520 | ||
1521 | =item * | |
1522 | ||
1523 | Warnings emitted by C<sort> when a custom comparison routine returns a | |
1524 | non-numeric value now show the line number of the C<sort> operator, rather | |
1525 | than the last line of the comparison routine. The warnings also occur now | |
1526 | only if warnings are enabled in the scope where C<sort> occurs. Previously | |
1527 | the warnings would occur if enabled in the comparison routine's scope. | |
1528 | ||
1529 | =item * | |
1530 | ||
1531 | C<Internals::SvREFCNT> now behaves consistently in 'get' and 'set' scenarios | |
1532 | [perl #103222] and also treats the reference count as unsigned. | |
1533 | ||
1534 | =item * | |
1535 | ||
1536 | Calling C<require> on an implicit C<$_> when C<*CORE::GLOBAL::require> has | |
1537 | been overridden does not segfault anymore, and C<$_> is now passed to the | |
1538 | overriding subroutine [perl #78260]. | |
1539 | ||
1540 | =item * | |
1541 | ||
12477442 RS |
1542 | In Perl 5.14.0, C<$tainted ~~ @array> stopped working properly. Sometimes |
1543 | it would erroneously fail (when C<$tainted> contained a string that occurs | |
1544 | in the array I<after> the first element) or erroneously succeed (when | |
1545 | C<undef> occurred after the first element) [perl #93590]. | |
1546 | ||
1547 | =item * | |
1548 | ||
1549 | Perl 5.15.0 introduced a minor regression, in that an object referenced by | |
1550 | a deleted hash element would be able to access the freed element from its | |
1551 | DESTROY method, causing panic errors [perl #99660]. | |
1552 | ||
1553 | =item * | |
1554 | ||
1555 | Functions in the CORE package can now be called as methods. That used to | |
1556 | work only when they had been called or referenced already. So | |
1557 | C<< "foo"->CORE::ucfirst >> returns Foo. | |
1558 | ||
1559 | =item * | |
1560 | ||
1561 | C<use> and C<require> are no longer affected by the I/O layers active in | |
1562 | the caller's scope (enabled by L<open.pm|open>) [perl #96008]. | |
1563 | ||
1564 | =item * | |
1565 | ||
1566 | Errors that occur when methods cannot be found during overloading now | |
1567 | mention the correct package name, as they did in 5.8.x, instead of | |
1568 | erroneously mentioning the "overload" package, as they have since 5.10.0. | |
1569 | ||
1570 | =item * | |
1571 | ||
1572 | Undefining C<%overload::> no longer causes a crash. | |
1573 | ||
1574 | =item * | |
1575 | ||
1576 | C<our $::é; $é> (which is invalid) no longer produces the "Compilation | |
1577 | error at lib/utf8_heavy.pl..." error message, which it started emitting in | |
1578 | 5.10.0 [perl #99984]. | |
1579 | ||
1580 | =item * | |
1581 | ||
1582 | A minor regression, introduced Perl 5.15.0, has been fixed in which some | |
1583 | regular expression Unicode property matches (C<\p{...}>) matched | |
1584 | non-Unicode code points. | |
1585 | ||
1586 | =item * | |
1587 | ||
1588 | In case-insensitive regular expression pattern matching, no longer on | |
1589 | UTF-8 encoded strings does the scan for the start of match only look at | |
1590 | the first possible position. This caused matches such as | |
1591 | C<"f\x{FB00}" =~ /ff/i> to fail. | |
1592 | ||
1593 | =item * | |
1594 | ||
1595 | On 64-bit systems, C<read()> now understands large string offsets beyond | |
1596 | the 32-bit range. | |
1597 | ||
1598 | =item * | |
1599 | ||
1600 | Errors that occur when processing subroutine attributes no longer cause the | |
1601 | subroutine's op tree to leak. | |
1602 | ||
1603 | =item * | |
1604 | ||
1605 | C<sort> now works once more with custom sort routines that are XSUBs. It | |
1606 | stopped working in 5.10.0. | |
1607 | ||
1608 | =item * | |
1609 | ||
1610 | C<sort> with a constant for a custom sort routine, although it produces | |
1611 | unsorted results, no longer crashes. It started crashing in 5.10.0. | |
1612 | ||
1613 | =item * | |
1614 | ||
1615 | Warnings produced when a custom sort routine returns a non-numeric value | |
1616 | now contain "in sort"; e.g., "Use of uninitialized value in sort". | |
1617 | ||
1618 | =item * | |
1619 | ||
1620 | C<< sort { $a <=> $b } >>, which is optimised internally, now produces | |
1621 | "uninitialized" warnings for NaNs (not-a-number values), since C<< <=> >> | |
1622 | returns C<undef> for those. This brings it in line with | |
1623 | S<C<< sort { 1; $a <=> $b } >>> and other more complex cases, which are not | |
1624 | optimised [perl #94390]. | |
1625 | ||
1626 | =item * | |
1627 | ||
1628 | C<..> and C<...> in list context now call FETCH only once on tied | |
1629 | arguments, instead of three or four times [perl #53554]. | |
1630 | ||
1631 | =item * | |
1632 | ||
1633 | C<..> and C<...> in list context now mention the name of the variable in | |
1634 | "uninitialized" warnings for string (as opposed to numeric) ranges. | |
1635 | ||
1636 | =item * | |
1637 | ||
a14d7d4a RS |
1638 | Passing the same constant subroutine to both C<index> and C<formline> no |
1639 | longer causes one or the other to fail [perl #89218]. (5.14.1) | |
1640 | ||
1641 | =item * | |
1642 | ||
1643 | List assignment to lexical variables declared with attributes in the same | |
1644 | statement (C<my ($x,@y) : blimp = (72,94)>) stopped working in Perl 5.8.0. | |
1645 | It has now been fixed. | |
1646 | ||
1647 | =item * | |
1648 | ||
1649 | Perl 5.10.0 introduced some faulty logic that made "U*" in the middle of | |
1650 | a pack template equivalent to "U0" if the input string was empty. This has | |
1651 | been fixed [perl #90160]. | |
1652 | ||
1653 | =item * | |
1654 | ||
1655 | Destructors on objects were not called during global destruction on objects | |
1656 | that were not referenced by any scalars. This could happen if an array | |
1657 | element were blessed (e.g., C<bless \$a[0]>) or if a closure referenced a | |
1658 | blessed variable (C<bless \my @a; sub foo { @a }>). | |
1659 | ||
1660 | Now there is an extra pass during global destruction to fire destructors on | |
1661 | any objects that might be left after the usual passes that check for | |
1662 | objects referenced by scalars [perl #36347]. | |
1663 | ||
1664 | This bug fix was added in Perl 5.13.9, but caused problems with some CPAN | |
1665 | modules that were relying on the bug. Since it was so close to Perl | |
1666 | 5.14.0, the fix was reverted in 5.13.10, to allow more time for the modules | |
1667 | to adapt. Hopefully they will be fixed soon (see L</Known Problems>, | |
1668 | below). | |
1669 | ||
1670 | =item * | |
1671 | ||
1672 | C<given> was not calling set-magic on the implicit lexical C<$_> that it | |
1673 | uses. This meant, for example, that C<pos> would be remembered from one | |
1674 | execution of the same C<given> block to the next, even if the input were a | |
1675 | different variable [perl #84526]. | |
1676 | ||
1677 | =item * | |
1678 | ||
1679 | The "R" command for restarting a debugger session has been fixed to work on | |
1680 | Windows, or any other system lacking a C<POSIX::_SC_OPEN_MAX> constant | |
1681 | [perl #87740]. | |
1682 | ||
1683 | =item * | |
1684 | ||
1685 | Fixed a case where it was possible that a freed buffer may have been read | |
1686 | from when parsing a here document [perl #90128]. (5.14.1) | |
1687 | ||
1688 | =item * | |
1689 | ||
1690 | The C<study> function could become confused if fed a string longer than | |
1691 | 2**31 characters. Now it simply skips such strings. | |
1692 | ||
1693 | =item * | |
1694 | ||
1695 | C<each(I<ARRAY>)> is now wrapped in C<defined(...)>, like C<each(I<HASH>)>, | |
1696 | inside a C<while> condition [perl #90888]. | |
1697 | ||
1698 | =item * | |
1699 | ||
1700 | In @INC filters (subroutines returned by subroutines in @INC), $_ used to | |
1701 | misbehave: If returned from a subroutine, it would not be copied, but the | |
1702 | variable itself would be returned; and freeing $_ (e.g., with C<undef *_>) | |
1703 | would cause perl to crash. This has been fixed [perl #91880]. | |
1704 | ||
1705 | =item * | |
1706 | ||
1707 | An ASCII single quote (') in a symbol name is meant to be equivalent to a | |
1708 | double colon (::) except at the end of the name. It was not equivalent if | |
1709 | followed by a null character, but now it is [perl #88138]. | |
1710 | ||
1711 | =item * | |
1712 | ||
1713 | The abbreviations for four C1 control characters | |
1714 | C<MW> | |
1715 | C<PM>, | |
1716 | C<RI>, | |
1717 | and | |
1718 | C<ST> | |
1719 | were previously unrecognized by C<\N{}>, | |
1720 | vianame(), and string_vianame(). | |
1721 | ||
1722 | =item * | |
1723 | ||
1724 | Some cases of threads crashing due to memory allocation during cloning have | |
1725 | been fixed [perl #90006]. | |
1726 | ||
1727 | =item * | |
1728 | ||
1729 | Attempting to C<goto> out of a tied handle method used to cause memory | |
1730 | corruption or crashes. Now it produces an error message instead | |
1731 | [perl #8611]. | |
1732 | ||
1733 | =item * | |
1734 | ||
1735 | Perl skips copying values returned from a subroutine if it thinks the value | |
1736 | is not in use elsewhere. Due to faulty logic, this would happen with the | |
1737 | result of C<delete>, C<shift> or C<splice>, even if the result was | |
1738 | referenced elsewhere. So C<< \sub { delete $_[0] }->($x) >> would return a | |
1739 | reference to C<$x>. This has been fixed [perl #91844]. | |
30682cc3 | 1740 | |
ccad93fd RS |
1741 | =item * |
1742 | ||
1743 | Applying the :lvalue attribute to subroutine that is already defined does | |
1744 | not work properly, as the attribute changes the way the sub is compiled. | |
1745 | Hence, Perl 5.12 began warning when an attempt is made to apply the | |
1746 | attribute to an already defined sub. In such cases, the attribute is | |
1747 | discarded. | |
1748 | ||
1749 | But the change in 5.12 missed the case where custom attributes are also | |
1750 | present: that case still silently and ineffectively applied the attribute. | |
1751 | That omission has now been corrected. C<sub foo :lvalue :Whatever> (when | |
1752 | C<foo> is already defined) now warns about the :lvalue attribute, and does | |
1753 | not apply it. | |
1754 | ||
1755 | L<attributes.pm|attributes> has likewise been updated to warn and not apply | |
1756 | the attribute. | |
1757 | ||
1758 | =item * | |
1759 | ||
1760 | The remaining discrepancies between explicit and implicit return from | |
1761 | lvalue subroutines have been resolved. They mainly involved which error | |
1762 | message to display when a read-only value is returned in lvalue context. | |
1763 | Also, returning a PADTMP (the result of most built-ins, like C<index>) in | |
1764 | lvalue context is now forbidden for explicit return, as it always has been | |
1765 | for implicit return. This is not a regression from 5.14, as all the cases | |
1766 | in which it could happen where previously syntax errors. | |
1767 | ||
1768 | =item * | |
1769 | ||
1770 | Explicitly returning a tied C<my> variable from an lvalue subroutine in | |
1771 | list lvalue context used to clear the variable before the assignment could | |
1772 | happen. This is something that was missed when explicit return was made to | |
1773 | work in 5.15.0. | |
1774 | ||
1775 | =item * | |
1776 | ||
1777 | A minor memory leak, introduced in 5.15.0, has been fixed. It would occur | |
1778 | when a hash is freed that has had its current iterator deleted | |
1779 | [perl #93454]. | |
1780 | ||
1781 | =item * | |
1782 | ||
1783 | The C<prototype> function no longer dies for the C<__FILE__>, C<__LINE__> | |
1784 | and C<__PACKAGE__> directives. It now returns an empty-string prototype | |
1785 | for them, because they are syntactically very similar to nullary functions | |
1786 | like C<time>. | |
1787 | ||
1788 | =item * | |
1789 | ||
1790 | C<prototype> now returns C<undef> for all overridable infix operators, | |
1791 | such as C<eq>, which are not callable in any way resembling functions. | |
1792 | It used to return incorrect prototypes for some and die for others | |
1793 | [perl #94984]. | |
1794 | ||
1795 | =item * | |
1796 | ||
1797 | A bug affecting lvalue context propagation through nested lvalue subroutine | |
1798 | calls has been fixed. Previously, returning a value in nested rvalue | |
1799 | context would be treated as lvalue context by the inner subroutine call, | |
1800 | resulting in some values (such as read-only values) being rejected. | |
1801 | ||
1802 | =item * | |
1803 | ||
1804 | Some core bugs affecting L<Hash::Util> have been fixed: locking a hash | |
1805 | element that is a glob copy no longer causes subsequent assignment to it to | |
1806 | corrupt the glob, and unlocking a hash element that holds a copy-on-write | |
1807 | scalar no longer causes modifications to that scalar to modify other | |
1808 | scalars that were sharing the same string buffer. | |
1809 | ||
1810 | =item * | |
1811 | ||
1812 | C<when> blocks are now capable of returning variables declared inside the | |
1813 | enclosing C<given> block [perl #93548]. | |
1814 | ||
1815 | =item * | |
1816 | ||
1817 | A problem with context propagation when a C<do> block is an argument to | |
1818 | C<return> has been fixed. It used to cause C<undef> to be returned in | |
1819 | some cases of a C<return> inside an C<if> block which itself is followed by | |
1820 | another C<return>. | |
1821 | ||
1822 | =item * | |
1823 | ||
1824 | Calling C<index> with a tainted constant no longer causes constants in | |
1825 | subsequently compiled code to become tainted [perl #64804]. | |
1826 | ||
1827 | =item * | |
1828 | ||
1829 | Use of lexical (C<my>) variables in code blocks embedded in regular | |
1830 | expressions will no longer result in memory corruption or crashes. | |
1831 | ||
1832 | Nevertheless, these code blocks are still experimental, as there are still | |
1833 | problems with the wrong variables being closed over (in loops for instance) | |
1834 | and with abnormal exiting (e.g., C<die>) causing memory corruption. | |
1835 | ||
1836 | =item * | |
1837 | ||
1838 | The C<SvIsCOW> C macro now returns false for read-only copies of typeglobs, | |
1839 | such as those created by: | |
1840 | ||
1841 | $hash{elem} = *foo; | |
1842 | Hash::Util::lock_value %hash, 'elem'; | |
1843 | ||
1844 | It used to return true. | |
1845 | ||
1846 | =item * | |
1847 | ||
1848 | Assignment to C<$^A> (the format output accumulator) now recalculates | |
1849 | the number of lines output. | |
1850 | ||
1851 | =item * | |
1852 | ||
1853 | The regexp optimiser no longer crashes on debugging builds when merging | |
1854 | fixed-string nodes with inconvenient contents. | |
1855 | ||
94c11dd4 RS |
1856 | =item * |
1857 | ||
1858 | Locking a subroutine (via C<lock &sub>) is no longer a compile-time error | |
1859 | for regular subs. For lvalue subroutines, it no longer tries to return the | |
1860 | sub as a scalar, resulting in strange side effects like C<ref \$_> | |
1861 | returning "CODE" in some instances. | |
1862 | ||
1863 | C<lock &sub> is now a run-time error if L<threads::shared> is loaded (a | |
1864 | no-op otherwise), but that may be rectified in a future version. | |
1865 | ||
1866 | =item * | |
1867 | ||
1868 | The prototypes of several built-in functions--C<getprotobynumber>, C<lock>, | |
1869 | C<not> and C<select>--have been corrected, or at least are now closer to | |
1870 | reality than before. | |
1871 | ||
1872 | =item * | |
1873 | ||
1874 | Most dereferencing operators (C<${}>, etc.) used to call C<FETCH> twice on | |
1875 | a tied operand when doing a symbolic dereference (looking up a variable by | |
1876 | name, which is not permitted under C<use strict 'refs'>). Only C<&{}> did | |
1877 | not have this problem. This has been fixed. | |
1878 | ||
1879 | =item * | |
1880 | ||
1881 | A minor regression introduced in 5.15.0 has been fixed. Dereferencing a | |
1882 | magical mortal (e.g., the return value of C<delete> on a tied hash element) | |
1883 | explicitly returned from a subroutine called recursively was not calling | |
1884 | C<FETCH>. This would affect code like C<@{ foo() }> where the C<foo> sub | |
1885 | contains C<return delete $hash{elem}> and is calling itself. | |
1886 | ||
1887 | =item * | |
1888 | ||
1889 | A panic involving the combination of the regular expression modifiers | |
1890 | C</aa> and the C<\b> escape sequence introduced in 5.14.0 has been | |
1891 | fixed [perl #95964]. | |
1892 | ||
1893 | =item * | |
1894 | ||
1895 | stat() would always return the inode number as an IV, even when the | |
1896 | original was unsigned, or too large to fit in an IV. stat() now | |
1897 | returns the inode number as the type that would best preserve the | |
1898 | original value. [perl #84590] | |
1899 | ||
1900 | =item * | |
1901 | ||
1902 | The combination of the regular expression modifiers C</aa> and the C<\b> | |
1903 | and C<\B> escape sequences did not work properly on UTF-8 encoded | |
1904 | strings. All non-ASCII characters under C</aa> should be treated as | |
1905 | non-word characters, but what was happening was that Unicode rules were | |
1906 | used to determine wordness/non-wordness for non-ASCII characters. This | |
1907 | is now fixed [perl #95968]. | |
1908 | ||
1909 | =item * | |
1910 | ||
1911 | Infinite loops like C<1 while 1> used to stop C<strict 'subs'> mode from | |
1912 | working for the rest of the block.t | |
1913 | ||
1914 | =item * | |
1915 | ||
1916 | The C<\h>, C<\H>, C<\v> and C<\V> regular expression metacharacters used to | |
1917 | cause a panic error message when attempting to match at the end of the | |
1918 | string [perl #96354]. | |
1919 | ||
1920 | =item * | |
1921 | ||
1922 | For list assignments like C<($a,$b) = ($b,$a)>, Perl has to make a copy of | |
1923 | the items on the right-hand side before assignment them to the left. For | |
1924 | efficiency's sake, it assigns the values on the right straight to the items | |
1925 | on the left no variable is mentioned on both sides, as in | |
1926 | C<($a,$b) = ($c,$d)>. The logic for determining when it can cheat was | |
1927 | faulty, in that C<&&> and C<||> on the right-hand side could fool it. So | |
1928 | C<($a,$b) = $some_true_value && ($b,$a)> would end up assigning the value | |
1929 | of C<$b> to both scalars. | |
1930 | ||
1931 | =item * | |
1932 | ||
1933 | Perl no longer tries to apply lvalue context to the string in | |
1934 | C<("string", $variable) ||= 1> (which used to be an error). Since the | |
1935 | left-hand side of C<||=> is evaluated in scalar context, that's a scalar | |
1936 | comma operator, which gives all but the last item void context. There is | |
1937 | no such thing as void lvalue context, so it was a mistake for Perl to try | |
1938 | to force it [perl #96942]. | |
1939 | ||
1940 | =item * | |
1941 | ||
1942 | Every subroutine has a filename associated with it, that the debugger uses. | |
1943 | The one associated with constant subroutines used to be misallocated when | |
1944 | cloned under threads. Consequently, debugging threaded applications could | |
1945 | result in memory corruption [perl #96126]. | |
1946 | ||
1947 | =item * | |
1948 | ||
1949 | C<caller> no longer leaks memory when called from the DB package if | |
1950 | C<@DB::args> was assigned to after the first call to C<caller>. L<Carp> | |
1951 | was triggering this bug [perl #97010]. | |
1952 | ||
4bbade93 | 1953 | =item * |
30682cc3 | 1954 | |
4bbade93 RS |
1955 | In Perl 5.15.0 C<defined(${'$'})> stopped returning true if the C<$$> |
1956 | variable had not been used yet. This has been fixed. | |
1957 | ||
1958 | =item * | |
1959 | ||
1960 | C<defined(${"..."})>, C<defined(*{"..."})>, etc., used to | |
1961 | return true for most, but not all built-in variables, if | |
1962 | they had not been used yet. Many times that new built-in | |
1963 | variables were added in past versions, this construct was | |
1964 | not taken into account, so this affected C<${^GLOBAL_PHASE}> and | |
1965 | C<${^UTF8CACHE}>, among others. It also used to return false if the | |
1966 | package name was given as well (C<${"::!"}>) and for subroutines in the | |
1967 | CORE package [perl #97978] [perl #97492] [perl #97484]. | |
1968 | ||
1969 | =item * | |
1970 | ||
1971 | Perl 5.10.0 introduced a similar bug: C<defined(*{"foo"})> where "foo" | |
1972 | represents the name of a built-in global variable used to return false if | |
1973 | the variable had never been used before, but only on the I<first> call. | |
1974 | This, too, has been fixed. | |
1975 | ||
1976 | =item * | |
1977 | ||
1978 | Various functions that take a filehandle argument in rvalue context | |
1979 | (C<close>, C<readline>, etc.) used to call C<FETCH> multiple times, if it | |
1980 | was a tied variable, and warn twice, if it was C<undef> [perl #97482]. | |
1981 | ||
1982 | =item * | |
1983 | ||
1984 | C<close> and similar filehandle functions, when called on built-in global | |
1985 | variables (like C<$+>), used to die if the variable happened to hold the | |
1986 | undefined value, instead of producing the usual "Use of uninitialized | |
1987 | value" warning. | |
1988 | ||
1989 | =item * | |
1990 | ||
1991 | When autovivified file handles were introduced in Perl 5.6.0, C<readline> | |
1992 | was inadvertently made to autovivify when called as C<readline($foo)> (but | |
1993 | not as C<E<lt>$fooE<gt>>). It has now been fixed never to autovivify. | |
1994 | ||
1995 | =item * | |
1996 | ||
1997 | C<defined ${ $tied_variable }> used to call C<FETCH> multiple times, but | |
1998 | now calls it just once. | |
1999 | ||
2000 | =item * | |
2001 | ||
2002 | Some cases of dereferencing a complex expression, such as | |
2003 | C<${ (), $tied } = 1>, used to call C<FETCH> multiple times, but now call | |
2004 | it once. | |
2005 | ||
2006 | =item * | |
2007 | ||
2008 | For a tied variable returning a package name, C<$tied-E<gt>method> used to | |
2009 | call C<FETCH> multiple times (even up to six!), and sometimes would | |
2010 | fail to call the method, due to memory corruption. | |
2011 | ||
2012 | =item * | |
2013 | ||
2014 | Calling an undefined anonymous subroutine (e.g., what $x holds after | |
2015 | C<undef &{$x = sub{}}>) used to cause a "Not a CODE reference" error, which | |
2016 | has been corrected to "Undefined subroutine called" [perl #71154]. | |
2017 | ||
2018 | =item * | |
2019 | ||
2020 | Causing C<@DB::args> to be freed between uses of C<caller> no longer | |
2021 | results in a crash [perl #93320]. | |
2022 | ||
2023 | =item * | |
2024 | ||
2025 | Since 5.6.0, C<*{ ... }> has been inconsistent in how it treats undefined | |
2026 | values. It would die in strict mode or lvalue context for most undefined | |
2027 | values, but would be treated as the empty string (with a warning) for the | |
2028 | specific scalar return by C<undef()> (C<&PL_sv_undef> internally). This | |
2029 | has been corrected. C<undef()> is now treated like other undefined | |
2030 | scalars, as in Perl 5.005. | |
2031 | ||
2032 | =item * | |
2033 | ||
2034 | It used to be possible to free the typeglob of a localised array or hash | |
2035 | (e.g., C<local @{"x"}; delete $::{x}>), resulting in a crash on scope exit. | |
2036 | ||
2037 | =item * | |
2038 | ||
2039 | C<setpgrp($foo)> used to be equivalent to C<($foo, setpgrp)>, because | |
2040 | C<setpgrp> was ignoring its argument if there was just one. Now it is | |
2041 | equivalent to C<setpgrp($foo,0)>. | |
2042 | ||
2043 | =item * | |
30682cc3 | 2044 | |
4bbade93 RS |
2045 | Assignments like C<*$tied = \&{"..."}> and C<*glob = $tied> now call FETCH |
2046 | only once. | |
30682cc3 | 2047 | |
4bbade93 RS |
2048 | =item * |
2049 | ||
2050 | C<chdir>, C<chmod>, C<chown>, C<utime>, C<truncate>, C<stat>, C<lstat> and | |
2051 | the filetest ops (C<-r>, C<-x>, etc.) now always call FETCH if passed a tied | |
2052 | variable as the last argument. They used to ignore tiedness if the last | |
2053 | thing return from or assigned to the variable was a typeglob or reference | |
2054 | to a typeglob. | |
2055 | ||
2056 | =item * | |
2057 | ||
2058 | Perl 5.15.1 inadvertently stopped C<*foo =~ s/\*//r> from working, as it | |
2059 | would try to force the *foo glob into a string. This has been fixed | |
2060 | [perl #97954]. | |
2061 | ||
2062 | =item * | |
2063 | ||
2064 | If things were arranged in memory the right way, it was possible for | |
2065 | thread joining to emit "Attempt to free unreferenced scalar" warnings if | |
2066 | C<caller> had been used from the C<DB> package prior to thread creation, | |
2067 | due to the way pads were reference-counted and cloned [perl #98092]. | |
2068 | ||
2069 | =item * | |
2070 | ||
2071 | CORE:: subs were introduced in the previous development release, but | |
2072 | C<defined &{"CORE::..."}> did not return true. That has been rectified | |
2073 | [perl #97484]. | |
2074 | ||
2075 | =item * | |
2076 | ||
2077 | Lvalue subroutines were made to autovivify in 5.15.0, but it did not work | |
2078 | in some cases involving an intervening list operator between the | |
2079 | dereference operator and the subroutine call (C<${(), lvsub()}>) | |
2080 | [perl #98184]. | |
2081 | ||
2082 | =item * | |
2083 | ||
2084 | A bug has been fixed that occurs when a tied variable is used as a | |
2085 | subroutine reference: if the last thing assigned to or returned from the | |
2086 | variable was a reference or typeglob, the C<\&$tied> could either crash or | |
2087 | return the wrong subroutine. The reference case is a regression introduced | |
2088 | in Perl 5.10.0. For typeglobs, it has probably never worked till now. | |
2089 | ||
2090 | =item * | |
30682cc3 | 2091 | |
4bbade93 RS |
2092 | C<given> was not scoping its implicit $_ properly, resulting in memory |
2093 | leaks or "Variable is not available" warnings [perl #94682]. | |
2094 | ||
2095 | =item * | |
2096 | ||
2097 | C<-l> followed by a bareword no longer "eats" the previous argument to | |
2098 | the list operator in whose argument list it resides. In less convoluted | |
2099 | English: C<print "bar", -l foo> now actually prints "bar", because C<-l> | |
2100 | on longer eats it. | |
2101 | ||
2102 | =item * | |
2103 | ||
2104 | In 5.14.0, filetest ops (C<-r>, C<-x>, etc.) started calling FETCH on a | |
2105 | tied argument belonging to the previous argument to a list operator, if | |
2106 | called with a bareword argument or no argument at all. This has been | |
2107 | fixed, so C<push @foo, $tied, -r> no longer calls FETCH on C<$tied>. | |
2108 | ||
2109 | =item * | |
2110 | ||
2111 | C<shmread> was not setting the scalar flags correctly when reading from | |
2112 | shared memory, causing the existing cached numeric representation in the | |
2113 | scalar to persist [perl #98480]. | |
2114 | ||
2115 | =item * | |
2116 | ||
2117 | Weakening the first argument to an automatically-invoked C<DESTROY> method | |
2118 | could result in erroneous "DESTROY created new reference" errors or | |
2119 | crashes. Now it is an error to weaken a read-only reference. | |
2120 | ||
2121 | =item * | |
2122 | ||
2123 | Under miniperl (used to configure modules when perl itself is built), | |
2124 | C<glob> now clears %ENV before calling csh, since the latter croaks on some | |
2125 | systems if it does not like the contents of the LS_COLORS enviroment | |
2126 | variable [perl #98662]. | |
2127 | ||
2128 | =item * | |
2129 | ||
2130 | C<++> and C<--> now work on copies of globs, instead of dying. | |
2131 | ||
2132 | =item * | |
2133 | ||
2134 | The subroutines in the CORE:: namespace that were introduced in the | |
2135 | previous development release run with the lexical hints (strict, warnings) | |
2136 | of the caller, just as though the built-in function had been called. But | |
2137 | this was not the case for C<goto &CORE::sub>. The CORE sub would end up | |
2138 | running with the lexical hints of the subroutine it replaced, instead of | |
2139 | that subroutine's caller. This has been fixed. | |
2140 | ||
2141 | =item * | |
2142 | ||
2143 | Stacked C<-l> (followed immediately by other filetest operators) did not | |
2144 | work previously; now it does. It is only permitted when the rightmost | |
2145 | filetest op has the special "_" handle for its argument and the most | |
2146 | recent C<stat>/C<lstat> call was an C<lstat>. | |
2147 | ||
2148 | =item * | |
2149 | ||
2150 | In Perl 5.6, C<-l> followed by anything other than a bareword would treat | |
2151 | its argument as a file name. That was changed in 5.8 for glob references | |
2152 | (C<\*foo>), but not for globs themselves (C<*foo>). C<-l> started | |
2153 | returning C<undef> for glob references without setting the last | |
2154 | stat buffer that the "_" handle uses, but only if warnings | |
2155 | were turned on. With warnings off, it was the same as 5.6. | |
2156 | In other words, it was simply buggy and inconsistent. Now the 5.6 | |
2157 | behaviour has been restored. | |
2158 | ||
2159 | =back | |
2160 | ||
2161 | =head1 Known Problems | |
30682cc3 RS |
2162 | |
2163 | =over 4 | |
2164 | ||
2165 | =item * | |
2166 | ||
4bbade93 RS |
2167 | We have a failing test in F<op/sigdispatch.t> on i386-netbsd 3.1 |
2168 | ||
2169 | =item * | |
2170 | ||
2171 | On Solaris, we have two kinds of failure. | |
2172 | ||
2173 | If F<make> is Sun's F<make≥>, we get an error about a badly formed macro | |
2174 | assignment in the F<Makefile>. That happens when F<./Configure> tries to | |
2175 | make depends. F<Configure> then exits 0, but further F<make>-ing fails. | |
2176 | ||
2177 | If F<make> is F<gmake>, F<Configure> completes, then we get errors related | |
2178 | to F</usr/include/stdbool.h> | |
30682cc3 RS |
2179 | |
2180 | =back | |
2181 | ||
2182 | =head1 Obituary | |
2183 | ||
2184 | XXX If any significant core contributor has died, we've added a short obituary | |
2185 | here. | |
2186 | ||
2187 | =head1 Acknowledgements | |
2188 | ||
2189 | XXX Generate this with: | |
2190 | ||
fbea3025 | 2191 | perl Porting/acknowledgements.pl v5.15.7..HEAD |
30682cc3 RS |
2192 | |
2193 | =head1 Reporting Bugs | |
2194 | ||
2195 | If you find what you think is a bug, you might check the articles | |
2196 | recently posted to the comp.lang.perl.misc newsgroup and the perl | |
2197 | bug database at http://rt.perl.org/perlbug/ . There may also be | |
2198 | information at http://www.perl.org/ , the Perl Home Page. | |
2199 | ||
2200 | If you believe you have an unreported bug, please run the L<perlbug> | |
2201 | program included with your release. Be sure to trim your bug down | |
2202 | to a tiny but sufficient test case. Your bug report, along with the | |
2203 | output of C<perl -V>, will be sent off to perlbug@perl.org to be | |
2204 | analysed by the Perl porting team. | |
2205 | ||
2206 | If the bug you are reporting has security implications, which make it | |
2207 | inappropriate to send to a publicly archived mailing list, then please send | |
2208 | it to perl5-security-report@perl.org. This points to a closed subscription | |
2209 | unarchived mailing list, which includes | |
2210 | all the core committers, who will be able | |
2211 | to help assess the impact of issues, figure out a resolution, and help | |
2212 | co-ordinate the release of patches to mitigate or fix the problem across all | |
2213 | platforms on which Perl is supported. Please only use this address for | |
2214 | security issues in the Perl core, not for modules independently | |
2215 | distributed on CPAN. | |
2216 | ||
2217 | =head1 SEE ALSO | |
2218 | ||
2219 | The F<Changes> file for an explanation of how to view exhaustive details | |
2220 | on what changed. | |
2221 | ||
2222 | The F<INSTALL> file for how to build Perl. | |
2223 | ||
2224 | The F<README> file for general stuff. | |
2225 | ||
2226 | The F<Artistic> and F<Copying> files for copyright information. | |
2227 | ||
2228 | =cut |