This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta - 'nonexistent' should be 'non-existent'
[perl5.git] / pod / perldelta.pod
CommitLineData
44691e6f
AB
1=encoding utf8
2
3=head1 NAME
4
ba03bc34 5perldelta - what is new for perl v5.19.4
e128ab2c 6
4eabcf70 7=head1 DESCRIPTION
6db9054f 8
ba03bc34 9This document describes differences between the 5.19.3 release and the 5.19.4
e08634c5 10release.
6db9054f 11
ba03bc34
SH
12If you are upgrading from an earlier release such as 5.19.2, first read
13L<perl5193delta>, which describes differences between 5.19.2 and 5.19.3.
a3fb66a4 14
ba03bc34 15=head1 Core Enhancements
a3fb66a4 16
99366d6d 17=head2 C<rand> now uses a consistent random number generator
f1591529 18
99366d6d
SH
19Previously perl would use a platform specific random number generator, varying
20between the libc rand(), random() or drand48().
f1591529 21
99366d6d
SH
22This meant that the quality of perl's random numbers would vary from platform
23to platform, from the 15 bits of rand() on Windows to 48-bits on POSIX
24platforms such as Linux with drand48().
f1591529 25
2d8e8368
SH
26Perl now uses its own internal drand48() implementation on all platforms. This
27does not make perl's C<rand> cryptographically secure. [perl #115928]
f1591529 28
f2ab313d 29=head2 Better 64-bit support
18ae6bbc
FC
30
31On 64-bit platforms, the internal array functions now use 64-bit offsets,
99366d6d
SH
32allowing Perl arrays to hold more than 2**31 elements, if you have the memory
33available.
18ae6bbc 34
99366d6d 35The regular expression engine now supports strings longer than 2**31
f2ab313d
FC
36characters. [perl #112790, #116907]
37
84d7ce3c
SH
38The functions PerlIO_get_bufsiz, PerlIO_get_cnt, PerlIO_set_cnt and
39PerlIO_set_ptrcnt now have SSize_t, rather than int, return values and
40parameters.
41
f53b57fd
FC
42=head2 New slice syntax
43
2ee51dc9 44The new C<%hash{...}> and C<%array[...]> syntax returns a list of key/value (or
99366d6d 45index/value) pairs.
f53b57fd 46
972690a1
KW
47=head2 EBCDIC support
48
0ac7511e
SH
49Core Perl now mostly works on EBCDIC platforms. This is not true of many
50modules, including some which are shipped with this release. If you have
51resources to help continue this process, including test machines, send email to
52L<mailto:perl-mvs@perl.org>.
972690a1 53
0ac7511e
SH
54As a result of this, certain XS functions are now deprecated; see L</Internal
55Changes>.
972690a1 56
ba03bc34 57=head1 Incompatible Changes
a3fb66a4 58
e1c60bf3 59=head2 Locale decimal point character no longer leaks outside of
99366d6d 60S<C<use locale>> scope (with the exception of $!)
e46375fa 61
e1c60bf3
SH
62This is actually a bug fix, but some code has come to rely on the bug being
63present, so this change is listed here. The current locale that the program is
64running under is not supposed to be visible to Perl code except within the
65scope of a S<C<use locale>>. However, until now under certain circumstances,
66the character used for a decimal point (often a comma) leaked outside the
67scope.
e46375fa 68
e1c60bf3
SH
69This continues the work released in Perl 5.19.1. It turns out that that did
70not catch all the leaks, including C<printf> and C<sprintf> not respecting
71S<C<use locale>>. If your code is affected by this change, simply add a
72S<C<use locale>>.
e46375fa 73
99366d6d 74Now, the only known place where S<C<use locale>> is not respected is in the
e1c60bf3 75stringification of L<$!|perlvar/$!>.
a3fb66a4 76
820689a1
SH
77=head2 Assignments of Windows sockets error codes to $! now prefer F<errno.h> values over WSAGetLastError() values
78
79In previous versions of Perl, Windows sockets error codes as returned by
80WSAGetLastError() were assigned to $!, and some constants such as ECONNABORTED,
81not in F<errno.h> in VC++ (or the various Windows ports of gcc) were defined to
82corresponding WSAE* values to allow $! to be tested against the E* constants
83exported by L<Errno> and L<POSIX>.
84
85This worked well until VC++ 2010 and later, which introduced new E* constants
86with values E<gt> 100 into F<errno.h>, including some being (re)defined by perl
87to WSAE* values. That caused problems when linking XS code against other
88libraries which used the original definitions of F<errno.h> constants.
89
90To avoid this incompatibility, perl now maps WSAE* error codes to E* values
91where possible, and assigns those values to $!. The E* constants exported by
92L<Errno> and L<POSIX> are updated to match so that testing $! against them,
93wherever previously possible, will continue to work as expected, and all E*
94constants found in F<errno.h> are now exported from those modules with their
95original F<errno.h> values
96
97In order to avoid breakage in existing Perl code which assigns WSAE* values to
98$!, perl now intercepts the assignment and performs the same mapping to E*
99values as it uses internally when assigning to $! itself.
100
101However, one backwards-incompatibility remains: existing Perl code which
102compares $! against the numeric values of the WSAE* error codes that were
103previously assigned to $! will now be broken in those cases where a
104corresponding E* value has been assigned instead. This is only an issue for
105those E* values E<lt> 100, which were always exported from L<Errno> and
106L<POSIX> with their original F<errno.h> values, and therefore could not be used
107for WSAE* error code tests (e.g. WSAEINVAL is 10022, but the corresponding
108EINVAL is 22). (E* values E<gt> 100, if present, were redefined to WSAE*
109values anyway, so compatibility can be achieved by using the E* constants,
110which will work both before and after this change, albeit using different
111numeric values under the hood.)
112
ba03bc34 113=head1 Deprecations
a3fb66a4 114
b29f65fc
BF
115=head2 Literal control characters in variable names
116
0ac7511e
SH
117This deprecation affects things like $\cT, where \cT is a literal control in
118the source code. Surprisingly, it appears that originally this was intended as
119the canonical way of accessing variables like $^T, with the caret form only
120being added as an alternative.
b29f65fc 121
0ac7511e
SH
122The literal control form is being deprecated for two main reasons. It has what
123are likely unfixable bugs, such as $\cI not working as an alias for $^I, and
124their usage not being portable to non-ASCII platforms: While $^T will work
dcc95d06 125everywhere, \cT is whitespace in EBCDIC. [perl #119123]
a3fb66a4 126
ba03bc34 127=head1 Performance Enhancements
a3fb66a4 128
ba03bc34 129=over 4
a3fb66a4 130
2c99af42
SH
131=item *
132
e1c60bf3
SH
133The trie performance enhancement for regular expressions has now been extended
134to those compiled under C</iaa>.
2c99af42 135
c0ca71c9 136=back
42bff0d9 137
ba03bc34 138=head1 Modules and Pragmata
195e3ea0 139
ba03bc34 140=head2 Updated Modules and Pragmata
42bff0d9 141
38663f11 142=over 4
42bff0d9
DG
143
144=item *
145
082a4c42
SH
146L<autodie> has been upgraded from version 2.20 to 2.21.
147
148Numerous improvements have been made, many speed-related. See the F<Changes>
149file in the CPAN distribution for full details.
150
151=item *
152
8c24c1f7 153L<B> has been upgraded from version 1.45 to 1.46.
00c5962f
TC
154
155The fix for [perl #118525] introduced a regression in the behaviour of
e1c60bf3 156C<B::CV::GV>, changing the return value from a C<B::SPECIAL> object on a
99366d6d
SH
157C<NULL> C<CvGV> to C<undef>. C<B::CV::GV> again returns a C<B::SPECIAL> object
158in this case. [perl #119351]
00c5962f 159
0ac7511e
SH
160B version 1.44 (Perl 5.19.2) introduced four new B::OP methods, C<slabbed>,
161C<savefree>, C<static> and C<folded>, but these have never actually worked
162until now. They used to croak.
3b6e1650 163
00c5962f
TC
164=item *
165
8c24c1f7
SH
166L<B::Concise> has been upgraded from version 0.98 to 0.99.
167
479090d3
SH
168The handling of the C<glob> operator, broken since Perl 5.17.6, has been fixed
169and handling of the new kvaslice and kvhslice operators have been added.
170
171=item *
172
173L<B::Deparse> has been upgraded from version 1.22 to 1.23.
174
175The new kvaslice and kvhslice operators have been added.
8c24c1f7
SH
176
177=item *
178
d5dcec3a
Z
179L<Carp> has been upgraded from version 1.31 to 1.32.
180
6ffbec2c
Z
181=over 4
182
183=item *
184
e1c60bf3
SH
185In stack traces, subroutine arguments that are strings are now quoted in a
186consistent manner, regardless of what characters they contain and how they're
187internally represented.
6ffbec2c
Z
188
189=item *
190
84d7ce3c
SH
191C<Carp> also now shows subroutine arguments that are references to regexp
192objects in a consistent manner in stack traces.
193
194=item *
195
99366d6d 196C<Carp> now takes care not to clobber the status variables $! and $^E.
0a9b5e6e
FC
197
198=item *
199
bf4588d0 200C<Carp> now won't vivify the C<overload::StrVal> glob or subroutine or the
bd098b9a 201C<overload> stash.
6ffbec2c
Z
202
203=item *
204
e1c60bf3 205C<Carp> now avoids some unwanted Unicode warnings on older Perls. This doesn't
99366d6d 206affect behaviour with current Perls.
6ffbec2c
Z
207
208=item *
209
e1c60bf3
SH
210C<Carp::Heavy> detects version mismatch with C<Carp>, to give a good error
211message if a current (stub) C<Carp::Heavy> gets loaded by an old C<Carp> that
212expects C<Carp::Heavy> to provide subroutines.
d5dcec3a 213
6ffbec2c
Z
214=back
215
c963f488
SH
216=item *
217
3a76eb28
SH
218L<charnames> has been upgraded from version 1.38 to 1.39.
219
220This module now works on EBCDIC platforms.
221
222=item *
223
bfae5bde
SH
224L<CPAN> has been upgraded from version 2.00 to 2.03-TRIAL.
225
226Numerous updates and bug fixes are incorporated. See the F<Changes> file for
227full details.
228
229=item *
230
53bb269a
SH
231L<CPAN::Meta> has been upgraded from version 2.132140 to 2.132510.
232
233No changes have been made to the installed code other than the version bump to
234keep in sync with the latest CPAN release.
235
236=item *
237
202c41cb
SH
238L<CPAN::Meta::Requirements> has been upgraded from version 2.122 to 2.123.
239
e1c60bf3
SH
240No changes have been made to the installed code other than the version bump to
241keep in sync with the latest CPAN release.
202c41cb
SH
242
243=item *
244
8c24c1f7
SH
245L<Data::Dumper> has been upgraded from version 2.148 to 2.149.
246
5b903226
SH
247This upgrade is part of a larger change to make the array interface 64-bit safe
248by using SSize_t instead of I32 for array indices.
8c24c1f7 249
2f92fb87
SH
250In addition, an EBCDIC fix has been applied.
251
8c24c1f7
SH
252=item *
253
254L<Devel::Peek> has been upgraded from version 1.13 to 1.14.
255
5b903226
SH
256This upgrade is part of a larger change to preserve referential identity when
257passing C<undef> to a subroutine by using NULL rather than &PL_sv_undef for
81b5a3e5 258non-existent array elements.
8c24c1f7 259
2f92fb87
SH
260In addition, C<Dump> with no args was broken in Perl 5.19.3, but has now been
261fixed.
262
8c24c1f7
SH
263=item *
264
3657f3c0
SH
265L<diagnostics> has been upgraded from version 1.32 to 1.33.
266
267C<=back> is now treated as the end of a warning description, thus keeping any
268trailing data in the file from showing up as part of the last warning's
269description. [perl #119817]
270
271=item *
272
8c24c1f7
SH
273L<DynaLoader> has been upgraded from version 1.19 to 1.20.
274
5b903226
SH
275The documentation now makes it clear, as has always been the case, that
276C<dl_unload_file> is only called automatically to unload all loaded shared
277objects if the perl interpreter was built with the C macro
b228daaa 278DL_UNLOAD_ALL_AT_EXIT defined. Support for GNU DLD has also been removed.
5b903226
SH
279
280=item *
281
369b9ffe 282L<Encode> has been upgraded from version 2.52 to 2.55.
f2c09143
SH
283
284An erroneous early return in C<decode_utf8> has been removed, and a bug in
369b9ffe
SH
285C<_utf8_on> under COW has been fixed. Encode also now uses L<parent> rather
286than L<base> throughout.
f2c09143
SH
287
288=item *
289
820689a1
SH
290L<Errno> has been upgraded from version 1.19 to 1.20.
291
292The list of E* constants exported on Windows has been updated to reflect the
293changes made in the assignment of sockets error codes to $! (see
294L</Incompatible Changes>).
295
296=item *
297
33826e50
SH
298L<Exporter> has been upgraded from version 5.69 to 5.70.
299
300A number of typos have been corrected in the documentation.
301
302=item *
303
a0e78e9f 304L<ExtUtils::CBuilder> has been upgraded from version 0.280205 to 0.280212.
2f92fb87 305
a0e78e9f
SH
306No changes have been made to the installed code other than the version bump to
307keep in sync with the latest CPAN release.
2f92fb87
SH
308
309=item *
310
33826e50
SH
311L<ExtUtils::Command> has been upgraded from version 1.17 to 1.18.
312
313No changes have been made to the installed code other than the version bump to
314keep in sync with the latest CPAN release.
315
316=item *
317
3a76eb28 318L<ExtUtils::MakeMaker> has been upgraded from version 6.72 to 6.76.
5b903226
SH
319
320Numerous updates and bug fixes are incorporated. See the F<Changes> file for
321full details.
8c24c1f7
SH
322
323=item *
324
1d0e852c 325L<ExtUtils::ParseXS> has been upgraded from version 3.21 to 3.23.
f2c09143 326
99366d6d
SH
327Unquoted "here-doc" markers for typemaps can now be optionally followed by a
328semicolon, just like quoted markers. [perl #119761]
f2c09143
SH
329
330=item *
331
67323063
SH
332L<File::Copy> has been upgraded from version 2.27 to 2.28.
333
334The documentation of C<copy> now makes it clear that trying to copy a file into
335a non-existent directory is not supported. [perl #119539]
336
337=item *
338
77f1e6e4
SH
339L<File::Find> has been upgraded from version 1.24 to 1.25.
340
341Better diagnostics are now provided in the case of a failed C<chdir>.
342
343=item *
344
610ee5e3
TC
345L<File::Glob> has been upgraded from version 1.20 to 1.21.
346
99366d6d
SH
347C<glob> now warns in the context of C<use warnings "syscalls";> if the supplied
348pattern has an internal NUL (C<"\0">) character.
610ee5e3 349
d5dcec3a
Z
350=item *
351
479090d3
SH
352L<FileCache> has been upgraded from version 1.08 to 1.09.
353
354This upgrade is part of a larger change to use L<parent> rather than L<base>.
355
356=item *
357
358L<Hash::Util::FieldHash> has been upgraded from version 1.12 to 1.13.
359
360This upgrade is part of a larger change to use L<parent> rather than L<base>.
361
362=item *
363
0f07ea36 364L<HTTP::Tiny> has been upgraded from version 0.034 to 0.035.
4403b774
SH
365
366Encoded data from C<post_form> now preserves term order if data is provided as
367an array reference. (They are still sorted for consistency if provided as a
368hash reference.)
369
370=item *
371
3a76eb28
SH
372L<I18N::LangTags> has been upgraded from version 0.39 to 0.40.
373
374Bosnian has now joined Croatian and Serbian in the lists of mutually
99366d6d 375intelligible Slavic languages. [perl #72594]
3a76eb28
SH
376
377=item *
378
77f1e6e4
SH
379L<IO> has been upgraded from version 1.28 to 1.29.
380
381A minor internals-only change has been made to the XS code.
382
383=item *
384
6136a160
SH
385L<IO::Socket> has been upgraded from version 1.36 to 1.37.
386
387The C<connect> method has been updated in the light of changes made in the
388assignment of sockets error codes to $! on Windows (see L</Incompatible
389Changes>).
390
391=item *
392
e1c60bf3 393L<IPC::Open3> has been upgraded from version 1.15 to 1.16.
8c24c1f7 394
5b903226
SH
395This upgrade is part of a larger change to preserve referential identity when
396passing C<undef> to a subroutine by using NULL rather than &PL_sv_undef for
81b5a3e5 397non-existent array elements.
8c24c1f7
SH
398
399=item *
400
6136a160
SH
401L<JSON::PP> has been patched from version 2.27202 to 2.27202_01.
402
403A precedence issue has been fixed in the return value of a private subroutine.
404
405=item *
406
a0109759
SH
407L<Locale::Codes> has been upgraded from version 3.26 to 3.27.
408
409New codes have been added and the (deprecated) set of FIPS-10 country codes has
410been removed.
411
412=item *
413
a8479f0e
TC
414L<Math::BigInt> has been upgraded from version 1.9992 to 1.9993.
415
e1c60bf3 416Cleaned up the L<Math::BigInt> and L<Math::BigFloat> documentation to be more
99366d6d 417consistent with other Perl documentation. [perl #86686]
a8479f0e 418
99366d6d 419Added a C<bint> method for rounding towards zero. [perl #85296]
a8479f0e
TC
420
421=item *
422
8c24c1f7
SH
423L<Math::BigInt::FastCalc> has been upgraded from version 0.30 to 0.31.
424
5b903226
SH
425This upgrade is part of a larger change to make the array interface 64-bit safe
426by using SSize_t instead of I32 for array indices.
8c24c1f7
SH
427
428=item *
429
2a21e867 430L<Module::CoreList> has been upgraded from version 2.97 to 2.99.
37287258
SH
431
432The list of Perl versions covered has been updated.
1fdd5e53 433
0ac7511e
SH
434A function C<is_core> has been added, which returns true if the specified
435module was bundled with Perl. Optionally you can specify a minimum version of
436the module, and the specific version of Perl you're interested in (defaults to
437$^V, the running version of Perl).
2a21e867 438
68cdd4b5
SH
439=item *
440
6c52f6c9 441L<Module::Load::Conditional> has been upgraded from version 0.54 to 0.58.
0022aab5 442
99366d6d 443C<requires> has been made more robust. [cpan #83728]
0022aab5
SH
444
445=item *
446
979f1f2b 447L<Module::Metadata> has been upgraded from version 1.000014 to 1.000018.
68cdd4b5
SH
448
449The module's DESCRIPTION has been re-worded regarding safety/security to
99366d6d 450satisfy CVE-2013-1437. Also, versions are now detainted if needed. [cpan
bff978fa 451#88576]
68cdd4b5 452
93f72154
SH
453=item *
454
e1c60bf3 455L<mro> has been upgraded from version 1.13 to 1.14.
8c24c1f7 456
5b903226
SH
457This upgrade is part of a larger change to make the array interface 64-bit safe
458by using SSize_t instead of I32 for array indices.
8c24c1f7
SH
459
460=item *
461
479090d3
SH
462L<Opcode> has been upgraded from version 1.25 to 1.26.
463
464The new kvaslice and kvhslice operators have been added.
465
466=item *
467
11100026 468L<parent> has been upgraded from version 0.226 to 0.228.
e1c60bf3
SH
469
470No changes have been made to the installed code other than the version bump to
471keep in sync with the latest CPAN release.
472
473=item *
474
545c8cda
SH
475L<Parse::CPAN::Meta> has been upgraded from version 1.4405 to 1.4407.
476
477No changes have been made to the installed code other than the version bump to
478keep in sync with the latest CPAN release.
479
480=item *
481
ba58de91 482L<Perl::OSType> has been upgraded from version 1.003 to 1.005.
93f72154
SH
483
484The Unix OSType 'bitrig' has been added.
485
8c24c1f7
SH
486=item *
487
dd741cc9
SH
488L<perlfaq> has been upgraded from version 5.0150043 to 5.0150044.
489
490The use of C<gensym> in a number of examples has been removed, the use of C<&>
491in subroutine calls is now clarified and several new questions have been
492answered.
493
494=item *
495
479090d3
SH
496L<Pod::Html> has been upgraded from version 1.20 to 1.21.
497
498This upgrade is part of a larger change to use L<parent> rather than L<base>.
499
500=item *
501
820689a1
SH
502L<POSIX> has been upgraded from version 1.34 to 1.35.
503
504The list of E* constants exported on Windows has been updated to reflect the
505changes made in the assignment of sockets error codes to $! (see
506L</Incompatible Changes>).
507
508=item *
509
8c24c1f7
SH
510L<re> has been upgraded from version 0.25 to 0.26.
511
94902151
SH
512This upgrade is part of a larger change to support 64-bit string lengths in the
513regular expression engine.
8c24c1f7
SH
514
515=item *
516
e1c60bf3
SH
517L<Scalar::Util> has been upgraded from version 1.31 to 1.32.
518
519The documentation of C<blessed> has been improved to mention the fact that
520package "0" is defined but false.
521
522=item *
523
406cccc2
SH
524L<Socket> has been upgraded from version 2.011 to 2.012.
525
99366d6d
SH
526Syntax errors when building on the WinCE platform have been fixed. [cpan
527#87389]
406cccc2
SH
528
529=item *
530
8c24c1f7
SH
531L<Storable> has been upgraded from version 2.46 to 2.47.
532
5b903226
SH
533This upgrade is part of a larger change to preserve referential identity when
534passing C<undef> to a subroutine by using NULL rather than &PL_sv_undef for
81b5a3e5 535non-existent array elements.
8c24c1f7
SH
536
537=item *
538
2f92fb87
SH
539L<Term::ReadLine> has been upgraded from version 1.10 to 1.14.
540
541Term::ReadLine::EditLine support has been added.
542
543=item *
544
6136a160
SH
545L<Test::Simple> has been patched from version 0.98 to 0.98_06.
546
547A precedence issue has been fixed in the return value of a private subroutine
548in L<Test::Builder>.
549
550=item *
551
3a76eb28
SH
552L<Time::Piece> has been upgraded from version 1.22 to 1.23.
553
554Day of year parsing (like "%y%j") has been fixed.
555
556=item *
557
60f577e0
SH
558L<Unicode::Collate> has been upgraded from version 0.98 to 0.99.
559
e1c60bf3
SH
560By default, out-of-range values are replaced with C<U+FFFD> (REPLACEMENT
561CHARACTER) when C<UCA_Version> E<gt>= 22, or ignored when C<UCA_Version> E<lt>=
56220. When C<UCA_Version> E<gt>= 22, the weights of out-of-range values can be
563overridden.
60f577e0
SH
564
565=item *
566
3a76eb28
SH
567L<Unicode::UCD> has been upgraded from version 0.53 to 0.54.
568
569This module now works on EBCDIC platforms.
570
571=item *
572
5565c738
SH
573L<version> has been upgraded from version 0.9903 to 0.9904.
574
575No changes have been made to the installed code other than the version bump to
576keep in sync with the latest CPAN release.
577
578=item *
579
8c24c1f7
SH
580L<warnings> has been upgraded from version 1.18 to 1.19.
581
5b903226 582The C<syscalls> warnings category has been added to check for embedded NUL
b8f07b9f 583(C<"\0">) characters in pathnames and string arguments to other system calls.
84d7ce3c 584[perl #117265]
8c24c1f7
SH
585
586=item *
587
588L<XS::Typemap> has been upgraded from version 0.10 to 0.11.
589
6d53e62b
SH
590This upgrade is part of the change to remove the uninitialized warnings
591exemption for uninitialized values returned by XSUBs (see the L</Selected Bug
592Fixes> section).
99366d6d 593
583aa5c2
RS
594=back
595
ba03bc34 596=head1 Documentation
8fecfff0 597
ba03bc34 598=head2 New Documentation
8fecfff0 599
1944fb52 600=head3 L<perlrepository>
195e3ea0 601
1944fb52
SH
602This document was removed (actually, renamed L<perlgit> and given a major
603overhaul) in Perl 5.13.10, causing Perl documentation websites to show the now
604out of date version in Perl 5.12 as the latest version. It has now been
605restored in stub form, directing readers to current information.
195e3ea0 606
ba03bc34 607=head2 Changes to Existing Documentation
195e3ea0 608
1944fb52
SH
609=head3 L<perldata>
610
611=over 4
612
613=item *
614
615New sections have been added to document the new index/value array slice and
616key/value hash slice syntax.
617
2d8e8368
SH
618=back
619
620=head3 L<perldebguts>
a71a93a7 621
2d8e8368 622=over 4
a71a93a7
TC
623
624=item *
625
2d8e8368
SH
626The C<&DB::goto> and C<&DB::lsub> debugger subroutines are now documented.
627[perl #77680]
a71a93a7 628
1944fb52
SH
629=back
630
631=head3 L<perlguts>
632
633=over 4
634
635=item *
636
637Numerous minor changes have been made to reflect changes made to the perl
638internals in this release.
639
640=back
195e3ea0 641
1944fb52 642=head3 L<perlhack>
a3fb66a4
SH
643
644=over 4
645
646=item *
647
1944fb52
SH
648The L<SUPER QUICK PATCH GUIDE|perlhack/SUPER QUICK PATCH GUIDE> section has
649been updated.
a3fb66a4
SH
650
651=back
652
2d8e8368
SH
653=head3 L<perlsub>
654
655=over 4
656
657=item *
658
659A list of subroutine names used by the perl implementation is now included.
660[perl #77680]
661
662=back
663
c0ca71c9
AP
664=head1 Diagnostics
665
666The following additions or changes have been made to diagnostic output,
667including warnings and fatal error messages. For the complete list of
668diagnostic messages, see L<perldiag>.
669
670=head2 New Diagnostics
671
12dcbffb 672=head3 New Errors
583aa5c2 673
38663f11 674=over 4
583aa5c2 675
b8a02ff1 676=item *
583aa5c2 677
35d27e9c 678L<delete argument is indexE<sol>value array slice, use array slice|perldiag/"delete argument is index/value array slice, use array slice">
4a0af295
SH
679
680(F) You used index/value array slice syntax (C<%array[...]>) as the argument to
681C<delete>. You probably meant C<@array[...]> with an @ symbol instead.
682
683=item *
684
35d27e9c 685L<delete argument is keyE<sol>value hash slice, use hash slice|perldiag/"delete argument is key/value hash slice, use hash slice">
4a0af295
SH
686
687(F) You used key/value hash slice syntax (C<%hash{...}>) as the argument to
688C<delete>. You probably meant C<@hash{...}> with an @ symbol instead.
689
b8a02ff1 690=back
583aa5c2 691
12dcbffb 692=head3 New Warnings
96d496e4 693
38663f11 694=over 4
b8a02ff1
DG
695
696=item *
697
610ee5e3
TC
698L<Invalid \0 character in %s for %s: %s\0%s|perldiag/"Invalid \0 character in %s for %s: %s\0%s">
699
b8f07b9f 700(W syscalls) Embedded \0 characters in pathnames or other system call arguments
99366d6d 701produce a warning as of 5.20. The parts after the \0 were formerly ignored by
b8f07b9f 702system calls.
487a71ff 703
4a0af295
SH
704=item *
705
706L<Possible precedence issue with control flow operator|perldiag/"Possible precedence issue with control flow operator">
707
708(W syntax) There is a possible problem with the mixing of a control flow
709operator (e.g. C<return>) and a low-precedence operator like C<or>. Consider:
710
711 sub { return $a or $b; }
712
713This is parsed as:
714
715 sub { (return $a) or $b; }
716
717Which is effectively just:
718
719 sub { return $a; }
720
721Either use parentheses or the high-precedence variant of the operator.
722
723Note this may be also triggered for constructs like:
724
725 sub { 1 if die; }
726
727=item *
728
729L<Scalar value %%s[%s] better written as $%s[%s]|perldiag/"Scalar value %%s[%s] better written as $%s[%s]">
730
731(W syntax) In scalar context, you've used an array index/value slice (indicated
732by %) to select a single element of an array. Generally it's better to ask for
733a scalar value (indicated by $). The difference is that C<$foo[&bar]> always
734behaves like a scalar, both in the value it returns and when evaluating its
735argument, while C<%foo[&bar]> provides a list context to its subscript, which
736can do weird things if you're expecting only one subscript. When called in
737list context, it also returns the index (what C<&bar> returns) in addition to
738the value.
739
740=item *
741
742L<Scalar value %%s{%s} better written as $%s{%s}|perldiag/"Scalar value %%s{%s} better written as $%s{%s}">
743
744(W syntax) In scalar context, you've used a hash key/value slice (indicated by
745%) to select a single element of a hash. Generally it's better to ask for a
746scalar value (indicated by $). The difference is that C<$foo{&bar}> always
747behaves like a scalar, both in the value it returns and when evaluating its
748argument, while C<@foo{&bar}> and provides a list context to its subscript,
749which can do weird things if you're expecting only one subscript. When called
750in list context, it also returns the key in addition to the value.
751
dcc95d06
SH
752=item *
753
754L<Use of literal control characters in variable names is deprecated|perldiag/"Use of literal control characters in variable names is deprecated">
755
756(D deprecated) Using literal control characters in the source to refer to the
757^FOO variables, like $^X and ${^GLOBAL_PHASE} is now deprecated. This only
758affects code like $\cT, where \cT is a control in the source code: ${"\cT"} and
759$^T remain valid.
760
12dcbffb 761=back
1310e590 762
ba03bc34
SH
763=head2 Changes to Existing Diagnostics
764
12dcbffb 765=over 4
e727f86a 766
81ca6d44
FC
767=item *
768
c1d900c3
BF
769Warnings and errors from the regexp engine are now UTF-8 clean
770
771=item *
772
99366d6d
SH
773The "Unknown switch condition" error message has some slight changes. This
774error triggers when there is an unknown condition in a C<(?(foo))> conditional.
775The error message used to read:
c1d900c3
BF
776
777 Unknown switch condition (?(%s in regex;
778
99366d6d
SH
779But what %s could be was mostly up to luck. For C<(?(foobar))>, you might have
780seen "fo" or "f". For Unicode characters, you would generally get a corrupted
781string. The message has been changed to read:
c1d900c3
BF
782
783 Unknown switch condition (?(...)) in regex;
784
99366d6d
SH
785Additionally, the C<'E<lt>-- HERE'> marker in the error will now point to the
786correct spot in the regex.
e38fc308 787
4a0af295
SH
788=item *
789
790The "%s "\x%X" does not map to Unicode" warning is now correctly listed as a
791severe warning rather than as a fatal error.
792
ba03bc34 793=back
a34da6c4 794
ba03bc34 795=head1 Utility Changes
a34da6c4 796
b2d74da6 797=head3 L<find2perl>
47a7c93d 798
12dcbffb 799=over 4
b5a80c26 800
7f1d4316
FC
801=item *
802
99366d6d 803L<find2perl> now handles C<?> wildcards correctly. [perl #113054]
7f1d4316 804
ba03bc34 805=back
ef947715 806
ba03bc34 807=head1 Configuration and Compilation
ef947715 808
12dcbffb 809=over 4
21c01741 810
467582e8
FC
811=item *
812
e1c60bf3
SH
813The F<Makefile.PL> for C<SDBM_File> now generates a better F<Makefile>, which
814avoids a race condition during parallel makes, which could cause the build to
815fail. This is the last known parallel make problem (on *nix platforms), and
816therefore we believe that a parallel make should now always be error free.
4d106cc5
NC
817
818=for comment
819
820Strictly only for a build where build files such as F<Makefile.SH> have not
821been updated by C<git> in an already configured and built tree.
467582e8 822
ba03bc34 823=back
64da853d 824
ba03bc34 825=head1 Testing
8847717e 826
ba03bc34 827=over 4
f1b856da 828
eaed284b
FC
829=item *
830
5b903226 831The test script F<t/bigmem/regexp.t> has been added to test that regular
28f52e64 832expression matches on very large strings now succeed as expected.
8c24c1f7
SH
833
834=item *
835
215588ba
SH
836A bug that was fixed in Perl 5.15.4 is now tested by the new test script
837F<t/io/eintr_print.t>. [perl #119097]
838
839=item *
840
b895ac6f
SH
841The new test scripts F<t/op/kvaslice.t> and F<t/op/kvhslice.t> test the new
842index/value array slice and key/value hash slice syntax respectively.
843
844=item *
845
5b903226
SH
846Various cases of C<die>, C<last>, C<goto> and C<exit> triggering C<DESTROY> are
847now tested by the new test script F<t/op/rt119311.t>.
8c24c1f7
SH
848
849=item *
850
215588ba
SH
851The new test script F<t/op/waitpid.t> tests the fix for [perl #85228] (see
852L</Selected Bug Fixes>).
853
854=item *
855
b895ac6f
SH
856The latest copyright years in the top-level F<README> file and the B<perl -v>
857output are now tested as matching each other by the new test script
858F<t/porting/copyright.t>
859
860=item *
861
99366d6d
SH
862The new test script F<t/win32/signal.t> tests that $! and $^E are now preserved
863across signal handlers by the Win32 signal emulation code.
8c24c1f7
SH
864
865=item *
866
5b903226
SH
867The test script F<t/x2p/find2perl.t> has been added to test the F<find2perl>
868program on platforms where it is practical to do so.
eaed284b 869
ba03bc34 870=back
0335212c 871
ba03bc34 872=head1 Platform Support
0335212c 873
ba03bc34 874=head2 New Platforms
019705bc 875
ba03bc34 876=over 4
25921d77 877
84d7ce3c
SH
878=item FreeMiNT
879
880Support has been added for FreeMiNT, a free open-source OS for the Atari ST
881system and its successors, based on the original MiNT that was officially
882adopted by Atari.
883
44d412d1 884=item Bitrig
25921d77 885
489ee6b6 886Compile support has been added for Bitrig, a fork of OpenBSD.
28ea507e 887
ba03bc34 888=back
28ea507e 889
ba03bc34 890=head2 Discontinued Platforms
28ea507e 891
99366d6d
SH
892Configure hints and conditional code for several very old platforms has been
893removed. We have not received reports for these in many years, typically not
894since Perl 5.6.0.
7b0e9f13 895
ba03bc34 896=over 4
074d6753 897
7b0e9f13 898=item AT&T 3b1
074d6753 899
99366d6d
SH
900Configure support for the 3b1, also known as the AT&T Unix PC (and the similar
901AT&T 7300), has been removed.
4e5b563d 902
ba03bc34 903=back
4e5b563d 904
ba03bc34 905=head2 Platform-Specific Notes
ee818f56 906
ba03bc34 907=over 4
c054cc81 908
14a04b52
CB
909=item VMS
910
0ac7511e
SH
911The C<PERL_ENV_TABLES> feature to control the population of %ENV at perl
912start-up was broken in Perl 5.16.0 but has now been fixed.
14a04b52 913
37b0da2e 914=item Win32
ff3b1402 915
0ac7511e
SH
916C<rename> and C<link> on Win32 now set $! to ENOSPC and EDQUOT when
917appropriate. [perl #119857]
ff3b1402 918
8c24c1f7 919=item WinCE
c054cc81 920
942cddc4
SH
921Perl now builds again on WinCE, following locale-related breakage (WinCE has
922non-existent locale support) introduced around 5.19.1. [perl #119443]
923
99366d6d 924The building of XS modules has largely been restored. Several still cannot
5b903226
SH
925(yet) be built but it is now possible to build Perl on WinCE with only a couple
926of further patches (to L<Socket> and L<ExtUtils::MakeMaker>), hopefully to be
927incorporated soon.
efcbb8b2 928
846aaad8
CBW
929=item GNU/Hurd
930
931The BSD compatibility library C<libbsd> is no longer required for builds.
932
ba03bc34 933=back
efcbb8b2 934
ba03bc34 935=head1 Internal Changes
36813eeb 936
ba03bc34 937=over 4
52937067 938
6760cac5
FC
939=item *
940
99366d6d
SH
941The internal representation has changed for the match variables $1, $2 etc.,
942$`, $&, $', ${^PREMATCH}, ${^MATCH} and ${^POSTMATCH}. It uses slightly less
943memory, avoids string comparisons and numeric conversions during lookup, and
944uses 23 fewer lines of C. This change should not affect any external code.
671f9ff7 945
c2ee494e
FC
946=item *
947
948Arrays now use NULL internally to represent unused slots, instead of
99366d6d
SH
949&PL_sv_undef. &PL_sv_undef is no longer treated as a special value, so
950av_store(av, 0, &PL_sv_undef) will cause element 0 of that array to hold a
951read-only undefined scalar. C<$array[0] = anything> will croak and
c2ee494e
FC
952C<\$array[0]> will compare equal to C<\undef>.
953
6a67a797
TC
954=item *
955
956The SV returned by HeSVKEY_force() now correctly reflects the UTF8ness
957of the underlying hash key when that key is not stored as a SV. [perl
958#79074]
959
972690a1
KW
960=item *
961
0ac7511e
SH
962Certain rarely used functions and macros available to XS code are now, or are
963planned to be, deprecated. These are:
972690a1
KW
964C<utf8n_to_uvuni> (use C<utf8_to_uvchr_buf> instead),
965C<utf8_to_uni_buf> (use C<utf8_to_uvchr_buf> instead),
966C<valid_utf8_to_uvuni> (use C<utf8_to_uvchr_buf> instead),
967C<uvuni_to_utf8> (use C<uvchr_to_utf8> instead),
968C<NATIVE_TO_NEED> (this did not work properly anyway),
969and C<ASCII_TO_NEED> (this did not work properly anyway).
970
971Starting in this release, almost never does application code need to
972distinguish between the platform's character set and Latin1, on which the
973lowest 256 characters of Unicode are based.
974
ba03bc34 975=back
671f9ff7 976
ba03bc34 977=head1 Selected Bug Fixes
912a9a8f 978
ba03bc34 979=over 4
0d25b9d4 980
a82207ba
FC
981=item *
982
99366d6d 983The value of $^E is now saved across signal handlers on Windows. [perl #85104]
18e2e6cd 984
85037c5c
FC
985=item *
986
99366d6d
SH
987A lexical filehandle (as in C<open my $fh...>) is usually given a name based on
988the current package and the name of the variable, e.g. "main::$fh". Under
989recursion, the filehandle was losing the "$fh" part of the name. This has been
990fixed.
85037c5c 991
0664879b
FC
992=item *
993
99366d6d
SH
994Perl 5.19.3 accidentally extended the previous bug to all closures, even when
995not called recursively, i.e. lexical handles in closure would always be called
996"main::" or "MyPackage::" etc. This has been fixed.
0664879b 997
343e7167
FC
998=item *
999
99366d6d
SH
1000Uninitialized values returned by XSUBs are no longer exempt from uninitialized
1001warnings. [perl #118693]
343e7167 1002
1261f9a2
FC
1003=item *
1004
99366d6d 1005C<elsif ("")> no longer erroneously produces a warning about void context.
1261f9a2
FC
1006[perl #118753]
1007
c2ee494e
FC
1008=item *
1009
99366d6d
SH
1010Passing C<undef> to a subroutine now causes @_ to contain the same read-only
1011undefined scalar that C<undef> returns. Furthermore, C<exists $_[0]> will now
1012return true if C<undef> was the first argument. [perl #7508, #109726]
c2ee494e 1013
21c314ca
FC
1014=item *
1015
81b5a3e5
SH
1016Passing a non-existent array element to a subroutine does not usually
1017autovivify it unless the subroutine modifies its argument. This did not work
1018correctly with negative indices and with non-existent elements within the
1019array. The element would be vivified immediately. The delayed vivification
1020has been extended to work with those. [perl #118691]
21c314ca 1021
7a7c28da
FC
1022=item *
1023
99366d6d
SH
1024Assigning references or globs to the scalar returned by $#foo after the @foo
1025array has been freed no longer causes assertion failures on debugging builds
1026and memory leaks on regular builds.
7a7c28da 1027
8bdbe216
FC
1028=item *
1029
99366d6d
SH
1030Perl 5.19.2 threw line numbers off after some cases of line breaks following
1031keywords, such as
8bdbe216
FC
1032
1033 1 unless
1034 1;
1035
1036This has been fixed. [perl #118931]
1037
96c0ab99
FC
1038=item *
1039
99366d6d
SH
1040On 64-bit platforms, large ranges like 1..1000000000000 no longer crash, but
1041eat up all your memory instead. [perl #119161]
96c0ab99 1042
c2823449
FC
1043=item *
1044
1045C<__DATA__> now puts the C<DATA> handle in the right package, even if the
1046current package has been renamed through glob assignment.
1047
ab82aa51
FC
1048=item *
1049
1050The string position set by C<pos> could shift if the string changed
1051representation internally to or from utf8. This could happen, e.g., with
1052references to objects with string overloading.
1053
c4403db5
FC
1054=item *
1055
cabe2f6f
FC
1056Taking references to the return values of two C<pos> calls with the same
1057argument, and then assigning a reference to one and C<undef> to the other,
1058could result in assertion failures or memory leaks.
1059
1060=item *
1061
81b5a3e5 1062Elements of @- and @+ now update correctly when they refer to non-existent
99366d6d
SH
1063captures. Previously, a referenced element (C<$ref = \$-[1]>) could refer to
1064the wrong match after subsequent matches.
c4403db5 1065
e7f2d651
FC
1066=item *
1067
99366d6d
SH
1068When C<die>, C<last>, C<next>, C<redo>, C<goto> and C<exit> unwind the scope,
1069it is possible for C<DESTROY> recursively to call a subroutine or format that
1070is currently being exited. It that case, sometimes the lexical variables
1071inside the sub would start out having values from the outer call, instead of
1072being undefined as they should. This has been fixed. [perl #119311]
e7f2d651 1073
d66ad208
FC
1074=item *
1075
99366d6d 1076${^MPEN} is no longer treated as a synonym for ${^MATCH}.
d66ad208 1077
ab70e266
FC
1078=item *
1079
1080Perl now tries a little harder to return the correct line number in
1081C<(caller)[2]>. [perl #115768]
1082
ae66f305
FC
1083=item *
1084
99366d6d
SH
1085Line numbers inside multiline quote-like operators are now reported correctly.
1086[perl #3643]
ae66f305
FC
1087
1088=item *
1089
99366d6d
SH
1090C<#line> directives inside code embedded in quote-like operators are now
1091respected.
ae66f305 1092
f8f2d1ac
FC
1093=item *
1094
bc86bb16
FC
1095Line numbers are now correct inside the second here-doc when two here-doc
1096markers occur on the same line.
1097
1098=item *
1099
99366d6d
SH
1100Starting with Perl 5.12, line numbers were off by one if the B<-d> switch was
1101used on the #! line. Now they are correct.
b3c26d51
FC
1102
1103=item *
1104
99366d6d
SH
1105Perl 5.19.2 inadvertently stopped some lines of code from being available to
1106the debugger if C<=E<gt>> occurred at the beginning of a line and the previous
1107line ended with a keyword. This is now fixed.
f8f2d1ac 1108
ac29d451
FC
1109=item *
1110
99366d6d
SH
1111Perl 5.19.2 allowed the PERL5DB environment variable to contain multiple lines
1112of code, but those lines were not made available to the debugger. Now they are
1113all stuffed into line number 0, accessible via C<$dbline[0]> in the debugger.
b3c26d51
FC
1114
1115=item *
1116
ac29d451
FC
1117An optimisation in Perl 5.18 made incorrect assumptions causing a bad
1118interaction with the L<Devel::CallParser> CPAN module. If the module was
99366d6d
SH
1119loaded then lexical variables declared in separate statements following a
1120C<my(...)> list might fail to be cleared on scope exit.
ac29d451 1121
f34cd7c8
FC
1122=item *
1123
99366d6d
SH
1124C<&xsub> and C<goto &xsub> calls now allow the called subroutine to autovivify
1125elements of @_.
f34cd7c8 1126
6f9296e1
FC
1127=item *
1128
99366d6d
SH
1129C<&xsub> and C<goto &xsub> no longer crash if *_ has been undefined and has no
1130ARRAY entry (i.e. @_ does not exist).
6f9296e1 1131
82d5eae5
FC
1132=item *
1133
1144b44d
FC
1134C<&xsub> and C<goto &xsub> now work with tied @_.
1135
1136=item *
1137
82d5eae5
FC
1138Overlong identifiers no longer cause a buffer overflow (and a crash). They
1139started doing so in Perl 5.18.
1140
cfbe45f9
FC
1141=item *
1142
99366d6d
SH
1143The warning "Scalar value @hash{foo} better written as $hash{foo}" now produces
1144far fewer false positives. In particular, C<@hash{+function_returning_a_list}>
1145and C<@hash{ qw "foo bar baz" }> no longer warn. The same applies to array
1146slices. [perl #28380, #114024]
cfbe45f9 1147
853f2d20
TC
1148=item *
1149
0ac7511e 1150C<$! = EINVAL; waitpid(0, WNOHANG);> no longer goes into an internal infinite
215588ba 1151loop. [perl #85228]
853f2d20 1152
84fd7372
FC
1153=item *
1154
1155Perl 5.19.3 accidentally caused C<\(1+2)> to return a reference to the same
1156mutable scalar each time, so that modifications affect future evaluations.
1157This has been fixed. [perl #119501]
1158
84d7ce3c
SH
1159=item *
1160
1161A possible segmentation fault in filehandle duplication has been fixed.
1162
ba03bc34 1163=back
18e2e6cd 1164
583aa5c2 1165=head1 Acknowledgements
a75569c0 1166
ba03bc34
SH
1167XXX Generate this with:
1168
1169 perl Porting/acknowledgements.pl v5.19.3..HEAD
f5b73711 1170
44691e6f
AB
1171=head1 Reporting Bugs
1172
e08634c5
SH
1173If you find what you think is a bug, you might check the articles recently
1174posted to the comp.lang.perl.misc newsgroup and the perl bug database at
1175http://rt.perl.org/perlbug/ . There may also be information at
1176http://www.perl.org/ , the Perl Home Page.
44691e6f 1177
e08634c5
SH
1178If you believe you have an unreported bug, please run the L<perlbug> program
1179included with your release. Be sure to trim your bug down to a tiny but
1180sufficient test case. Your bug report, along with the output of C<perl -V>,
1181will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
44691e6f
AB
1182
1183If the bug you are reporting has security implications, which make it
e08634c5
SH
1184inappropriate to send to a publicly archived mailing list, then please send it
1185to perl5-security-report@perl.org. This points to a closed subscription
1186unarchived mailing list, which includes all the core committers, who will be
1187able to help assess the impact of issues, figure out a resolution, and help
f9001595 1188co-ordinate the release of patches to mitigate or fix the problem across all
e08634c5
SH
1189platforms on which Perl is supported. Please only use this address for
1190security issues in the Perl core, not for modules independently distributed on
1191CPAN.
44691e6f
AB
1192
1193=head1 SEE ALSO
1194
e08634c5
SH
1195The F<Changes> file for an explanation of how to view exhaustive details on
1196what changed.
44691e6f
AB
1197
1198The F<INSTALL> file for how to build Perl.
1199
1200The F<README> file for general stuff.
1201
1202The F<Artistic> and F<Copying> files for copyright information.
1203
1204=cut