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