Commit | Line | Data |
---|---|---|
44691e6f AB |
1 | =encoding utf8 |
2 | ||
3 | =head1 NAME | |
4 | ||
52deee2e | 5 | perldelta - what is new for perl v5.15.7 |
ad32999b | 6 | |
52deee2e | 7 | =head1 DESCRIPTION |
ad32999b | 8 | |
52deee2e DR |
9 | This document describes differences between the 5.15.6 release and |
10 | the 5.15.7 release. | |
ad32999b | 11 | |
52deee2e DR |
12 | If you are upgrading from an earlier release such as 5.15.5, first read |
13 | L<perl5156delta>, which describes differences between 5.15.5 and | |
14 | 5.15.6. | |
a3f52e2e | 15 | |
52deee2e | 16 | =head1 Core Enhancements |
d1fb015b | 17 | |
fbb93542 KW |
18 | =head2 C<use charnames> no longer needed for C<\N{I<name>}> |
19 | ||
20 | The C<charnames> module is now automatically loaded when needed as if | |
21 | the C<:full> and C<:short> options had been specified. See | |
22 | L<charnames>. | |
23 | ||
8c85651d KW |
24 | =head2 Improved performance for Unicode properties in regular expressions |
25 | ||
26 | Matching a code point against a Unicode property is now done via a | |
27 | binary search instead of linear. This means for example that the worst | |
28 | case for a 1000 item property is 10 probes instead of 1000. This | |
29 | inefficiency has been compensated for in the past by permanently storing | |
30 | in a hash the results of a given probe plus the results for the adjacent | |
31 | 64 code points, under the theory that near-by code points are likely to | |
32 | be searched for. A separate hash was used for each mention of a Unicode | |
33 | property in each regular expression. Thus, C<qr/\p{foo}abc\p{foo}/> | |
34 | would generate two hashes. Any probes in one instance would be unknown | |
35 | to the other, and the hashes could expand separately to be quite large | |
36 | if the regular expression were used on many different widely-separated | |
37 | code points. This can lead to running out of memory in extreme cases. | |
38 | Now, however, there is just one hash shared by all instances of a given | |
39 | property. This means that if C<\p{foo}> is matched against "A" in one | |
40 | regular expression in a thread, the result will be known immediately to | |
41 | all regular expressions, and the relentless march of using up memory is | |
42 | slowed considerably. | |
43 | ||
52deee2e | 44 | =head1 Deprecations |
7f28d7ed | 45 | |
ef337e16 CBW |
46 | =head2 Deprecated Modules |
47 | ||
48 | =over | |
49 | ||
50 | =item L<Version::Requirements> | |
51 | ||
52 | Version::Requirements is now DEPRECATED, use CPAN::Meta::Requirements, | |
53 | which is a drop-in replacement. It will be deleted from perl.git blead | |
54 | in v5.17.0. | |
55 | ||
56 | =back | |
57 | ||
52deee2e | 58 | =head1 Performance Enhancements |
66008486 | 59 | |
52deee2e | 60 | =over 4 |
66008486 FC |
61 | |
62 | =item * | |
63 | ||
39de7394 FC |
64 | Version declarations with the C<use> keyword (e.g., C<use 5.012>) are now |
65 | faster, as they enable features without loading F<feature.pm>. | |
66008486 | 66 | |
cadced9f FC |
67 | =item * |
68 | ||
69 | C<local $_> is faster now, as it no longer iterates through magic that it | |
70 | is not going to copy anyway. | |
71 | ||
66008486 FC |
72 | =back |
73 | ||
52deee2e | 74 | =head1 Modules and Pragmata |
84b2a83e | 75 | |
e3c71926 | 76 | =head2 Updated Modules and Pragmata |
6d110ad0 | 77 | |
e3c71926 | 78 | =over 4 |
6d110ad0 FC |
79 | |
80 | =item * | |
81 | ||
6f103008 FC |
82 | L<B::Deparse> has been upgraded from version 1.10 to version 1.11. |
83 | ||
6ee63c28 | 84 | It now deparses C<open('random string')> correctly. It used to omit the |
6f103008 FC |
85 | quotation marks, which did not work if the string were not a valid |
86 | identifier [perl #91416]. | |
87 | ||
6ee63c28 FC |
88 | A similar bug also affected hash and array elements such as |
89 | C<< 'random string'->[0] >>, which would deparse as C<$random string[0]>. | |
90 | This has been fixed. | |
91 | ||
cb1728ed FC |
92 | Those same syntaxes used to drop the package name from variables beginning |
93 | with a punctuation mark, as in C<< "foo::]"->{$key} >>. This, too, has | |
94 | been fixed. | |
95 | ||
36a6a135 FC |
96 | B::Deparse no longer hangs when deparsing a program with stash |
97 | circularities, such as C<BEGIN { *Acme::Acme:: = *Acme:: }> [perl #91384]. | |
98 | ||
99 | C</$s[1]/> used to be deparsed as C<$s[1]> if @s were a lexical variable | |
2e120742 FC |
100 | [perl #81424]. Similarly, C</$#s/> would be deparsed as C<$#s> for both |
101 | lexical and package variables. These has been fixed. | |
36a6a135 FC |
102 | |
103 | The C</applaud> regular expression flags are no longer omitted. | |
104 | ||
e3ed6ae8 FC |
105 | Feature hints are now deparsed with C<use feature> rather than C<%^H> |
106 | assignments. | |
107 | ||
ea88c40c | 108 | A regression in 1.10 that caused C<ambient_pragmas> to disable strict mode |
025130bf FC |
109 | in obscure cases has been fixed. |
110 | ||
c7235129 FC |
111 | Strict mode is now fully deparsed, including subs and vars [perl #24027]. |
112 | ||
a7106152 FC |
113 | The global variables C<$(>, C<$|> and C<$)> are now deparsed with braces |
114 | (i.e., C<${(}>) in regular expressions [perl #86060]. | |
115 | ||
ea88c40c FC |
116 | C<continue> blocks after C<for> loops are now deparsed correctly, as they |
117 | were back in 0.67 (included with Perl 5.8.5) [perl #108224] | |
118 | ||
6f103008 FC |
119 | =item * |
120 | ||
7f92e913 CBW |
121 | L<CGI> has been upgraded from version 3.58 to version 3.59. |
122 | ||
123 | We no longer read from STDIN when the Content-Length is not set, preventing | |
124 | requests with no Content-Length from freezing in some cases. This is consistent | |
125 | with the CGI RFC 3875, and is also consistent with CGI::Simple. However, the old | |
126 | behavior may have been expected by some command-line uses of CGI.pm. | |
127 | ||
128 | =item * | |
129 | ||
2b283575 CBW |
130 | L<CPAN::Meta> has been upgraded from version 2.112621 to version 2.113640. |
131 | ||
132 | Version::Requirements has now been merged as CPAN::Meta::Requirements. | |
133 | ||
134 | =item * | |
135 | ||
ce6b844f | 136 | L<CPANPLUS> has been upgraded from version 0.9113 to version 0.9116. |
7f41f337 | 137 | |
88c5c971 CBW |
138 | =item * |
139 | ||
8f12b018 FC |
140 | L<Data::Dumper> has been upgraded from version 2.135_01 to version |
141 | 2.135_03. | |
142 | ||
143 | It can now dump vstrings [perl #101162]. | |
144 | ||
26afcec5 FC |
145 | The nameless typeglob (C<*{""}>) is now dumped properly. |
146 | ||
8f12b018 FC |
147 | =item * |
148 | ||
d7fbd56d FC |
149 | L<diagnostics> has been upgraded from version 1.26 to version 1.27. |
150 | ||
151 | See the entry for splain in the L</Utility Changes> section, for the | |
152 | changes. The diagnostics module and the splain utility are actually one | |
153 | and the same. | |
154 | ||
155 | =item * | |
156 | ||
711a3903 FC |
157 | L<ExtUtils::Packlist> has been upgraded from version 1.45 to version 1.46. |
158 | ||
159 | It no longer produces "used once" warnings when the C<read> and C<write> | |
160 | methods are called while the main program is still compiling (e.g., from | |
161 | within a BEGIN block) [perl #107410] [rt.cpan.org #50315]. | |
162 | ||
163 | =item * | |
164 | ||
6ba817f3 CBW |
165 | L<ExtUtils::ParseXS> has been upgraded from version 3.08 to version 3.12. |
166 | ||
167 | =item * | |
168 | ||
6b339779 CBW |
169 | L<Locale::Maketext> has been upgraded from version 1.21 to version 1.22. |
170 | ||
171 | =item * | |
172 | ||
b240fc0f CBW |
173 | L<Module::CoreList> has been upgraded from version 2.59 to version 2.60. |
174 | ||
175 | =item * | |
176 | ||
4e6ab4ad CBW |
177 | L<Module::Pluggable> has been upgraded from version 3.9 to version 4.0. |
178 | ||
179 | =item * | |
180 | ||
79e10968 FC |
181 | L<overload> has been upgraded from version 1.16 to version 1.17. |
182 | ||
183 | C<overload::Overloaded> no longer calls C<can> on the class, but uses | |
184 | another means to determine whether the object has overloading. It was | |
185 | never correct for it to call C<can>, as overloading does not respect | |
186 | AUTOLOAD. So classes that autoload methods and implement C<can> no longer | |
187 | have to account for overloading [perl #40333]. | |
188 | ||
ea88c40c FC |
189 | A warning is now produced for invalid arguments. See L</New Diagnostics>. |
190 | ||
79e10968 FC |
191 | =item * |
192 | ||
329d453a | 193 | L<perlfaq> has been upgraded from version 5.0150036 to version 5.0150038. |
9d055b1a CBW |
194 | |
195 | =item * | |
196 | ||
cadced9f FC |
197 | L<PerlIO::scalar> has been upgraded from version 0.12 to version 0.13. |
198 | ||
199 | (This is the module that implements C<< open $fh, '>', \$scalar >>.) | |
200 | ||
201 | It no longer assumes during C<seek> that $scalar is a string internally. | |
6fd65695 FC |
202 | If it didn't crash, it was close to doing so [perl #92706]. Also, the |
203 | internal print routine no longer assumes that the position set by C<seek> | |
204 | is valid, but extends the string to that position, filling the intervening | |
205 | bytes (between the old length and the seek position) with nulls | |
206 | [perl #78980]. | |
cadced9f FC |
207 | |
208 | Printing to an in-memory handle now works if the $scalar holds a reference, | |
209 | stringifying the reference before modifying it. References used to be | |
210 | treated as empty strings. | |
211 | ||
212 | Printing to an in-memory handle no longer crashes if the $scalar happens to | |
213 | hold a number internally, but no string buffer. | |
214 | ||
07feb684 FC |
215 | Printing to an in-memory handle no longer creates scalars that confuse the regular expression engine [perl #108398]. |
216 | ||
cadced9f FC |
217 | =item * |
218 | ||
632c5d30 NC |
219 | L<Pod::Html> has been upgraded from version 1.12 to 1.13 |
220 | ||
221 | =item * | |
222 | ||
60ffae32 | 223 | L<POSIX> has been upgraded from version 1.27 to version 1.29. |
4e6e9b23 FC |
224 | |
225 | C<sigsuspend> and C<pause> now run signals handle before returning, as the | |
226 | whole point of these two functions is to wait until a signal has | |
227 | arrived, and then return I<after> it has been triggered. Delayed, or | |
228 | "safe", signals were preventing that from happening, possibly resulting in | |
229 | race conditions [perl #107216]. | |
60ffae32 CBW |
230 | C<POSIX::sleep> is now a direct call into the underlying OS C<sleep> |
231 | function, instead of being a Perl wrapper on C<CORE::sleep>. C<POSIX::dup2> | |
232 | now returns the correct value on Win32 (I<i.e.> the file descriptor). | |
233 | C<POSIX::SigSet> C<sigsuspend> and C<sigpending> and C<POSIX::pause> now | |
234 | dispatch safe signals immediately before returning to their caller. | |
4e6e9b23 FC |
235 | |
236 | =item * | |
237 | ||
1887da8c RS |
238 | L<Pod::Perldoc> has been upgraded from version 3.15_01 to version 3.15_15. |
239 | ||
240 | =item * | |
241 | ||
88c5c971 CBW |
242 | L<Term::UI> has been upgraded from version 0.26 to version 0.30. |
243 | ||
c0504019 TR |
244 | =item * |
245 | ||
246 | L<Tie::File> has been upgraded from version 0.96 to version 0.98. | |
247 | ||
937a45d0 KW |
248 | =item * |
249 | ||
250 | L<Unicode::UCD> has been upgraded from version 0.37 to version 0.38. | |
251 | This changes the output of C<prop_invmap()> for the Name_Alias property | |
252 | to reflect the changes that are planned for Unicode 6.1, so that there | |
253 | won't be a format change when upgrading to 6.1. Briefly, a second | |
254 | component of each alias is added that gives the type of alias it is. | |
255 | Examples are at L<Unicode::UCD/prop_invmap()>. | |
256 | ||
ef337e16 CBW |
257 | =item * |
258 | ||
259 | L<Version::Requirements> has been upgraded from version 0.101020 to version 0.101021. | |
260 | ||
261 | Version::Requirements is now DEPRECATED, use CPAN::Meta::Requirements, | |
262 | which is a drop-in replacement. | |
263 | ||
7f28d7ed | 264 | =back |
679b54e7 | 265 | |
52deee2e | 266 | =head1 Documentation |
3c7c5233 | 267 | |
52deee2e | 268 | =head2 Changes to Existing Documentation |
a71d67b1 | 269 | |
cadced9f FC |
270 | =head3 L<perlfunc> |
271 | ||
272 | =over 4 | |
273 | ||
274 | =item * | |
275 | ||
276 | C<dbmopen> treats a 0 mode as a special case, that prevents a nonexistent | |
277 | file from being created. This has been the case since Perl 5.000, but was | |
278 | never documented anywhere. Now the perlfunc entry mentions it | |
279 | [perl #90064]. | |
280 | ||
281 | =item * | |
282 | ||
283 | The entry for C<split> has been rewritten. It is now far clearer than | |
284 | before. | |
285 | ||
286 | =back | |
287 | ||
288 | =head3 L<perlop> and L<perlsyn> | |
7e7629fa | 289 | |
52deee2e | 290 | =over 4 |
7e7629fa FC |
291 | |
292 | =item * | |
293 | ||
cadced9f FC |
294 | Documentation of the smartmatch operator has been reworked and moved from |
295 | perlsyn to perlop where it belongs. | |
296 | ||
297 | =item * | |
298 | ||
299 | Documentation of the ellipsis statement (C<...>) has been reworked and | |
300 | moved from perlop to perlsyn. | |
c2654555 | 301 | |
52deee2e | 302 | =back |
85ca3be7 | 303 | |
52deee2e | 304 | =head1 Diagnostics |
85ca3be7 | 305 | |
52deee2e DR |
306 | The following additions or changes have been made to diagnostic output, |
307 | including warnings and fatal error messages. For the complete list of | |
308 | diagnostic messages, see L<perldiag>. | |
7788a270 | 309 | |
52deee2e | 310 | =head2 New Diagnostics |
a3e88ad7 | 311 | |
52deee2e | 312 | =head3 New Errors |
6138a722 | 313 | |
0aaeb177 | 314 | =over 4 |
be539103 | 315 | |
a47fb3fe CBW |
316 | =item * |
317 | ||
4888c563 FC |
318 | L<Cannot set tied @DB::args|perldiag/"Cannot set tied @DB::args"> |
319 | ||
320 | This error occurs when C<caller> tries to set C<@DB::args> but finds it | |
321 | tied. Before this error was added, it used to crash instead. | |
a3f52e2e | 322 | |
52272450 FC |
323 | =item * |
324 | ||
325 | L<Cannot tie unreifiable array|perldiag/"Cannot tie unreifiable array"> | |
326 | ||
327 | This error is part of a safety check that the C<tie> operator does before | |
328 | tying a special array like C<@_>. You should never see this message. | |
329 | ||
0aaeb177 | 330 | =back |
a3f52e2e | 331 | |
52deee2e | 332 | =head3 New Warnings |
a47fb3fe | 333 | |
0aaeb177 | 334 | =over 4 |
7ef25837 | 335 | |
6d110ad0 FC |
336 | =item * |
337 | ||
604a99bd NC |
338 | L<defined(@array) is deprecated|perldiag/"defined(@array) is deprecated"> |
339 | ||
340 | The long-deprecated C<defined(@array)> now also warns for package variables. | |
341 | Previously it only issued a warning for lexical variables. | |
6d110ad0 | 342 | |
ea88c40c FC |
343 | =item * |
344 | ||
345 | L<Useless use of \E|perldiag/"Useless use of \E"> | |
346 | ||
347 | C<\E> does nothing unless preceded by C<\Q>, C<\L> or C<\U>. | |
348 | ||
349 | =item * | |
350 | ||
351 | L<overload arg '%s' is invalid|perldiag/"overload arg '%s' is invalid"> | |
352 | ||
353 | This warning, in the "overload" category, is produced when the overload | |
354 | pragma is given an argument it doesn't recognize, presumably a mistyped | |
355 | operator. | |
356 | ||
6d110ad0 FC |
357 | =back |
358 | ||
cadced9f FC |
359 | =head2 Removals |
360 | ||
361 | =over 4 | |
362 | ||
363 | =item * | |
364 | ||
365 | "sort is now a reserved word" | |
366 | ||
367 | This error used to occur when C<sort> was called without arguments, followed by C<;> or C<)>. (E.g., C<sort;> would die, but C<{sort}> was | |
368 | OK.) This error message was added in Perl 3 to catch code like | |
369 | C<close(sort)> which would no longer work. More than two decades later, | |
370 | this message is no longer appropriate. Now C<sort> without arguments is | |
371 | always allowed, and returns an empty list, as it did in those cases where | |
372 | it was already allowed [perl #90030]. | |
373 | ||
374 | =back | |
375 | ||
0aaeb177 | 376 | =head1 Utility Changes |
9cfd094e | 377 | |
d7fbd56d | 378 | =head3 L<splain> |
0aaeb177 | 379 | |
e3c71926 | 380 | =over 4 |
b53e16ae FC |
381 | |
382 | =item * | |
383 | ||
d7fbd56d FC |
384 | splain no longer emits backtraces with the first line number repeated. |
385 | This: | |
386 | ||
387 | Uncaught exception from user code: | |
388 | Cannot fwiddle the fwuddle at -e line 1. | |
389 | at -e line 1 | |
390 | main::baz() called at -e line 1 | |
391 | main::bar() called at -e line 1 | |
392 | main::foo() called at -e line 1 | |
393 | ||
394 | has become this: | |
395 | ||
396 | Uncaught exception from user code: | |
397 | Cannot fwiddle the fwuddle at -e line 1. | |
398 | main::baz() called at -e line 1 | |
399 | main::bar() called at -e line 1 | |
400 | main::foo() called at -e line 1 | |
ba91b4f3 | 401 | |
b18aa002 FC |
402 | =item * |
403 | ||
66056247 | 404 | Some error messages consist of multiple lines that are listed as separate |
b18aa002 FC |
405 | entries in L<perldiag>. splain has been taught to find the separate |
406 | entries in these cases, instead of simply failing to find the message. | |
407 | ||
52deee2e | 408 | =back |
ba91b4f3 | 409 | |
52deee2e | 410 | =head1 Configuration and Compilation |
f4912a50 | 411 | |
0aaeb177 | 412 | =over 4 |
a3f52e2e FC |
413 | |
414 | =item * | |
415 | ||
3e975088 NC |
416 | The Pod files for the perl FAQ, L<perlxs>, L<perlxstut> and L<perldoc> |
417 | are once again correctly installed in the same directory as the other core | |
418 | Pods. | |
419 | ||
420 | =for 5.16.0 This isn't a regression from 5.14.x, so don't mention this. | |
a3f52e2e | 421 | |
0aaeb177 | 422 | =back |
a3f52e2e | 423 | |
52deee2e | 424 | =head1 Testing |
a3f52e2e | 425 | |
0aaeb177 | 426 | =over 4 |
ad32999b | 427 | |
f4912a50 | 428 | =item * |
ad32999b | 429 | |
48eabb99 NC |
430 | F<t/porting/utils.t> now tests that various utility scripts compile cleanly. |
431 | During development, this avoids the embarrassment of inadvertently pushing a | |
432 | commit which breaks code which isn't otherwise tested by the regression test | |
433 | suite. For example, F<installperl> and F<installman>, needed by | |
434 | C<make install>, are tested here. | |
c15f899f | 435 | |
7f28d7ed | 436 | =back |
ad32999b | 437 | |
52deee2e | 438 | =head1 Internal Changes |
d6b99bf4 | 439 | |
52deee2e | 440 | =over 4 |
8aade7da | 441 | |
c7b728ca SF |
442 | =item * |
443 | ||
39de7394 FC |
444 | There are now feature bundle hints in C<PL_hints> (C<$^H>) that version |
445 | declarations use, to avoid having to load F<feature.pm>. One setting of | |
446 | the hint bits indicates a "custom" feature bundle, which means that the | |
447 | entries in C<%^H> still apply. F<feature.pm> uses that. | |
448 | ||
449 | The C<HINT_FEATURE_MASK> macro is defined in F<perl.h> along with other | |
450 | hints. Other macros for setting and testing features and bundles are in | |
451 | the new F<feature.h>. C<FEATURE_IS_ENABLED> (which has moved to | |
452 | F<feature.h>) is no longer used throughout the codebase, but more specific | |
453 | macros, e.g., C<FEATURE_SAY_IS_ENABLED>, that are defined in F<feature.h>. | |
454 | ||
455 | =item * | |
456 | ||
457 | F<lib/feature.pm> is now a generated file, created by the new | |
458 | F<regen/feature.pl> script, which also generates F<feature.h>. | |
5dd80d85 | 459 | |
52272450 FC |
460 | =item * |
461 | ||
462 | Tied arrays are now always C<AvREAL>. If C<@_> or C<DB::args> is tied, it | |
463 | is reified first, to make sure this is always the case. | |
464 | ||
52deee2e | 465 | =back |
5dd80d85 | 466 | |
52deee2e | 467 | =head1 Selected Bug Fixes |
c7b728ca | 468 | |
52deee2e | 469 | =over 4 |
84b2a83e | 470 | |
5343a617 | 471 | =item * "b . COND" in the debugger has been fixed |
84b2a83e | 472 | |
5343a617 SF |
473 | Breaking on the current line with C<b . COND> was broken by previous work and |
474 | has now been fixed. | |
84b2a83e | 475 | |
07f0992c FC |
476 | =item * Tying C<%^H> |
477 | ||
90bf1576 FC |
478 | Tying C<%^H> no longer causes perl to crash or ignore |
479 | the contents of C<%^H> when entering a compilation | |
07f0992c FC |
480 | scope [perl #106282]. |
481 | ||
36a6a135 FC |
482 | =item * C<~> on vstrings |
483 | ||
484 | The bitwise complement operator (and possibly other operators, too) when | |
485 | passed a vstring would leave vstring magic attached to the return value, | |
486 | even though the string had changed. This meant that | |
487 | C<< version->new(~v1.2.3) >> would create a version looking like "v1.2.3" | |
488 | even though the string passed to C<< version->new >> was actually | |
489 | "\376\375\374". This also caused L<B::Deparse> to deparse C<~v1.2.3> | |
490 | incorrectly, without the C<~> [perl #29070]. | |
491 | ||
492 | =item * Vstrings blowing away magic | |
493 | ||
494 | Assigning a vstring to a magic (e.g., tied, C<$!>) variable and then | |
495 | assigning something else used to blow away all the magic. This meant that | |
496 | tied variables would come undone, C<$!> would stop getting updated on | |
497 | failed system calls, C<$|> would stop setting autoflush, and other | |
498 | mischief would take place. This has been fixed. | |
499 | ||
a32fcfdc FC |
500 | =item * C<newHVhv> and tied hashes |
501 | ||
502 | The C<newHVhv> XS function now works on tied hashes, instead of crashing or | |
503 | returning an empty hash. | |
504 | ||
063b2a72 FC |
505 | =item * Hashes will null elements |
506 | ||
507 | It is possible from XS code to create hashes with elements that have no | |
508 | values. Perl itself sometimes creates such hashes, but they are rarely | |
509 | visible to Perl code. The hash element and slice operators used to crash | |
510 | when handling these in lvalue context. These have been fixed. They now | |
511 | produce a "Modification of non-creatable hash value attempted" error | |
512 | message. | |
513 | ||
8c7dd470 FC |
514 | =item * No warning for C<open(foo::bar)> |
515 | ||
516 | When one writes C<open foo || die>, which used to work in Perl 4, a | |
517 | "Precedence problem" warning is produced. This warning used erroneously to | |
66056247 FC |
518 | apply to fully-qualified bareword handle names not followed by C<||>. This |
519 | has been corrected. | |
8c7dd470 | 520 | |
f7606f70 FC |
521 | =item * C<select> and package aliasing |
522 | ||
523 | After package aliasing (C<*foo:: = *bar::>), C<select> with 0 or 1 argument | |
524 | would sometimes return a name that could not be used to refer to the | |
525 | filehandle, or sometimes it would return C<undef> even when a filehandle | |
526 | was selected. Now it returns a typeglob reference in such cases. | |
527 | ||
c0a5c448 FC |
528 | =item * C<PerlIO::get_layers> and tied variables |
529 | ||
530 | C<PerlIO::get_layers> no longer ignores FETCH on tied variables as it used | |
12d5b6c4 FC |
531 | to most of the time [perl #97956]. |
532 | ||
533 | =item * C<PerlIO::get_layers> and numbers | |
534 | ||
535 | C<PerlIO::get_layers> no longer ignores some arguments that it thinks are | |
536 | numeric, while treating others as filehandle names. It is now consistent | |
537 | for flat scalars (i.e., not references). | |
c0a5c448 | 538 | |
3ba4cf6c FC |
539 | =item * Lvalue subs and strict mode |
540 | ||
541 | Lvalue sub calls that are not determined to be such at compile time | |
542 | (C<&$name> or &{"name"}) are no longer exempt from strict refs if they | |
543 | occur in the last statement of an lvalue subroutine [perl #102486]. | |
544 | ||
545 | =item * Non-lvalue sub calls in potentially lvalue context | |
546 | ||
547 | Sub calls whose subs are not visible at compile time, if | |
548 | they occurred in the last statement of an lvalue subroutine, | |
549 | would reject non-lvalue subroutines and die with "Can't modify non-lvalue | |
550 | subroutine call" [perl #102486]. | |
551 | ||
552 | Non-lvalue sub calls whose subs I<are> visible at compile time exhibited | |
553 | the opposite bug. If the call occurred in the last statement of an lvalue | |
554 | subroutine, there would be no error when the lvalue sub was called in | |
555 | lvalue context. Perl would blindly assign to the temporary value returned | |
556 | by the non-lvalue subroutine. | |
557 | ||
558 | =item * AUTOLOADing lvalue subs | |
559 | ||
560 | C<AUTOLOAD> routines used to take precedence over the actual sub being | |
561 | called (i.e., when autoloading wasn't needed), for sub calls in lvalue or | |
562 | potential lvalue context, if the subroutine was not visible at compile | |
563 | time. | |
564 | ||
4888c563 FC |
565 | =item * C<caller> and tied C<@DB::args> |
566 | ||
567 | C<caller> sets C<@DB::args> to the subroutine arguments when called from | |
568 | the DB package. It used to crash when doing so if C<@DB::args> happened to | |
569 | be tied. Now it croaks instead. | |
570 | ||
52272450 FC |
571 | =item * Tying C<@_> |
572 | ||
573 | Under debugging builds, this code: | |
574 | ||
575 | sub TIEARRAY{bless[]} | |
576 | sub { | |
577 | tie @_, ""; | |
578 | \@_; | |
579 | }->(1); | |
580 | ||
581 | use to produce an "av_reify called on tied array" warning. It doesn't any | |
582 | more. | |
583 | ||
ad266194 FC |
584 | =item * Unrecognised switches on C<#!> line |
585 | ||
586 | If a switch, such as B<-x>, that cannot occur on the C<#!> line is used | |
66056247 | 587 | there, perl dies with "Can't emulate...". |
ad266194 FC |
588 | |
589 | It used to produce the same message for switches that perl did not | |
590 | recognise at all, whether on the command line or the C<#!> line. | |
591 | ||
592 | Now it produces the "Unrecognized switch" error message [perl #104288]. | |
593 | ||
17b27d32 FC |
594 | =item * C<system> and SIGCHLD |
595 | ||
596 | C<system> now temporarily blocks the SIGCHLD signal handler, to prevent the | |
597 | signal handler from stealing the exit status [perl #105700]. | |
598 | ||
b0e9fc93 FC |
599 | =item * Deleting methods via C<delete> |
600 | ||
601 | Deletion of methods via C<delete $Class::{method}> syntax used to update | |
602 | method caches if called in void context, but not scalar or list context. | |
603 | Now it always updates those caches. | |
604 | ||
d563d34b FC |
605 | =item * Hash element deletion and destructors |
606 | ||
607 | When hash elements are deleted in void context, the internal hash entry is | |
66056247 | 608 | now freed before the value is freed, to prevent destructors called by that |
d563d34b FC |
609 | latter freeing from seeing the hash in an inconsistent state. It was |
610 | possible to cause double-frees if the destructor freed the hash itself | |
611 | [perl #100340]. | |
612 | ||
6e555b9a FC |
613 | =item * C<(s)printf>'s %n formatting code |
614 | ||
615 | The %n formatting code, which causes the number of characters to be | |
616 | assigned to the next argument to C<printf> or C<sprintf> now actually | |
617 | assigns the number of characters, instead of the number of bytes. | |
618 | ||
619 | It also works now with special lvalue functions like C<substr> and with | |
b484d00e | 620 | nonexistent hash and array elements [perl #3471, #103492]. |
6e555b9a | 621 | |
ac8fb82c FC |
622 | =item * Typeglobs and threads |
623 | ||
624 | Typeglobs returned from threads are no longer cloned if the parent thread | |
625 | already has a glob with the same name. This means that returned | |
626 | subroutines will now assign to the right package variables [perl #107366]. | |
627 | ||
711a3903 FC |
628 | =item * C<local $_> |
629 | ||
630 | In Perl 5.14, C<local $_> was changed to create a new variable not tied to | |
631 | anything, even if $_ was tied before that. But, due to an oversight, it | |
632 | would still call FETCH once on a tied $_ before replacing it with the new | |
633 | variable. This has been fixed [perl #105912]. | |
634 | ||
cadced9f FC |
635 | =item * Returning tied variables |
636 | ||
637 | When returning a value from a non-lvalue subroutine, Perl copies the value. | |
638 | Sometimes it cheats for the sake of speed, and does not copy the value if | |
639 | it makes no observable difference. This optimisation was erroneously | |
640 | allowing the copy to be skipped on tied variables, causing a difference in | |
641 | behaviour depending on the tied variable's reference count. This has been | |
642 | fixed [perl #95548]. | |
643 | ||
644 | =item * C<{@a = sort}> no longer crashes | |
645 | ||
646 | This particular piece of code (C<sort> with no arguments assigned to an | |
647 | array, inside a block with no C<;>) started crashing in an earlier 5.15.x | |
648 | release. It has been fixed. | |
649 | ||
650 | =item * C<utf8::decode> and read-only scalars | |
651 | ||
652 | C<utf8::decode> now refuses to modify read-only scalars [perl #91850]. | |
653 | ||
654 | =item * C<dbmopen> with undefined mode | |
655 | ||
656 | C<dbmopen> now only warns once, rather than three times, if the mode | |
657 | argument is C<undef> [perl #90064]. | |
658 | ||
659 | =item * Freeing an aggregate during list assignment | |
660 | ||
661 | If list assignment to a hash or array triggered destructors that freed the | |
662 | hash or array itself, a crash would ensue. This is no longer the case | |
663 | [perl #107440]. | |
664 | ||
838cf719 FC |
665 | =item * Confused internal bookkeeping with @ISA arrays |
666 | ||
667 | Creating a weak reference to an @ISA array or accessing the array index | |
668 | (C<$#ISA>) could result in confused internal bookkeeping for elements | |
669 | subsequently added to the @ISA array. For instance, creating a weak | |
670 | reference to the element itself could push that weak reference on to @ISA; | |
671 | and elements added after use of C<$#ISA> would be ignored by method lookup | |
672 | [perl #85670]. | |
673 | ||
674 | =item * DELETE on scalar ties | |
675 | ||
676 | Tying an element of %ENV or C<%^H> and then deleting that element would | |
677 | result in a call to the tie object's DELETE method, even though tying the | |
678 | element itself is supposed to be equivalent to tying a scalar (the element | |
679 | is, of course, a scalar) [perl #67490]. | |
680 | ||
681 | =item * Freeing $_ inside C<grep> or C<map> | |
682 | ||
683 | Freeing $_ inside a C<grep> or C<map> block or a code block embedded in a | |
684 | regular expression used to result in double frees [perl #92254, #92256]. | |
685 | ||
b00f6edb FC |
686 | =item * Warnings with C<+=> |
687 | ||
688 | The C<+=> operator does not usually warn when the left-hand side is | |
689 | C<undef>, but it was doing so for tied variables. This has been fixed | |
690 | [perl #44895]. | |
691 | ||
66056247 | 692 | =item * Tying and autovivification |
7a3fd9ed FC |
693 | |
694 | When Perl autovivifies an element of a tied array or hash (which entails | |
695 | calling STORE with a new reference), it now calls FETCH immediately after | |
696 | the STORE, instead of assuming that FETCH would have returned the same | |
697 | reference. This can make it easier to implement tied objects [perl #35865, #43011]. | |
698 | ||
1a50d74b FC |
699 | =item * C<@&> and C<$&> |
700 | ||
701 | Mentioning a variable named "&" other than C<$&> (i.e., C<@&> or C<%&>) no | |
702 | longer stops C<$&> from working. The same applies to variables named "'" | |
703 | and "`" [perl #24237]. | |
704 | ||
ea88c40c FC |
705 | =item * Stacked filetests |
706 | ||
707 | C<-T> and C<-B> now work when stacked up with other filetest operators | |
708 | [perl #77388]. | |
709 | ||
710 | =item * Filetests and stat buffers | |
711 | ||
712 | Perl keeps several internal variables to keep track of the last stat | |
713 | buffer, from which file(handle) it originated, what type it was, and | |
714 | whether the last stat succeeded. | |
715 | ||
716 | There were various cases where these could get out of synch, resulting in | |
717 | inconsistent or erratic behaviour in edge cases (every mention of C<-T> | |
718 | applies to C<-B> as well): | |
719 | ||
720 | =over | |
721 | ||
722 | =item * | |
723 | ||
724 | C<-T I<HANDLE>>, even though it does a C<stat>, was not resetting the last | |
725 | stat type, so an C<lstat _> following it would merrily return the wrong | |
726 | results. Also, it was not setting the success status. | |
727 | ||
728 | =item * | |
729 | ||
730 | Freeing the handle last used by C<stat> or a filetest could result in | |
731 | S<C<-T _>> using an unrelated handle. | |
732 | ||
733 | =item * | |
734 | ||
735 | C<stat> with an IO reference (as returned by C<*STDIO{IO}>, for instance) | |
736 | would not reset the stat type. | |
737 | ||
738 | =item * | |
739 | ||
740 | C<stat> with an IO reference was not recording the filehandle for | |
741 | S<C<-T _>> to use. | |
742 | ||
743 | =item * | |
744 | ||
745 | The presence of fatal warnings could cause the stat buffer not to be reset | |
746 | for a filetest operator on an unopened filehandle or C<-l> on any handle. | |
747 | ||
748 | =item * | |
749 | ||
750 | Fatal warnings would stop C<-T> from setting C<$!>. | |
751 | ||
752 | =item * | |
753 | ||
754 | When the last stat was on an unreadable file, C<-T _> is supposed to | |
755 | return C<undef>, leaving the last stat buffer unchanged. But it was | |
756 | setting the stat type, causing C<lstat _> to stop working. | |
757 | ||
758 | =item * | |
759 | ||
760 | C<-T I<FILENAME>> was not resetting the internal stat buffers for | |
761 | unreadable files. | |
762 | ||
763 | =back | |
764 | ||
765 | These have all been fixed. | |
766 | ||
767 | =item * C<defined *{"!"}> | |
768 | ||
769 | An earlier 5.15.x release caused this construct to stop the C<%!> hash | |
770 | from working. Likewise C<defined *{"+"}> and C<defined *{"-"}> caused | |
771 | C<%+> and C<%->, respectively, to stop working. This has been fixed. | |
772 | ||
773 | =item * C<-T _> with no preceding C<stat> | |
774 | ||
775 | This used to produce a confusing "uninitialized" warning, even though there | |
776 | is no visible uninitialized value to speak of. | |
777 | ||
778 | =item * C<stat I<HANDLE>> and fstat failures | |
779 | ||
780 | If the operating system's C<fstat> function failed, C<stat> would warn | |
781 | about an unopened handle, even though that was not the case. This has been | |
782 | fixed. | |
783 | ||
784 | =item * C<lstat I<IOREF>> | |
785 | ||
786 | C<lstat> is documented to fall back to C<stat> (with a warning) when given | |
787 | a filehandle. When passed an IO reference, it was actually doing the | |
788 | equivalent of S<C<stat _>> and ignoring the handle. | |
789 | ||
485495c3 FC |
790 | =item * Crashes with warnings |
791 | ||
792 | Two warning messages that mention variable names started crashing in | |
fbed6467 | 793 | 5.15.5, but have been fixed [perl #106726, #107656]. |
485495c3 | 794 | |
18af289e FC |
795 | =item * Bitwise assignment operators and copy-on-write |
796 | ||
4bcb627b | 797 | In 5.14.0, the bitwise assignment operators C<|=>, C<^=> and C<&=> started |
18af289e FC |
798 | leaving the left-hand side undefined if it happened to be a copy-on-write |
799 | string. This has been fixed [perl #108480]. | |
800 | ||
1ac442bc KW |
801 | =item * Three problematic Unicode characters now work better in regex pattern matching under C</i> |
802 | ||
803 | In the past, three Unicode characters: | |
804 | LATIN SMALL LETTER SHARP S, | |
805 | GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS, | |
806 | and | |
807 | GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS, | |
808 | along with the sequences that they fold to | |
809 | (including "ss" in the case of LATIN SMALL LETTER SHARP S), | |
810 | did not properly match under C</i>. 5.14.0 fixed some of these cases, | |
811 | but introduced others, including a panic when one of the characters or | |
812 | sequences was used in the C<(?(DEFINE)> regular expression predicate. | |
813 | The known bugs that were introduced in 5.14 have now been fixed; as well | |
814 | as some other edge cases that have never worked until now. All these | |
815 | involve using the characters and sequences outside bracketed character | |
c0154fe2 KW |
816 | classes under C</i>. This closes [perl #98546]. |
817 | ||
818 | There remain known problems when using certain characters with | |
819 | multi-character folds inside bracketed character classes, including such | |
820 | constructs as C<qr/[\N{LATIN SMALL LETTER SHARP}a-z]/i>. These | |
821 | remaining bugs are addressed in [perl #89774]. | |
1ac442bc | 822 | |
52deee2e | 823 | =back |
84b2a83e | 824 | |
52deee2e | 825 | =head1 Acknowledgements |
8fe05716 | 826 | |
7ae580ab | 827 | Perl 5.15.7 represents approximately 4 weeks of development since Perl 5.15.6 |
7629e1de | 828 | and contains approximately 51,000 lines of changes across 480 files from 30 |
7ae580ab CBW |
829 | authors. |
830 | ||
831 | Perl continues to flourish into its third decade thanks to a vibrant community | |
832 | of users and developers. The following people are known to have contributed the | |
833 | improvements that became Perl 5.15.7: | |
834 | ||
7629e1de CBW |
835 | Alberto Simões, Bo Lindbergh, Brian Fraser, Chris 'BinGOs' Williams, Craig A. |
836 | Berry, Dave Rolsky, David Mitchell, Eric Brine, Father Chrysostomos, Florian | |
837 | Ragwitz, H.Merijn Brand, Hojung Youn, James E Keenan, Joel Berger, Joshua ben | |
838 | Jore, Karl Williamson, Leon Timmermans, Matthew Horsfall, Michael Witten, | |
839 | Nicholas Clark, Reini Urban, Ricardo Signes, Shlomi Fish, Steffen Müller, | |
840 | Steffen Schwigon, Todd Rinaldo, Tom Christiansen, Tom Hukins, Tony Cook, Ævar | |
841 | Arnfjörð Bjarmason. | |
7ae580ab CBW |
842 | |
843 | The list above is almost certainly incomplete as it is automatically generated | |
844 | from version control history. In particular, it does not include the names of | |
845 | the (very much appreciated) contributors who reported issues to the Perl bug | |
846 | tracker. | |
847 | ||
848 | Many of the changes included in this version originated in the CPAN modules | |
849 | included in Perl's core. We're grateful to the entire CPAN community for | |
850 | helping Perl to flourish. | |
851 | ||
852 | For a more complete list of all of Perl's historical contributors, please see | |
853 | the F<AUTHORS> file in the Perl source distribution. | |
29cf780c | 854 | |
44691e6f AB |
855 | =head1 Reporting Bugs |
856 | ||
857 | If you find what you think is a bug, you might check the articles | |
52deee2e DR |
858 | recently posted to the comp.lang.perl.misc newsgroup and the perl |
859 | bug database at http://rt.perl.org/perlbug/ . There may also be | |
44691e6f AB |
860 | information at http://www.perl.org/ , the Perl Home Page. |
861 | ||
862 | If you believe you have an unreported bug, please run the L<perlbug> | |
52deee2e DR |
863 | program included with your release. Be sure to trim your bug down |
864 | to a tiny but sufficient test case. Your bug report, along with the | |
865 | output of C<perl -V>, will be sent off to perlbug@perl.org to be | |
866 | analysed by the Perl porting team. | |
44691e6f AB |
867 | |
868 | If the bug you are reporting has security implications, which make it | |
52deee2e DR |
869 | inappropriate to send to a publicly archived mailing list, then please send |
870 | it to perl5-security-report@perl.org. This points to a closed subscription | |
871 | unarchived mailing list, which includes | |
872 | all the core committers, who will be able | |
873 | to help assess the impact of issues, figure out a resolution, and help | |
874 | co-ordinate the release of patches to mitigate or fix the problem across all | |
875 | platforms on which Perl is supported. Please only use this address for | |
876 | security issues in the Perl core, not for modules independently | |
877 | distributed on CPAN. | |
44691e6f AB |
878 | |
879 | =head1 SEE ALSO | |
880 | ||
52deee2e DR |
881 | The F<Changes> file for an explanation of how to view exhaustive details |
882 | on what changed. | |
44691e6f AB |
883 | |
884 | The F<INSTALL> file for how to build Perl. | |
885 | ||
886 | The F<README> file for general stuff. | |
887 | ||
888 | The F<Artistic> and F<Copying> files for copyright information. | |
889 | ||
890 | =cut |