This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta - Add missing =item directive
[perl5.git] / pod / perl5192delta.pod
1 =encoding utf8
2
3 =head1 NAME
4
5 perl5192delta - what is new for perl v5.19.2
6
7 =head1 DESCRIPTION
8
9 This document describes differences between the 5.19.1 release and the 5.19.2
10 release.
11
12 If you are upgrading from an earlier release such as 5.19.0, first read
13 L<perl5191delta>, which describes differences between 5.19.0 and 5.19.1.
14
15 =head1 Core Enhancements
16
17 =head2 More consistent prototype parsing
18
19 Multiple semicolons in subroutine prototypes have long been tolerated and
20 treated as a single semicolon.  There was one case where this did not
21 happen.  A subroutine whose prototype begins with "*" or ";*" can affect
22 whether a bareword is considered a method name or sub call.  This now
23 applies also to ";;;*".
24
25 Whitespace has long been allowed inside subroutine prototypes, so
26 C<sub( $ $ )> is equivalent to C<sub($$)>, but until now it was stripped
27 when the subroutine was parsed.  Hence, whitespace was I<not> allowed in
28 prototypes set by C<Scalar::Util::set_prototype>.  Now it is permitted,
29 and the parser no longer strips whitespace.  This means
30 C<prototype &mysub> returns the original prototype, whitespace and all.
31
32 =head1 Performance Enhancements
33
34 =over 4
35
36 =item *
37
38 Precomputed hash values are now used in more places during method lookup.
39
40 =back
41
42 =head1 Modules and Pragmata
43
44 =head2 Updated Modules and Pragmata
45
46 =over 4
47
48 =item *
49
50 L<autodie> has been upgraded from version 2.19 to 2.20.
51
52 =item *
53
54 L<B> has been upgraded from version 1.43 to 1.44.
55
56 =item *
57
58 L<B::Concise> has been upgraded from version 0.96 to 0.98.
59
60 =item *
61
62 L<B::Deparse> has been upgraded from version 1.21 to 1.22.
63
64 =item *
65
66 L<base> has been upgraded from version 2.18 to 2.19.
67
68 =item *
69
70 L<Benchmark> has been upgraded from version 1.16 to 1.17.
71
72 =item *
73
74 L<Class::Struct> has been upgraded from version 0.64 to 0.65.
75
76 =item *
77
78 L<Data::Dumper> has been upgraded from version 2.146 to 2.147.
79
80 =item *
81
82 L<DB_File> has been upgraded from version 1.828 to 1.829.
83
84 =item *
85
86 L<DBM_Filter> has been upgraded from version 0.05 to 0.06.
87
88 =item *
89
90 L<Devel::Peek> has been upgraded from version 1.11 to 1.12.
91
92 =item *
93
94 L<Digest::MD5> has been upgraded from version 2.52 to 2.53.
95
96 =item *
97
98 L<Digest::SHA> has been upgraded from version 5.84 to 5.85.
99
100 =item *
101
102 L<English> has been upgraded from version 1.06 to 1.07.
103
104 =item *
105
106 L<Errno> has been upgraded from version 1.18 to 1.19.
107
108 =item *
109
110 L<ExtUtils::Embed> has been upgraded from version 1.30 to 1.31
111
112 The generated C<C> code now incorporates bug fixes present in
113 F<miniperlmain.c>, and has whitespace changes. It now uses
114 C<#include "..."> for header files instead of C<< #include <...> >>.
115 This should not make any difference, unless programs embedding C<libperl>
116 happen to have local and incompatible files named F<EXTERN.h>, F<XSUB.h> or
117 F<perl.h>, as these will now be picked up instead of the installed Perl
118 headers.
119
120 The C<canon()> function now correctly handles packages with multiple C<::>
121 separators when the I<$as> parameter is not I</>. Given that it used to
122 generate strings which would likely be syntax errors or pathnames instead of
123 filenames, we infer that from the complete lack of bug reports no-one was
124 using this functionality. (C<ExtUtils::Miniperl> is now using it.)
125
126 =item *
127
128 L<ExtUtils::Miniperl> has been upgraded and given a version of 1.
129 Previously it did not have a version number.
130
131 C<writemain()> now takes an optional first argument. A reference to a scalar
132 is treated as a filename to be opened and written to. Any other reference is
133 used as the filehandle to write to. Otherwise the existing default remains,
134 to write to C<STDOUT>.
135
136 C<writemain()> has been refactored to use functions from L<ExtUtils::Embed>,
137 reducing code size and duplication. The internal function C<canon()> has been
138 deleted.
139
140 =item *
141
142 L<ExtUtils::ParseXS> has been upgraded from version 3.19 to 3.21.
143
144 =item *
145
146 L<File::Basename> has been upgraded from version 2.84 to 2.85.
147
148 =item *
149
150 L<Getopt::Long> has been upgraded from version 2.4 to 2.41.
151
152 =item *
153
154 L<Getopt::Std> has been upgraded from version 1.08 to 1.09.
155
156 =item *
157
158 L<Hash::Util::FieldHash> has been upgraded from version 1.11 to 1.12.
159
160 =item *
161
162 L<HTTP::Tiny> has been upgraded from version 0.031 to 0.034.
163
164 =item *
165
166 L<I18N::Langinfo> has been upgraded from version 0.10 to 0.11.
167
168 =item *
169
170 L<if> has been upgraded from version 0.0602 to 0.0603.
171
172 =item *
173
174 L<IPC::Cmd> has been upgraded from version 0.80 to 0.82.
175
176 =item *
177
178 L<MIME::Base64> has been upgraded from version 3.13 to 3.14.
179
180 =item *
181
182 L<Module::CoreList> has been upgraded from version 2.92 to 2.94.
183
184 =item *
185
186 L<Params::Check> has been upgraded from version 0.36 to 0.38.
187
188 =item *
189
190 L<Parse::CPAN::Meta> has been upgraded from version 1.4404 to 1.4405.
191
192 =item *
193
194 L<Pod::Functions> has been upgraded from version 1.06 to 1.07.
195
196 =item *
197
198 L<Pod::Html> has been upgraded from version 1.19 to 1.2.
199
200 =item *
201
202 L<POSIX> has been upgraded from version 1.33 to 1.34.
203
204 C<POSIX::AUTOLOAD> will no longer infinitely recurse if the shared
205 object fails to load.
206
207 =item *
208
209 L<Safe> has been upgraded from version 2.36 to 2.37.
210
211 =item *
212
213 L<Socket> has been upgraded from version 2.009 to 2.010.
214
215 =item *
216
217 L<Storable> has been upgraded from version 2.43 to 2.45.
218
219 Calling C<STORABLE_attach> hooks no longer leaks memory. [perl #118829]
220
221 =item *
222
223 L<Text::ParseWords> has been upgraded from version 3.28 to 3.29.
224
225 =item *
226
227 L<Tie::Hash> has been upgraded from version 1.04 to 1.05.
228
229 =item *
230
231 L<Time::Piece> has been upgraded from version 1.2002 to 1.21.
232
233 =back
234
235 =head1 Documentation
236
237 =head2 Changes to Existing Documentation
238
239 =head3 L<perlexperiment>
240
241 =over 4
242
243 =item *
244
245 Code in regular expressions, regular expression backtracking verbs,
246 and lvalue subroutines are no longer listed as experimental.  (This
247 also affects L<perlre> and L<perlsub>.)
248
249 =back
250
251 =head3 L<perlfunc>
252
253 =over 4
254
255 =item *
256
257 Since Perl v5.10, it has been possible for subroutines in @INC to return
258 a reference to a scalar holding initial source code to prepend to the file.
259 This is now documented.
260
261 =back
262
263 =head3 L<perlop>
264
265 =over 4
266
267 =item *
268
269 The language design of Perl has always called for monomorphic operators.
270 This is now mentioned explicitly.
271
272 =back
273
274 =head3 L<perlre>
275
276 =over 4
277
278 =item *
279
280 The fact that the regexp engine makes no effort to call (?{}) and (??{})
281 constructs any specified number of times (although it will basically DWIM
282 in case of a successful match) has been documented.
283
284 =back
285
286 =head1 Diagnostics
287
288 The following additions or changes have been made to diagnostic output,
289 including warnings and fatal error messages.  For the complete list of
290 diagnostic messages, see L<perldiag>.
291
292 =head2 New Diagnostics
293
294 =head3 New Warnings
295
296 =over 4
297
298 =item *
299
300 L<Missing ']' in prototype for %s : %s|perldiag/"Missing ']' in prototype
301 for %s : %s">
302
303 (W illegalproto) A grouping was started with C<[> but never closed with
304 C<]>.
305
306 =back
307
308 =head2 Changes to Existing Diagnostics
309
310 =over 4
311
312 =item *
313
314 Under rare circumstances, one could get a "Can't coerce readonly REF to
315 string" instead of the customary "Modification of a read-only value".  This
316 alternate error message has been removed.
317
318 =item *
319
320 "Ambiguous use of * resolved as operator *": This and similar warnings
321 about "%" and "&" used to occur in some circumstances where there was no
322 operator of the type cited, so the warning was completely wrong.  This has
323 been fixed [perl #117535, #76910].
324
325 =item *
326
327 Warnings about malformed subroutine prototypes are now more consistent in
328 how the prototypes are rendered.  Some of these warnings would truncate
329 prototypes containing nulls.  In other cases one warning would suppress
330 another.  The warning about illegal characters in prototypes no longer says
331 "after '_'" if the bad character came before the underscore.
332
333 =item *
334
335 L<Perl folding rules are not up-to-date for 0x%X; please use the perlbug
336 utility to report; in regex; marked by <-- HERE in
337 mE<sol>%sE<sol>|perldiag/"Perl folding rules are not up-to-date for 0x%X;
338 please use the perlbug utility to report; in regex; marked by <-- HERE in
339 m/%s/">
340
341 This message is now only in the regexp category, and not in the deprecated
342 category.  It is still a default (i.e., severe) warning [perl #89648].
343
344 =item *
345
346 The debugger's "n" command now respects lvalue subroutines and steps over
347 them [perl #118839].
348
349 =back
350
351 =head1 Configuration and Compilation
352
353 =over 4
354
355 =item *
356
357 F<installperl> and F<installman>'s option handling has been refactored to use
358 L<Getopt::Long>. Both are used by the F<Makefile> C<install> targets, and
359 are not installed, so these changes are only likely to affect custom
360 installation scripts.
361
362 =over 4
363
364 =item *
365
366 single letter options now also have long names
367
368 =item *
369
370 invalid options are now rejected
371
372 =item *
373
374 command line arguments that are not options are now rejected
375
376 =item *
377
378 Each now has a C<--help> option to display the usage message.
379
380 =back
381
382 The behaviour for all valid documented invocations is unchanged.
383
384 =back
385
386 =head1 Platform Support
387
388 =head2 Platform-Specific Notes
389
390 =over 4
391
392 =item MidnightBSD
393
394 C<objformat> was removed from version 0.4-RELEASE of MidnightBSD and had been
395 deprecated on earlier versions.  This caused the build environment to be
396 erroneously configured for C<a.out> rather than C<elf>.  This has been now
397 been corrected.
398
399 =back
400
401 =head1 Internal Changes
402
403 =over 4
404
405 =item *
406
407 The Makefile shortcut targets for many rarely (or never) used testing and
408 profiling targets have been removed, or merged into the only other Makefile
409 target that uses them.  Specifically, these targets are gone, along with
410 documentation that referenced them or explained how to use them:
411
412     check.third check.utf16 check.utf8 coretest minitest.prep
413     minitest.utf16 perl.config.dashg perl.config.dashpg
414     perl.config.gcov perl.gcov perl.gprof perl.gprof.config
415     perl.pixie perl.pixie.atom perl.pixie.config perl.pixie.irix
416     perl.third perl.third.config perl.valgrind.config purecovperl
417     pureperl quantperl test.deparse test.taintwarn test.third
418     test.torture test.utf16 test.utf8 test_notty.deparse
419     test_notty.third test_notty.valgrind test_prep.third
420     test_prep.valgrind torturetest ucheck ucheck.third ucheck.utf16
421     ucheck.valgrind utest utest.third utest.utf16 utest.valgrind
422
423 It's still possible to run the relevant commands by "hand" - no underlying
424 functionality has been removed.
425
426 =item *
427
428 It is now possible to keep Perl from initializing locale handling.
429 For the most part, Perl doesn't pay attention to locale.  (See
430 L<perllocale>.)  Nonetheless, until now, on startup, it has always
431 initialized locale handling to the system default, just in case the
432 program being executed ends up using locales.  (This is one of the first
433 things a locale-aware program should do, long before Perl knows if it
434 will actually be needed or not.)  This works well except when Perl is
435 embedded in another application which wants a locale that isn't the
436 system default.  Now, if the environment variable
437 C<PERL_SKIP_LOCALE_INIT> is set at the time Perl is started, this
438 initialization step is skipped.  Prior to this, on Windows platforms,
439 the only workaround for this deficiency was to use a hacked-up copy of
440 internal Perl code.  Applications that need to use older Perls can
441 discover if the embedded Perl they are using needs the workaround by
442 testing that the C preprocessor symbol C<HAS_SKIP_LOCALE_INIT> is not
443 defined.  (RT #38193)
444
445 =item *
446
447 C<BmRARE> and C<BmPREVIOUS> have been removed.  They were not used anywhere
448 and are not part of the API.  For XS modules, they are now #defined as 0.
449
450 =item *
451
452 C<sv_force_normal>, which usually croaks on read-only values, used to allow
453 read-only values to be modified at compile time.  This has been changed to
454 croak on read-only values regardless.  This change uncovered several core
455 bugs.
456
457 =back
458
459 =head1 Selected Bug Fixes
460
461 =over 4
462
463 =item *
464
465 There have been several fixes related to Perl's handling of locales.  perl
466 #38193 was described above in L</Internal Changes>.
467 Also fixed is #112208 in which the error string in C<$!> displayed as
468 garbage in many UTF-8 locales;
469 #118197, where the radix (decimal point) character had to be an ASCII
470 character (which doesn't work for some non-Western languages);
471 and #115808, in which C<POSIX::setlocale()> on failure returned an
472 C<undef> which didn't warn about not being defined even if those
473 warnings were enabled.
474
475 =item *
476
477 The dtrace sub-entry probe now works with lexical subs, instead of
478 crashing [perl #118305].
479
480 =item *
481
482 Compiling a C<split> operator whose third argument is a named constant
483 evaulating to 0 no longer causes the constant's value to change.
484
485 =item *
486
487 A named constant used as the second argument to C<index> no longer gets
488 coerced to a string if it is a reference, regular expression, dualvar, etc.
489
490 =item *
491
492 A named constant evaluating to the undefined value used as the second
493 argument to C<index> no longer produces "uninitialized" warnings at compile
494 time.  It will still produce them at run time.
495
496 =item *
497
498 When a scalar was returned from a subroutine in @INC, the referenced scalar
499 was magically converted into an IO thingy, possibly resulting in "Bizarre
500 copy" errors if that scalar continued to be used elsewhere.  Now Perl uses
501 an internal copy of the scalar instead.
502
503 =item *
504
505 Undefining an inlinable lexical subroutine (C<my sub foo() { 42 } undef
506 &foo>) would result in a crash if warnings were turned on.
507
508 =item *
509
510 Certain uses of the C<sort> operator are optimised to modify an array in
511 place, such as C<@a = sort @a>.  During the sorting, the array is made
512 read-only.  If a sort block should happen to die, then the array remained
513 read-only even outside the C<sort>.  This has been fixed.
514
515 =item *
516
517 C<$a> and C<$b> inside a sort block are aliased to the actual arguments to
518 C<sort>, so they can be modified through those two variables.  This did not
519 always work, e.g., for lvalue subs and C<$#ary>, and probably many other
520 operators.  It works now.
521
522 =item *
523
524 The arguments to C<sort> are now all in list context.  If the C<sort>
525 itself were called in void or scalar context, then I<some>, but not all, of
526 the arguments used to be in void or scalar context.
527
528 =item *
529
530 Subroutine prototypes with Unicode characters above U+00FF were getting
531 mangled during closure cloning.  This would happen with subroutines closing
532 over lexical variables declared outside, and with lexical subs.
533
534 =item *
535
536 In regular expressions containing multiple code blocks, the values of
537 C<$1>, C<$2>, etc., set by nested regular expression calls would leak from
538 one block to the next.  Now these variables always refer to the outer
539 regular expression at the start of an embedded block [perl #117917].
540
541 =item *
542
543 C<UNIVERSAL::can> now treats its first argument the same way that method
544 calls do: Typeglobs and glob references with non-empty IO slots are treated
545 as handles, and strings are treated as filehandles, rather than packages,
546 if a handle with that name exists [perl #113932].
547
548 =item *
549
550 Method calls on typeglobs (e.g., C<< *ARGV->getline >>) used to stringify
551 the typeglob and then look it up again.  Combined with changes in Perl
552 5.18.0, this allowed C<< *foo->bar >> to call methods on the "foo" package
553 (like C<< foo->bar >>).  In some cases it could cause the method to be
554 called on the wrong handle.  Now a typeglob argument is treated as a
555 handle (just like C<< (\*foo)->bar >>), or, if its IO slot is empty, an
556 error is raised.
557
558 =item *
559
560 Under copy-on-write builds (the default as of 5.19.1) C<< ${'_<-e'}[0] >>
561 no longer gets mangled.  This is the first line of input saved for the
562 debugger's use for one-liners [perl #118627].
563
564 =item *
565
566 Assigning a vstring to a tied variable or to a subroutine argument aliased
567 to a nonexistent hash or array element now works, without flattening the
568 vstring into a regular string.
569
570 =item *
571
572 C<pos>, C<tie>, C<tied> and C<untie> did not work
573 properly on subroutine arguments aliased to nonexistent
574 hash and array elements [perl #77814, #27010].
575
576 =item *
577
578 The C<< => >> fat arrow operator can now quote built-in keywords even if it
579 occurs on the next line, making it consistent with how it treats other
580 barewords.
581
582 =back
583
584 =head1 Known Problems
585
586 =over 4
587
588 =item *
589
590 One of the bug fixes has accidentally thrown line numbers off in rare
591 cases, causing test failures for some CPAN modules.  This will hopefully be
592 fixed soon [perl #118931].
593
594 =back
595
596 =head1 Acknowledgements
597
598 Perl 5.19.2 represents approximately 4 weeks of development since Perl 5.19.1
599 and contains approximately 15,000 lines of changes across 400 files from 40
600 authors.
601
602 Perl continues to flourish into its third decade thanks to a vibrant community
603 of users and developers. The following people are known to have contributed the
604 improvements that became Perl 5.19.2:
605
606 Abhijit Menon-Sen, Alexandr Ciornii, Andy Dougherty, Aristotle Pagaltzis, Brian
607 Fraser, Brian Gottreu, Chris 'BinGOs' Williams, Craig A. Berry, Dagfinn Ilmari
608 Mannsåker, Daniel Dragan, David Golden, David Mitchell, Ed Avis, Father
609 Chrysostomos, Graham Knop, H.Merijn Brand, Hojung Youn, James E Keenan, Johan
610 Vromans, Karl Williamson, Keedi Kim, Kent Fredric, Lukas Mai, Moritz Lenz,
611 Nathan Trapuzzano, Neil Bowers, Nicholas Clark, Niels Thykier, Niko Tyni,
612 Olivier Mengué, Peter Martini, Petr Písař, Reini Urban, Ricardo Signes,
613 Ruslan Zakirov, Slaven Rezic, Steffen Müller, Tony Cook, Vladimir Timofeev,
614 Yves Orton.
615
616 The list above is almost certainly incomplete as it is automatically generated
617 from version control history. In particular, it does not include the names of
618 the (very much appreciated) contributors who reported issues to the Perl bug
619 tracker.
620
621 Many of the changes included in this version originated in the CPAN modules
622 included in Perl's core. We're grateful to the entire CPAN community for
623 helping Perl to flourish.
624
625 For a more complete list of all of Perl's historical contributors, please see
626 the F<AUTHORS> file in the Perl source distribution.
627
628 =head1 Reporting Bugs
629
630 If you find what you think is a bug, you might check the articles recently
631 posted to the comp.lang.perl.misc newsgroup and the perl bug database at
632 http://rt.perl.org/perlbug/ .  There may also be information at
633 http://www.perl.org/ , the Perl Home Page.
634
635 If you believe you have an unreported bug, please run the L<perlbug> program
636 included with your release.  Be sure to trim your bug down to a tiny but
637 sufficient test case.  Your bug report, along with the output of C<perl -V>,
638 will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
639
640 If the bug you are reporting has security implications, which make it
641 inappropriate to send to a publicly archived mailing list, then please send it
642 to perl5-security-report@perl.org.  This points to a closed subscription
643 unarchived mailing list, which includes all the core committers, who will be
644 able to help assess the impact of issues, figure out a resolution, and help
645 co-ordinate the release of patches to mitigate or fix the problem across all
646 platforms on which Perl is supported.  Please only use this address for
647 security issues in the Perl core, not for modules independently distributed on
648 CPAN.
649
650 =head1 SEE ALSO
651
652 The F<Changes> file for an explanation of how to view exhaustive details on
653 what changed.
654
655 The F<INSTALL> file for how to build Perl.
656
657 The F<README> file for general stuff.
658
659 The F<Artistic> and F<Copying> files for copyright information.
660
661 =cut