This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
replace links to perllexwarn with links to warnings
[perl5.git] / pod / perl5199delta.pod
CommitLineData
10819dab
TC
1=encoding utf8
2
3=head1 NAME
4
5perl5199delta - what is new for perl v5.19.9
6
7=head1 DESCRIPTION
8
9This document describes differences between the 5.19.8 release and the 5.19.9
10release.
11
12If you are upgrading from an earlier release such as 5.19.7, first read
13L<perl5198delta>, which describes differences between 5.19.7 and 5.19.8.
14
15=head1 Core Enhancements
16
17=head2 UTF-8 locales now supported better under C<S<use locale>>
18
19A UTF-8 locale is one in which the character set is Unicode and the
20encoding is UTF-8. Now, the POSIX C<LC_CTYPE> category operations under
21such a locale (within the scope of C<S<use locale>>), which include case
22changing (like C<lc()>, C<"\U">), and character classification (C<\w>,
23C<\D>, C<qr/[[:punct:]]/> work just as if not under locale, except taint
24rules are followed. Prior to this, Perl only handled single-byte
25locales. This resolves [perl #56820].
26
27=head2 C<S<use locale>> now compiles on systems without locale ability
28
29Previously doing this caused the program to not compile. Within its
30scope the program behaves as if in the "C" locale. Thus programs
31written for platforms that support locales can run on locale-less
32platforms without change. Attempts to change the locale away from the
33"C" locale will, of course, fail.
34
35=head2 PERL_DEBUG_READONLY_COW
36
37On some operating systems Perl can be compiled in such a way that any
38attempt to modify string buffers shared by multiple SVs will crash. This
39way XS authors can test that their modules handle copy-on-write scalars
40correctly. See L<perlguts/"Copy on Write"> for detail.
41
42This feature was actually added in 5.19.8, but was unintentionally omitted
43from its delta document.
44
45=head2 C<-DL> runtime option now added for tracing locale setting
46
47This is designed for Perl core developers to aid in field debugging bugs
48regarding locales.
49
50=head2 Subroutine signatures
51
52Declarative syntax to unwrap argument list into lexical variables.
53C<sub foo ($a,$b) {...}> checks the number of arguments and puts the
54arguments into lexical variables. Signatures are not equivalent to
55the existing idiom of C<sub foo { my($a,$b) = @_; ... }>. Signatures
56are only available by enabling a non-default feature, and generate
57warnings about being experimental. The syntactic clash with
58prototypes is managed by disabling the short prototype syntax when
59signatures are enabled.
60
61See L<perlsub/Signatures> for details.
62
63=head2 More locale initialization fallback options
64
65If there was an error with locales during Perl start-up, it immediately
66gave up and tried to use the C<"C"> locale. Now it first tries using
67other locales given by the environment variables, as detailed in
68L<perllocale/ENVIRONMENT>. For example, if C<LC_ALL> and C<LANG> are
69both set, and using the C<LC_ALL> locale fails, Perl will now try the
70C<LANG> locale, and only if that fails, will it fall back to C<"C">. On
71Windows machines, Perl will try, ahead of using C<"C">, the system
72default locale if all the locales given by environment variables fail.
73
74=head1 Incompatible Changes
75
76=head2 Tainting happens under more circumstances; now conforms to documentation
77
78This affects regular expression matching and changing the case of a
79string (C<lc>, C<"\U">, I<etc>.) within the scope of C<use locale>.
80The result is now tainted based on the operation, no matter what the
81contents of the string were, as the documentation (L<perlsec>,
82L<perllocale/SECURITY>) indicates it should. Previously, for the case
83change operation, if the string contained no characters whose case
84change could be affected by the locale, the result would not be tainted.
85For example, the result of C<uc()> on an empty string or one containing
86only above-Latin1 code points is now tainted, and wasn't before. This
87leads to more consistent tainting results. Regular expression patterns
88taint their non-binary results (like C<$&>, C<$2>) if and only if the
89pattern contains elements whose matching depends on the current
90(potentially tainted) locale. Like the case changing functions, the
91actual contents of the string being matched now do not matter, whereas
92formerly it did. For example, if the pattern contains a C<\w>, the
93results will be tainted even if the match did not have to use that
94portion of the pattern to succeed or fail, because what a C<\w> matches
95depends on locale. However, for example, a C<.> in a pattern will not
96enable tainting, because the dot matches any single character, and what
97the current locale is doesn't change in any way what matches and what
98doesn't.
99
100=head2 Quote-like escape changes
101
102The character after C<\c> in a double-quoted string ("..." or qq(...))
103or regular expression must now be a printable character and may not be
104C<{>.
105
106A literal C<{> after C<\B> or C<\b> is now fatal.
107
108These were deprecated in perl v5.14.
109
110=head1 Deprecations
111
112=over 4
113
114=item *
115
116Setting C<$/> to a reference to zero or a reference to a negative integer is
117now deprecated, and will behave B<exactly> as though it was set to C<undef>.
118If you want slurp behavior set C<$/> to C<undef> explicitly.
119
120=item *
121
122Setting C<$/> to a reference to a non integer is now forbidden and will
123throw an error. Perl has never documented what would happen in this
124context and while it used to behave the same as setting C<$/> to
125the address of the references in future it may behave differently, so we
126have forbidden this usage.
127
128=item *
129
130Use of any of these functions in the C<POSIX> module is now deprecated:
131C<isalnum>, C<isalpha>, C<iscntrl>, C<isdigit>, C<isgraph>, C<islower>,
132C<isprint>, C<ispunct>, C<isspace>, C<isupper>, and C<isxdigit>. The
133functions are buggy and don't work on UTF-8 encoded strings. See their
134entries in L<POSIX> for more information.
135
136A warning is raised on the first call to any of them from each place in
137the code that they are called. (Hence a repeated statement in a loop
138will raise just the one warning.)
139
140=back
141
142=head1 Performance Enhancements
143
144=over 4
145
146=item *
147
148Code like:
149
150 my $x; # or @x, %x
151 my $y;
152
153is now optimized to:
154
155 my ($x, $y);
156
157In combination with the padrange optimization, this means longer
158uninitialized my variable statements are also optimized, so:
159
160 my $x; my @y; my %z;
161
162becomes:
163
164 my ($x, @y, %z);
165
166[perl #121077]
167
168=back
169
170=head1 Modules and Pragmata
171
172=head2 Updated Modules and Pragmata
173
174=over 4
175
176=item *
177
178L<autodie> has been upgraded from version 2.22 to 2.23.
179
180C<autodie> no longer weakens strict by allowing undeclared variables
181with the same name as built-ins. [cpan #74246]
182
183C<use autodie qw( foo ! foo);> now correctly insists that we have
184hints for foo.
185
186=item *
187
188L<B> has been upgraded from version 1.47 to 1.48.
189
190Remove the obsolete C<DEREFed> flag from L<B::Concise>.
191
192=item *
193
194L<B::Deparse> has been upgraded from version 1.24 to 1.25.
195
196It now knows how to handle whitespace in prototypes. Previously, it could
197loop infinitely. [perl #121050]
198
199=item *
200
201L<CGI> has been upgraded from version 3.64 to 3.65.
202
203=item *
204
205L<Compress::Raw::Bzip2> has been upgraded from version 2.063 to 2.064.
206
207Handle non-PVs better. [cpan #91558]
208
209=item *
210
211L<Compress::Raw::Zlib> has been upgraded from version 2.063 to 2.065.
212
213Handle non-PVs better. [cpan #91558]
214
215Z_OK instead of Z_BUF_ERROR. [cpan #92521]
216
217Resolve a C++ build failure in core. [cpan #92657]
218
219=item *
220
221L<Config::Perl::V> has been upgraded from version 0.19 to 0.20.
222
223Synchronize with blead (bincompat options)
224
225=item *
226
227L<CPAN::Meta::YAML> has been upgraded from version 0.010 to 0.011.
228
229=item *
230
231L<Devel::Peek> has been upgraded from version 1.15 to 1.16.
232
233Devel::Peek::SvREFCNT() now ensures it has been passed a reference, as
234specified by its prototype.
235
236=item *
237
238L<diagnostics> has been upgraded from version 1.33 to 1.34.
239
240=item *
241
242L<Digest::SHA> has been upgraded from version 5.85 to 5.87.
243
244Improved the performance of hexadecimal output functions and simplified capture
245of intermediate SHA states, which can now be done via strings (see
246C<L<getstate()|Digest::SHA/getstate>>/C<L<putstate()|Digest::SHA/putstate($str)>>).
247
248=item *
249
250L<DynaLoader> has been upgraded from version 1.24 to 1.25.
251
252Android support.
253
254=item *
255
256L<English> has been upgraded from version 1.08 to 1.09.
257
258Added C<$OLD_PERL_VERSION> as an alias for C<$]>.
259
260=item *
261
262L<ExtUtils::CBuilder> has been upgraded from version 0.280213 to 0.280216.
263
264Android support.
265
266=item *
267
268L<ExtUtils::Embed> has been upgraded from version 1.31 to 1.32.
269
270Skip tests when cross-compiling and $Config{cc} isn't available.
271
272=item *
273
274L<ExtUtils::Install> has been upgraded from version 1.61 to 1.62.
275
276Skip tests when cross-compiler and make isn't available.
277
278=item *
279
280L<ExtUtils::MakeMaker> has been upgraded from version 6.86 to 6.88.
281
282Improved support for Android and other minor changes.
283
284=item *
285
286L<feature> has been upgraded from version 1.34 to 1.35.
287
288=item *
289
290L<File::Fetch> has been upgraded from version 0.46 to 0.48.
291
292Force curl to be IPv4 only during testing on NetBSD.
293
294=item *
295
296L<HTTP::Tiny> has been upgraded from version 0.039 to 0.042.
297
298Added support for keep-alive connections.
299
300If L<IO::Socket::IP> 0.25 or later is available, use that for
301transparent IPv4 or IPv6 support.
302
303=item *
304
305L<inc::latest> has been upgraded from version 0.4204 to 0.4205.
306
307NOTE: L<inc::latest> is deprecated and may be removed from a future version of Perl.
308
309=item *
310
311The IO-Compress module collection has been upgraded from version 2.063
312to 2.064.
313
314Android support.
315
316=item *
317
318L<IO::Socket::IP>, tentatively introduced in L<Perl 5.19.8|perl5198delta>,
319has been upgraded from 0.26 to 0.28.
320
321=item *
322
323L<IPC::Cmd> has been upgraded from version 0.90 to 0.92.
324
325=item *
326
327The libnet module collection has been upgraded from version 1.24 to 1.25.
328
329The creation of L<Net::FTP> dataconnections now honour the requested timeout,
330errors from C<Net::Cmd::response()> are now handled in C<Net::FTP::pasv_wait()>
331and a warning from C<Net::Domain::domainname()> on Android is now stopped.
332
333=item *
334
335L<locale> has been upgraded from version 1.02 to 1.03.
336
337Allow C<use locale;> on systems without locales, such as Android.
338
339=item *
340
341L<Locale::Codes> has been upgraded from version 3.28 to 3.29.
342
343=item *
344
345L<Module::Build> has been upgraded from version 0.4204 to 0.4205.
346
347Fix license code regression for artistic license.
348
349Don't swallow ExtUtils::CBuilder loading errors.
350
351Handle testing on cross-compile builds.
352
353Protect against platforms without getpw{nam,uid}.
354
355=item *
356
357L<Module::CoreList> has been upgraded from version 3.04 to 3.06.
358
359=item *
360
361L<Module::Load> has been upgraded from version 0.28 to 0.30.
362
363Prevent uninitialized warnings during testing.
364
365=item *
366
367L<Module::Load::Conditional> has been upgraded from version 0.60 to 0.62.
368
369=item *
370
371L<mro> has been upgraded from version 1.14 to 1.15.
372
373Use HEKfARG() instead of creating and throwing away SVs.
374
375=item *
376
377L<Net::Ping> has been upgraded from version 2.42 to 2.43.
378
379Handle getprotobyname() or getprotobynumber() not being available.
380
381=item *
382
383L<Parse::CPAN::Meta> has been upgraded from version 1.4409 to 1.4413.
384
385Invalid UTF-8 encoding in YAML files are now replaced with "PERLQQ"
386quoting from the Encode module and without warnings.
387
388Removed legacy test modifications for testing with the perl core.
389
390=item *
391
392The PathTools module collection has been upgraded from version 3.45 to
3933.46.
394
395Improved support for Android.
396
397C<< File::Spec::Unix->tmpdir >> now consistently returns an absolute
398path, unless in taint mode. [perl #120593]
399
400=item *
401
402L<Pod::Escapes> has been upgraded from version 1.04 to 1.06.
403
404Now strict and warning clean. Several minor documentation updates.
405
406e2charnum() no longer treats non-ASCII Unicode digits as suitable for
407an escape. [cpan #70246]
408
409=item *
410
411L<Pod::Parser> has been upgraded from version 1.61 to 1.62.
412
413=item *
414
415L<POSIX> has been upgraded from version 1.38_01 to 1.38_02.
416
417Deprecate use of isfoo() functions.
418
419=item *
420
421L<Scalar::Util> has been upgraded from version 1.36 to 1.38.
422
423A backwards-compatibility issue with older perls has been fixed. [cpan #92363]
424
425=item *
426
427L<threads> has been upgraded from version 1.91 to 1.92.
428
429Synchronization with CPAN release.
430
431=item *
432
433L<version> has been upgraded from version 0.9907 to 0.9908.
434
435=item *
436
437L<warnings> has been upgraded from version 1.21 to 1.22.
438
439C<< use warnings "FATAL"; >> now implies C<< "all" >>, and similarly
440for C<< use warnings "NONFATAL" >>. [perl #120977]
441
442=back
443
444=head1 Documentation
445
446=head2 Changes to Existing Documentation
447
448=head3 L<perlfunc>
449
450=over 4
451
452=item *
453
454L<perlfunc/exec>'s handling of arguments is now more clearly
455documented.
456
457=back
458
459=head3 L<perlguts>
460
461=over 4
462
463=item *
464
465New sections on L<Read-Only Values|perlguts/"Read-Only Values"> and
466L<Copy on Write|perlguts/"Copy on Write"> have been added. They were
467actually added in 5.19.8 but accidentally omitted from its delta document.
468
469=back
470
471=head1 Diagnostics
472
473The following additions or changes have been made to diagnostic output,
474including warnings and fatal error messages. For the complete list of
475diagnostic messages, see L<perldiag>.
476
477=head2 New Diagnostics
478
479=head3 New Errors
480
481=over 4
482
483=item *
484
ee0ba734 485Added L<Setting $E<sol> to a %s reference is forbidden|perldiag/"Setting $E<sol> to %s reference is forbidden">
10819dab
TC
486
487=back
488
489=head3 New Warnings
490
491=over 4
492
493=item *
494
495Added L<Setting $E<sol> to a reference to %s as a form of slurp is deprecated, treating as undef|perldiag/"Setting $E<sol> to a reference to %s as a form of slurp is deprecated, treating as undef">
496
497=back
498
499=head1 Configuration and Compilation
500
501=over 4
502
503=item *
504
505The cross-compilation model has been renovated.
506There's several new options, and some backwards-incompatible changes:
507
508We now build binaries for miniperl and generate_uudmap to be used on the host, rather than running
509every miniperl call on the target; this means that, short of 'make test',
510we no longer need access to the target system once Configure is done.
511You can provide already-built binaries through the C<hostperl> and
512C<hostgenerate> options to Configure.
513
514Additionally, if targeting an EBCDIC platform from an ASCII host,
515or viceversa, you'll need to run Configure with C<-Uhostgenerate>, to
516indicate that generate_uudmap should be run on the target.
517
518Finally, there's also a way of having Configure end early, right after
519building the host binaries, by cross-compiling without specifying a
520C<targethost>.
521
522The incompatible changes include no longer using xconfig.h, xlib, or
523Cross.pm, so canned config files and Makefiles will have to be updated.
524
525=item *
526
527Related to the above, there is now a way of specifying the location of sh
528(or equivalent) on the target system: C<targetsh>.
529
530For example, Android has its sh in /system/bin/sh, so if cross-compiling
531from a more normal Unixy system with sh in /bin/sh, "targetsh" would end
532up as /system/bin/sh, and "sh" as /bin/sh.
533
534=back
535
536=head1 Platform Support
537
538=head2 New Platforms
539
540=over 4
541
542=item Android
543
544Perl can now be built for Android, either natively or through
545cross-compilation, for all three currently available architectures (ARM,
546MIPS, and x86), on a wide range of versions.
547
548=back
549
550=head2 Platform-Specific Notes
551
552=over 4
553
554=item VMS
555
556Skip access checks on remotes in opendir(). [perl #121002]
557
558=item Cygwin
559
560Fixed a build error in cygwin.c on Cygwin 1.7.28.
561
562Tests now handle the errors that occur when C<cygserver> isn't
563running.
564
565=back
566
567=head1 Internal Changes
568
569=over 4
570
571=item Regexp Engine Changes That Affect The Pluggable Regex Engine Interface
572
573Many flags that used to be exposed via regexp.h and used to populate the
574extflags member of struct regexp have been removed. These fields were
575technically private to Perl's own regexp engine and should not have been
576exposed there in the first place.
577
578The affected flags are:
579
580 RXf_NOSCAN
581 RXf_CANY_SEEN
582 RXf_GPOS_SEEN
583 RXf_GPOS_FLOAT
584 RXf_ANCH_BOL
585 RXf_ANCH_MBOL
586 RXf_ANCH_SBOL
587 RXf_ANCH_GPOS
588
589As well as the follow flag masks:
590
591 RXf_ANCH_SINGLE
592 RXf_ANCH
593
594All have been renamed to PREGf_ equivalents and moved to regcomp.h.
595
596The behavior previously achieved by setting one or more of the RXf_ANCH_
597flags (via the RXf_ANCH mask) have now been replaced by a *single* flag bit
598in extflags:
599
600 RXf_IS_ANCHORED
601
602pluggable regex engines which previously used to set these flags should
603now set this flag ALONE.
604
605=back
606
607=head1 Selected Bug Fixes
608
609=over 4
610
611=item *
612
613Backticks (C< `` > or C< qx// >) combined with multiple threads on
614Win32 could result in output sent to stdout on one thread being
615captured by backticks of an external command in another thread.
616
617This could occur for pseudo-forked processes too, as Win32's
618pseudo-fork is implemented in terms of threads. [perl #77672]
619
620=item *
621
622C<< open $fh, ">+", undef >> no longer leaks memory when TMPDIR is set
623but points to a directory a temporary file cannot be created in. [perl
624#120951]
625
626=item *
627
628C<$^R> wasn't available outside of the regular expression that
629initialized it. [perl #121070]
630
631=item *
632
633Fixed a regular expression bug introduced in 5.19.5 where \S, \W etc
634could fail for above ASCII. [perl #121144]
635
636=item *
637
638A large set of fixes and refactoring for re_intuit_start() was merged,
639the highlights are:
640
641=over
642
643=item *
644
645Fixed a panic when compiling the regular expression
646C</\x{100}[xy]\x{100}{2}/>.
647
648=item *
649
650Fixed a performance regression when performing a global pattern match
651against a UTF-8 string. [perl #120692]
652
653=item *
654
655Fixed another performance issue where matching a regular expression
656like C</ab.{1,2}x/> against a long UTF-8 string would unnecessarily
657calculate byte offsets for a large portion of the string. [perl
658#120692]
659
660=back
661
662=item *
663
664C< for ( $h{k} || '' ) > no longer auto-vivifies C<$h{k}>. [perl
665#120374]
666
667=item *
668
669On Windows machines, Perl now emulates the POSIX use of the environment
670for locale initialization. Previously, the environment was ignored.
671See L<perllocale/ENVIRONMENT>.
672
673=item *
674
675Fixed a crash when destroying a self-referencing GLOB. [perl #121242]
676
677=item *
678
679Call set-magic when setting $DB::sub. [perl #121255]
680
681=item *
682
683Fixed an alignment error when compiling regular expressions when built
684with GCC on HP-UX 64-bit.
685
686=back
687
688=head1 Known Problems
689
690=over 4
691
692=item *
693
694The F<lib/locale.t> test may fail rarely.
695
696=back
697
698=head1 Errata From Previous Releases
699
700=over 4
701
702=item perl5180delta.pod
703
704This pod file contains a statement saying that C<RXf_SPLIT> (and its alias
705C<RXf_PMf_SPLIT>) and C<RXf_SKIPWHITE> were no longer used and #defined
706to 0. This was the case for a short period, but the change was reverted
707before Perl 5.18 was released. As such it was not true in Perl 5.18.x,
708and is also not true now. Both flags continue to be used. The incorrect
709entry has been removed from C<perl5180delta.pod> in this release.
710
711=back
712
713=head1 Acknowledgements
714
715Perl 5.19.9 represents approximately 4 weeks of development since Perl 5.19.8
716and contains approximately 47,000 lines of changes across 610 files from 32
717authors.
718
719Excluding auto-generated files, documentation and release tools, there were
720approximately 34,000 lines of changes to 420 .pm, .t, .c and .h files.
721
722Perl continues to flourish into its third decade thanks to a vibrant community
723of users and developers. The following people are known to have contributed the
724improvements that became Perl 5.19.9:
725
726Abigail, Alan Haggai Alavi, Brad Gilbert, Brian Fraser, Chris 'BinGOs'
727Williams, Craig A. Berry, Daniel Dragan, David Golden, David Mitchell, Father
728Chrysostomos, Gavin Shelley, H.Merijn Brand, Hauke D, James E Keenan, Jerry D.
729Hedden, Jess Robinson, John Peacock, Karl Williamson, Matthew Horsfall, Neil
730Williams, Peter Martini, Piotr Roszatycki, Rafael Garcia-Suarez, Reini Urban,
731Ricardo Signes, Steffen Müller, Steve Hay, Sullivan Beck, Tom Hukins, Tony
732Cook, Yves Orton, Zefram.
733
734The list above is almost certainly incomplete as it is automatically generated
735from version control history. In particular, it does not include the names of
736the (very much appreciated) contributors who reported issues to the Perl bug
737tracker.
738
739Many of the changes included in this version originated in the CPAN modules
740included in Perl's core. We're grateful to the entire CPAN community for
741helping Perl to flourish.
742
743For a more complete list of all of Perl's historical contributors, please see
744the F<AUTHORS> file in the Perl source distribution.
745
746=head1 Reporting Bugs
747
748If you find what you think is a bug, you might check the articles recently
749posted to the comp.lang.perl.misc newsgroup and the perl bug database at
750https://rt.perl.org/ . There may also be information at
751http://www.perl.org/ , the Perl Home Page.
752
753If you believe you have an unreported bug, please run the L<perlbug> program
754included with your release. Be sure to trim your bug down to a tiny but
755sufficient test case. Your bug report, along with the output of C<perl -V>,
756will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
757
758If the bug you are reporting has security implications, which make it
759inappropriate to send to a publicly archived mailing list, then please send it
760to perl5-security-report@perl.org. This points to a closed subscription
761unarchived mailing list, which includes all the core committers, who will be
762able to help assess the impact of issues, figure out a resolution, and help
763co-ordinate the release of patches to mitigate or fix the problem across all
764platforms on which Perl is supported. Please only use this address for
765security issues in the Perl core, not for modules independently distributed on
766CPAN.
767
768=head1 SEE ALSO
769
770The F<Changes> file for an explanation of how to view exhaustive details on
771what changed.
772
773The F<INSTALL> file for how to build Perl.
774
775The F<README> file for general stuff.
776
777The F<Artistic> and F<Copying> files for copyright information.
778
779=cut