This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta: fatal error is an error, not a warning
[perl5.git] / Porting / perl5180delta.pod
CommitLineData
e5ba1bf1
FC
1=encoding utf8
2
3=head1 NAME
4
0bba4573 5perl5180delta - what is new for perl v5.18.0
e5ba1bf1
FC
6
7=head1 DESCRIPTION
8
0bba4573 9This document describes differences between the 5.16.0 release and the 5.18.0
e5ba1bf1
FC
10release.
11
dac2f7cf
RS
12If you are upgrading from an earlier release such as 5.16.0, first read
13L<perl5160delta>, which describes differences between 5.14.0 and 5.16.0.
e5ba1bf1 14
5946c067 15=head1 Core Enhancements
e5ba1bf1 16
d29861e7
RS
17=head2 New mechanism for experimental features
18
19Newly-added experimental features will now require this incantation:
20
21 no warnings "experimental::feature_name";
22 use feature "feature_name"; # would warn without the prev line
23
24There is a new warnings category, called "experimental", containing
25warnings that the L<feature> pragma emits when enabling experimental
26features.
27
28Newly-added experimental features will also be given special warning IDs,
29which consist of "experimental::" followed by the name of the feature. (The
30plan is to extend this mechanism eventually to all warnings, to allow them
31to be enabled or disabled individually, and not just by category.)
32
33By saying
34
35 no warnings "experimental::feature_name";
36
37you are taking responsibility for any breakage that future changes to, or
38removal of, the feature may cause.
39
40Existing experimental features may begin emitting these warnings, too. Please
41consult L<perlexperiment> for information on which features are considered
42experimental.
43
5946c067 44=head2 Hash overhaul
e5ba1bf1 45
5946c067
RS
46Changes to the implementation of hashes in perl 5.18.0 will be one of the most
47visible changes to the behavior of existing code. For the most part, these
48changes will be visible as two distinct hash variables now providing their
0309f1e2 49contents in a different order where it was previously identical. When
5946c067
RS
50encountering these changes, the key to cleaning up from them is to accept that
51B<hashes are unordered collections> and to act accordingly.
52
53=head3 Hash randomization
54
55The seed used by Perl's hash function is now random. This means that the
56order which keys/values will be returned from functions like C<keys()>,
57C<values()>, and C<each()> will differ from run to run.
58
59This change was introduced to make Perl's hashes more robust to algorithmic
60complexity attacks, and also because we discovered that it exposes hash
61ordering dependency bugs and makes them easier to track down.
62
63Toolchain maintainers might want to invest in additional infrastructure to
64test for things like this. Running tests several times in a row and then
65comparing results will make it easier to spot hash order dependencies in
66code. Authors are strongly encouraged not to expose the key order of
67Perl's hashes to insecure audiences.
68
69Further, every hash has its own iteration order, which should make it much
70more difficult to determine what the current hash seed is.
71
72=head3 New hash function: Murmurhash-32
73
74We have switched Perl's hash function to use Murmurhash-32, and added build
75support for several other hash functions. This new function is expected to
76perform equivalently to the old one for shorter strings and is faster for
77hashing longer strings.
78
79=head3 PERL_HASH_SEED enviornment variable now takes a hex value
80
81PERL_HASH_SEED no longer accepts an integer as a parameter, instead the
82value is expected to be a binary string encoded in hex. This is to make
83the infrastructure support hash seeds of arbitrary lengths which might
84exceed that of an integer. (SipHash uses a 16 byte seed).
85
86=head3 Hash::Util::hash_seed() now returns a string
87
88Hash::Util::hash_seed() now returns a string instead of an integer. This
89is to make the infrastructure support hash seeds of arbitrary lengths
90which might exceed that of an integer. (SipHash uses a 16 byte seed).
91
92=head3 Output of PERL_HASH_SEED_DEBUG has been changed
93
e4dc5aa5
S
94The environment variable PERL_HASH_SEED_DEBUG now makes perl show both the
95hash function perl was built with AND the seed, in hex, in use for that
5efcf109 96process. Code parsing this output, should it exist, must change to accommodate
e4dc5aa5 97the new format. Example of the new format:
5946c067
RS
98
99 $ PERL_HASH_SEED_DEBUG=1 ./perl -e1
100 HASH_FUNCTION = MURMUR3 HASH_SEED = 0x1476bb9f
e5ba1bf1 101
d29861e7 102=head2 Upgrade to Unicode 6.2
816361ee 103
d29861e7
RS
104Perl now supports the final version of Unicode 6.2. Earlier releases in
105the 5.17 series supported Unicode 6.2 beta versions. There were no
106substantive changes in the final Unicode 6.2 version from the most
107recent beta, included in Perl 5.17.4. A list of changes from Unicode
1086.1 is at L<http://www.unicode.org/versions/Unicode6.2.0>.
816361ee 109
7e7c78a1
RS
110=head2 Character name aliases may now include non-Latin1-range characters
111
112It is possible to define your own names for characters for use in
113C<\N{...}>, C<charnames::vianame()>, etc. These names can now be
114comprised of characters from the whole Unicode range. This allows for
115names to be in your native language, and not just English. Certain
116restrictions apply to the characters that may be used (you can't define
117a name that has punctuation in it, for example). See L<charnames/CUSTOM
118ALIASES>.
119
00785cb7
RS
120=head2 New DTrace probes
121
122The following new DTrace probes have been added:
123
124=over 4
125
7dac98c6 126=item *
00785cb7 127
7dac98c6 128C<op-entry>
00785cb7 129
7dac98c6
S
130=item *
131
132C<loading-file>
133
134=item *
135
136C<loaded-file>
00785cb7
RS
137
138=back
139
140=head2 C<${^LAST_FH}>
141
142This new variable provides access to the filehandle that was last read.
143This is the handle used by C<$.> and by C<tell> and C<eof> without
144arguments.
145
d29861e7 146=head2 Regular Expression Set Operations
00785cb7 147
d29861e7
RS
148This is an B<experimental> feature to allow matching against the union,
149intersection, etc., of sets of code points, similar to
150L<Unicode::Regex::Set>. It can also be used to extend C</x> processing
151to [bracketed] character classes, and as a replacement of user-defined
152properties, allowing more complex expressions than they do. See
f35ac54a 153L<perlrecharclass/Extended Bracketed Character Classes>.
00785cb7
RS
154
155=head2 Lexical subroutines
156
d29861e7 157This new feature is still considered B<experimental>. To enable it:
00785cb7
RS
158
159 use 5.018;
7a3f436e 160 no warnings "experimental::lexical_subs";
00785cb7
RS
161 use feature "lexical_subs";
162
163You can now declare subroutines with C<state sub foo>, C<my sub foo>, and
164C<our sub foo>. (C<state sub> requires that the "state" feature be
165enabled, unless you write it as C<CORE::state sub foo>.)
166
167C<state sub> creates a subroutine visible within the lexical scope in which
168it is declared. The subroutine is shared between calls to the outer sub.
169
170C<my sub> declares a lexical subroutine that is created each time the
171enclosing block is entered. C<state sub> is generally slightly faster than
172C<my sub>.
173
174C<our sub> declares a lexical alias to the package subroutine of the same
175name.
176
d29861e7 177For more information, see L<perlsub/Lexical Subroutines>.
00785cb7 178
94b31d3f
RS
179=head2 Computed Labels
180
181The loop controls C<next>, C<last> and C<redo>, and the special C<dump>
182operator, now allow arbitrary expressions to be used to compute labels at run
183time. Previously, any argument that was not a constant was treated as the
184empty string.
185
0fef449b
RS
186=head2 More CORE:: subs
187
188Several more built-in functions have been added as subroutines to the
0ec66c93 189CORE:: namespace - namely, those non-overridable keywords that can be
0fef449b
RS
190implemented without custom parsers: C<defined>, C<delete>, C<exists>,
191C<glob>, C<pos>, C<protoytpe>, C<scalar>, C<split>, C<study>, and C<undef>.
192
193As some of these have prototypes, C<prototype('CORE::...')> has been
194changed to not make a distinction between overridable and non-overridable
195keywords. This is to make C<prototype('CORE::pos')> consistent with
196C<prototype(&CORE::pos)>.
e5ba1bf1 197
37133b20
RS
198=head2 C<kill> with negative signal names
199
200C<kill> has always allowed a negative signal number, which kills the
201process group instead of a single process. It has also allowed signal
202names. But it did not behave consistently, because negative signal names
203were treated as 0. Now negative signals names like C<-INT> are supported
204and treated the same way as -2 [perl #112990].
205
e5ba1bf1
FC
206=head1 Security
207
d268df4d
RS
208=head2 C<Storable> security warning in documentation
209
210The documentation for C<Storable> now includes a section which warns readers
211of the danger of accepting Storable documents from untrusted sources. The
212short version is that deserializing certain types of data can lead to loading
213modules and other code execution. This is documented behavior and wanted
214behavior, but this opens an attack vector for malicious entities.
215
216=head2 C<Locale::Maketext> allowed code injection via a malicious template
217
218If users could provide a translation string to Locale::Maketext, this could be
219used to invoke arbitrary Perl subroutines available in the current process.
220
221This has been fixed, but it is still possible to invoke any method provided by
222C<Locale::Maketext> itself or a subclass that you are using. One of these
223methods in turn will invoke the Perl core's C<sprintf> subroutine.
224
225In summary, allowing users to provide translation strings without auditing
226them is a bad idea.
227
228This vulnerability is documented in CVE-2012-6329.
229
2516b9f0
RS
230=head2 Avoid calling memset with a negative count
231
232Poorly written perl code that allows an attacker to specify the count to perl's
233C<x> string repeat operator can already cause a memory exhaustion
234denial-of-service attack. A flaw in versions of perl before 5.15.5 can escalate
235that into a heap buffer overrun; coupled with versions of glibc before 2.16, it
236possibly allows the execution of arbitrary code.
237
238The flaw addressed to this commit has been assigned identifier CVE-2012-5195
239and was researched by Tim Brown.
240
241=head1 Incompatible Changes
242
243=head2 See also: hash overhaul
244
245Some of the changes in the L<hash overhaul|/"Hash overhaul"> are not fully
246compatible with previous versions of perl. Please read that section.
247
7e7c78a1
RS
248=head2 An unknown character name in C<\N{...}> is now a syntax error
249
250Previously, it warned, and the Unicode REPLACEMENT CHARACTER was
251substituted. Unicode now recommends that this situation be a syntax
252error. Also, the previous behavior led to some confusing warnings and
253behaviors, and since the REPLACEMENT CHARACTER has no use other than as
254a stand-in for some unknown character, any code that has this problem is
255buggy.
256
257=head2 Formerly deprecated characters in C<\N{}> character name aliases are now errors.
258
259Since v5.12.0, it has been deprecated to use certain characters in
260user-defined C<\N{...}> character names. These now cause a syntax
261error. For example, it is now an error to begin a name with a digit,
262such as in
263
264 my $undraftable = "\N{4F}"; # Syntax error!
265
266or to have commas anywhere in the name. See L<charnames/CUSTOM ALIASES>
267
2516b9f0 268=head2 C<\N{BELL}> now refers to U+1F514 instead of U+0007
e5ba1bf1 269
2516b9f0
RS
270Unicode 6.0 reused the name "BELL" for a different code point than it
271traditionally had meant. Since Perl v5.14, use of this name still
272referred to U+0007, but would raise a deprecation warning. Now, "BELL"
273refers to U+1F514, and the name for U+0007 is "ALERT". All the
274functions in L<charnames> have been correspondingly updated.
e5ba1bf1 275
2516b9f0 276=head2 New Restrictions in Multi-Character Case-Insensitive Matching in Regular Expression Bracketed Character Classes
5946c067 277
2516b9f0
RS
278Unicode has now withdrawn their previous recommendation for regular
279expressions to automatically handle cases where a single character can
a9b1b9e1 280match multiple characters case-insensitively, for example the letter
2516b9f0
RS
281LATIN SMALL LETTER SHARP S and the sequence C<ss>. This is because
282it turns out to be impracticable to do this correctly in all
283circumstances. Because Perl has tried to do this as best it can, it
284will continue to do so. (We are considering an option to turn it off.)
285However, a new restriction is being added on such matches when they
286occur in [bracketed] character classes. People were specifying
287things such as C</[\0-\xff]/i>, and being surprised that it matches the
288two character sequence C<ss> (since LATIN SMALL LETTER SHARP S occurs in
c4191fe7 289this range). This behavior is also inconsistent with using a
2516b9f0
RS
290property instead of a range: C<\p{Block=Latin1}> also includes LATIN
291SMALL LETTER SHARP S, but C</[\p{Block=Latin1}]/i> does not match C<ss>.
292The new rule is that for there to be a multi-character case-insensitive
293match within a bracketed character class, the character must be
294explicitly listed, and not as an end point of a range. This more
295closely obeys the Principle of Least Astonishment. See
296L<perlrecharclass/Bracketed Character Classes>. Note that a bug [perl
297#89774], now fixed as part of this change, prevented the previous
298behavior from working fully.
5946c067 299
0d146223
RS
300=head2 Explicit rules for variable names and identifiers
301
302Due to an oversight, length-one variable names in 5.16 were completely
303unrestricted, and opened the door to several kinds of insanity. As of
3045.18, these now follow the rules of other identifiers, in addition
2516b9f0
RS
305to accepting characters that match the C<\p{POSIX_Punct}> property.
306
307There are no longer any differences in the parsing of identifiers
d1f8c2bf 308specified as C<$...> or C<${...}>; previously, they were dealt with in
2516b9f0
RS
309different parts of the core, and so had slightly different behavior. For
310instance, C<${foo:bar}> was a legal variable name. Since they are now
311both parsed by the same code, that is no longer the case.
312
313=head2 C<\s> in regular expressions now matches a Vertical Tab
314
315No one could recall why C<\s> didn't match C<\cK>, the vertical tab.
316Now it does. Given the extreme rarity of that character, very little
317breakage is expected.
318
319=head2 C</(?{})/> and C</(??{})/> have been heavily reworked
320
321The implementation of this feature has been almost completely rewritten.
322Although its main intent is to fix bugs, some behaviors, especially
323related to the scope of lexical variables, will have changed. This is
324described more fully in the L</Selected Bug Fixes> section.
325
326=head2 Stricter parsing of substitution replacement
0d146223 327
2516b9f0
RS
328It is no longer possible to abuse the way the parser parses C<s///e> like
329this:
330
331 %_=(_,"Just another ");
332 $_="Perl hacker,\n";
333 s//_}->{_/e;print
334
335=head2 C<given> now aliases the global C<$_>
336
337Instead of assigning to an implicit lexical C<$_>, C<given> now makes the
338global C<$_> an alias for its argument, just like C<foreach>. However, it
339still uses lexical C<$_> if there is lexical C<$_> in scope (again, just like
340C<foreach>) [perl #114020].
0d146223 341
2516b9f0 342=head2 Lexical $_ is now experimental
d268df4d
RS
343
344Since it was introduced in Perl 5.10, it has caused much confusion with no
345obvious solution:
346
347=over
348
349=item *
350
351Various modules (e.g., List::Util) expect callback routines to use the
2516b9f0
RS
352global C<$_>. C<use List::Util 'first'; my $_; first { $_ == 1 } @list>
353does not work as one would expect.
d268df4d
RS
354
355=item *
356
357A C<my $_> declaration earlier in the same file can cause confusing closure
358warnings.
359
360=item *
361
362The "_" subroutine prototype character allows called subroutines to access
2516b9f0 363your lexical C<$_>, so it is not really private after all.
d268df4d
RS
364
365=item *
366
367Nevertheless, subroutines with a "(@)" prototype and methods cannot access
2516b9f0 368the caller's lexical C<$_>, unless they are written in XS.
d268df4d
RS
369
370=item *
371
2516b9f0 372But even XS routines cannot access a lexical C<$_> declared, not in the
d268df4d 373calling subroutine, but in an outer scope, iff that subroutine happened not
2516b9f0 374to mention C<$_> or use any operators that default to C<$_>.
d268df4d
RS
375
376=back
377
2516b9f0
RS
378It is our hope that lexical C<$_> can be rehabilitated, but this may
379cause changes in its behavior. Please use it with caution until it
380becomes stable.
381
d268df4d
RS
382=head2 readline() with C<$/ = \N> now reads N characters, not N bytes
383
384Previously, when reading from a stream with I/O layers such as
385C<encoding>, the readline() function, otherwise known as the C<< <> >>
386operator, would read I<N> bytes from the top-most layer. [perl #79960]
387
388Now, I<N> characters are read instead.
389
390There is no change in behaviour when reading from streams with no
391extra layers, since bytes map exactly to characters.
392
d268df4d
RS
393=head2 Overridden C<glob> is now passed one argument
394
395C<glob> overrides used to be passed a magical undocumented second argument
396that identified the caller. Nothing on CPAN was using this, and it got in
397the way of a bug fix, so it was removed. If you really need to identify
398the caller, see L<Devel::Callsite> on CPAN.
399
00785cb7
RS
400=head2 Here-doc parsing
401
402The body of a here-document inside a quote-like operator now always begins
403on the line after the "<<foo" marker. Previously, it was documented to
404begin on the line following the containing quote-like operator, but that
405was only sometimes the case [perl #114040].
406
2516b9f0
RS
407=head2 Alphanumeric operators must now be separated from the closing
408delimiter of regular expressions
00785cb7 409
2516b9f0 410You may no longer write something like:
00785cb7 411
2516b9f0
RS
412 m/a/and 1
413
414Instead you must write
415
416 m/a/ and 1
417
418with whitespace separating the operator from the closing delimiter of
419the regular expression. Not having whitespace has resulted in a
420deprecation warning since Perl v5.14.0.
421
422=head2 qw(...) can no longer be used as parentheses
423
424C<qw> lists used to fool the parser into thinking they were always
425surrounded by parentheses. This permitted some surprising constructions
426such as C<foreach $x qw(a b c) {...}>, which should really be written
427C<foreach $x (qw(a b c)) {...}>. These would sometimes get the lexer into
428the wrong state, so they didn't fully work, and the similar C<foreach qw(a
429b c) {...}> that one might expect to be permitted never worked at all.
430
431This side effect of C<qw> has now been abolished. It has been deprecated
432since Perl 5.13.11. It is now necessary to use real parentheses
433everywhere that the grammar calls for them.
00785cb7
RS
434
435=head2 Interaction of lexical and default warnings
436
437Turning on any lexical warnings used first to disable all default warnings
438if lexical warnings were not already enabled:
439
440 $*; # deprecation warning
441 use warnings "void";
442 $#; # void warning; no deprecation warning
443
444Now, the debugging, deprecated, glob, inplace and malloc warnings
445categories are left on when turning on lexical warnings (unless they are
446turned off by C<no warnings>, of course).
447
448This may cause deprecation warnings to occur in code that used to be free
449of warnings.
450
451Those are the only categories consisting only of default warnings. Default
452warnings in other categories are still disabled by C<use warnings
453"category">, as we do not yet have the infrastructure for controlling
454individual warnings.
455
456=head2 C<state sub> and C<our sub>
457
458Due to an accident of history, C<state sub> and C<our sub> were equivalent
459to a plain C<sub>, so one could even create an anonymous sub with
460C<our sub { ... }>. These are now disallowed outside of the "lexical_subs"
461feature. Under the "lexical_subs" feature they have new meanings described
462in L<perlsub/Lexical Subroutines>.
463
94b31d3f
RS
464=head2 Defined values stored in environment are forced to byte strings
465
466A value stored in an environment variable has always been stringified. In this
467release, it is converted to be only a byte string. First, it is forced to be a
468only a string. Then if the string is utf8 and the equivalent of
469C<utf8::downgrade()> works, that result is used; otherwise, the equivalent of
470C<utf8::encode()> is used, and a warning is issued about wide characters
471(L</Diagnostics>).
472
0fef449b
RS
473=head2 C<require> dies for unreadable files
474
475When C<require> encounters an unreadable file, it now dies. It used to
2516b9f0 476ignore the file and continue searching the directories in C<@INC>
0fef449b
RS
477[perl #113422].
478
2516b9f0 479=head2 C<gv_fetchmeth_*> and SUPER
0fef449b 480
2516b9f0
RS
481The various C<gv_fetchmeth_*> XS functions used to treat a package whose
482named ended with ::SUPER specially. A method lookup on the Foo::SUPER
483package would be treated as a SUPER method lookup on the Foo package. This
484is no longer the case. To do a SUPER lookup, pass the Foo stash and the
485GV_SUPER flag.
0fef449b 486
e5ba1bf1
FC
487=head1 Deprecations
488
816361ee
RS
489=head2 Deprecated modules
490
e7ae12cf
RS
491The following modules will be removed from the core distribution in a
492future release, and should be installed from CPAN instead. Distributions
1ebc7ce8
RS
493on CPAN which require these should add them to their prerequisites.
494The core versions of these modules will issue "deprecated"-category
495warnings.
e7ae12cf
RS
496
497You can silence these deprecation warnings by installing the modules
498in question from CPAN.
499
500=over
501
e7ae12cf
RS
502=item L<Archive::Extract>
503
504=item L<B::Lint>
505
506=item L<B::Lint::Debug>
507
1ebc7ce8 508=item L<CPANPLUS> and all included C<CPANPLUS::*> modules
e7ae12cf
RS
509
510=item L<Devel::InnerPackage>
511
1ebc7ce8
RS
512=item L<encoding>
513
e7ae12cf
RS
514=item L<Log::Message>
515
516=item L<Log::Message::Config>
517
518=item L<Log::Message::Handlers>
519
520=item L<Log::Message::Item>
521
522=item L<Log::Message::Simple>
523
524=item L<Module::Pluggable>
525
526=item L<Module::Pluggable::Object>
527
528=item L<Object::Accessor>
529
530=item L<Pod::LaTeX>
531
532=item L<Term::UI>
533
534=item L<Term::UI::History>
535
536=back
537
538=head2 Deprecated Utilities
539
540The following utilities will be removed from the core distribution in a
541future release as their associated modules have been deprecated. They
542will remain available with the applicable CPAN distribution.
543
544=over
545
546=item L<cpanp>
547
e7ae12cf
RS
548=item C<cpanp-run-perl>
549
e7ae12cf
RS
550=item L<cpan2dist>
551
1ebc7ce8 552These items are part of the C<CPANPLUS> distribution.
e7ae12cf
RS
553
554=item L<pod2latex>
555
1ebc7ce8 556This item is part of the C<Pod::LaTeX> distribution.
e7ae12cf
RS
557
558=back
559
0d146223
RS
560=head2 PL_sv_objcount
561
562This interpreter-global variable used to track the total number of
563Perl objects in the interpreter. It is no longer maintained and will
564be removed altogether in Perl 5.20.
565
e7ae12cf
RS
566=head2 Five additional characters should be escaped in patterns with C</x>
567
568When a regular expression pattern is compiled with C</x>, Perl treats 6
569characters as white space to ignore, such as SPACE and TAB. However,
1ebc7ce8
RS
570Unicode recommends 11 characters be treated thusly. We will conform
571with this in a future Perl version. In the meantime, use of any of the
572missing characters will raise a deprecation warning, unless turned off.
573The five characters are:
e7ae12cf
RS
574U+0085 NEXT LINE,
575U+200E LEFT-TO-RIGHT MARK,
576U+200F RIGHT-TO-LEFT MARK,
577U+2028 LINE SEPARATOR,
578and
579U+2029 PARAGRAPH SEPARATOR.
816361ee
RS
580
581=head2 User-defined charnames with surprising whitespace
582
583A user-defined character name with trailing or multiple spaces in a row is
584likely a typo. This now generates a warning when defined, on the assumption
585that uses of it will be unlikely to include the excess whitespace.
586
587=head2 Various XS-callable functions are now deprecated
588
589All the functions used to classify characters will be removed from a
590future version of Perl, and should not be used. With participating C
591compilers (e.g., gcc), compiling any file that uses any of these will
592generate a warning. These were not intended for public use; there are
593equivalent, faster, macros for most of them.
594See L<perlapi/Character classes>. The complete list (including some
595that were deprecated in 5.17.7) is:
596C<is_uni_alnum>, C<is_uni_alnumc>, C<is_uni_alnumc_lc>,
597C<is_uni_alnum_lc>, C<is_uni_alpha>, C<is_uni_alpha_lc>,
598C<is_uni_ascii>, C<is_uni_ascii_lc>, C<is_uni_blank>,
599C<is_uni_blank_lc>, C<is_uni_cntrl>, C<is_uni_cntrl_lc>,
600C<is_uni_digit>, C<is_uni_digit_lc>, C<is_uni_graph>,
601C<is_uni_graph_lc>, C<is_uni_idfirst>, C<is_uni_idfirst_lc>,
602C<is_uni_lower>, C<is_uni_lower_lc>, C<is_uni_print>,
603C<is_uni_print_lc>, C<is_uni_punct>, C<is_uni_punct_lc>,
604C<is_uni_space>, C<is_uni_space_lc>, C<is_uni_upper>,
605C<is_uni_upper_lc>, C<is_uni_xdigit>, C<is_uni_xdigit_lc>,
606C<is_utf8_alnum>, C<is_utf8_alnumc>, C<is_utf8_alpha>,
607C<is_utf8_ascii>, C<is_utf8_blank>, C<is_utf8_char>,
608C<is_utf8_cntrl>, C<is_utf8_digit>, C<is_utf8_graph>,
609C<is_utf8_idcont>, C<is_utf8_idfirst>, C<is_utf8_lower>,
610C<is_utf8_mark>, C<is_utf8_perl_space>, C<is_utf8_perl_word>,
611C<is_utf8_posix_digit>, C<is_utf8_print>, C<is_utf8_punct>,
612C<is_utf8_space>, C<is_utf8_upper>, C<is_utf8_xdigit>,
613C<is_utf8_xidcont>, C<is_utf8_xidfirst>.
614
615In addition these three functions that have never worked properly are
616deprecated:
617C<to_uni_lower_lc>, C<to_uni_title_lc>, and C<to_uni_upper_lc>.
618
619=head2 Certain rare uses of backslashes within regexes are now deprectated
620
621There are three pairs of characters that Perl recognizes as
622metacharacters in regular expression patterns: C<{}>, C<[]>, and C<()>.
623These can be used as well to delimit patterns, as in:
624
1ebc7ce8
RS
625 m{foo}
626 s(foo)(bar)
816361ee
RS
627
628Since they are metacharacters, they have special meaning to regular
629expression patterns, and it turns out that you can't turn off that
630special meaning by the normal means of preceding them with a backslash,
631if you use them, paired, within a pattern delimitted by them. For
632example, in
633
1ebc7ce8 634 m{foo\{1,3\}}
816361ee
RS
635
636the backslashes do not change the behavior, and this matches
637S<C<"f o">> followed by one to three more occurrences of C<"o">.
638
639Usages like this, where they are interpreted as metacharacters, are
640exceedingly rare; we think there are none, for example, in all of CPAN.
641Hence, this deprecation should affect very little code. It does give
642notice, however, that any such code needs to change, which will in turn
643allow us to change the behavior in future Perl versions so that the
644backslashes do have an effect, and without fear that we are silently
645breaking any existing code.
646
bea832c0
RS
647=head1 Future Deprecations
648
649=over
650
651=item *
652
653Platforms with out support infrastructure
654
655Both Windows CE and z/OS have been historically under-maintained, and are
656currently neither successfully building nor regularly being smoke tested.
657Efforts are underway to change this situation, but it should not be taken for
71b6ff97
RS
658granted that the platforms are safe and supported. If they do not become
659buildable and regularly smoked, support for them may be actively removed in
660future releases. If you have an interest in these platforms and you can lend
661your time, expertise, or hardware to help support these platforms, please let
662the perl development effort know by emailing C<perl5-porters@perl.org>.
663
664Some platforms that appear otherwise entirely dead are also on the short list
665for removal between now and 5.20.0:
666
667=over
668
669=item DG/UX
670
671=item NeXT
672
673=back
bea832c0
RS
674
675=item *
676
677Swapping of $< and $>
678
679For more information about this future deprecation, see L<the relevant RT
680ticket|https://rt.perl.org/rt3/Ticket/Display.html?id=96212>.
681
682=item *
683
684sfio, stdio
685
686Perl supports being built without PerlIO proper, using a stdio or sfio
687wrapper instead. A perl build like this will not support IO layers and
688thus Unicode IO, making it rather handicapped.
689
690PerlIO supports a C<stdio> layer if stdio use is desired, and similarly a
691sfio layer could be produced.
692
693=item *
694
71b6ff97
RS
695C<microperl>, long broken and of unclear present purpose, will be removed.
696
697=item *
698
bea832c0
RS
699Revamping C<< "\Q" >> semantics in double-quotish strings when combined with
700other escapes.
701
702There are several bugs and inconsistencies involving combinations
703of C<\Q> and escapes like C<\x>, C<\L>, etc., within a C<\Q...\E> pair.
704These need to be fixed, and doing so will necessarily change current
705behavior. The changes have not yet been settled.
706
707=back
708
e5ba1bf1
FC
709=head1 Performance Enhancements
710
7e7c78a1
RS
711=over 4
712
713=item *
e5ba1bf1 714
7e7c78a1 715Lists of lexical variable declarations (C<my($x, $y)>) are now optimised
9abd6633 716down to a single op and are hence faster than before.
e5ba1bf1 717
7e7c78a1
RS
718=item *
719
9abd6633
RS
720A new C preprocessor define C<NO_TAINT_SUPPORT> was added that, if set,
721disables Perl's taint support altogether. Using the -T or -t command
722line flags will cause a fatal error. Beware that both core tests as
723well as many a CPAN distribution's tests will fail with this change. On
724the upside, it provides a small performance benefit due to reduced
725branching.
7e7c78a1
RS
726
727B<Do not enable this unless you know exactly what you are getting yourself
728into.>
e5ba1bf1
FC
729
730=item *
731
d29861e7
RS
732C<pack> with constant arguments is now constant folded in most cases
733[perl #113470].
734
735=item *
736
00785cb7 737Speed up in regular expression matching against Unicode properties. The
9abd6633 738largest gain is for C<\X>, the Unicode "extended grapheme cluster." The
00785cb7
RS
739gain for it is about 35% - 40%. Bracketed character classes, e.g.,
740C<[0-9\x{100}]> containing code points above 255 are also now faster.
741
742=item *
743
744On platforms supporting it, several former macros are now implemented as static
745inline functions. This should speed things up slightly on non-GCC platforms.
746
747=item *
748
9abd6633
RS
749Apply the optimisation of hashes in boolean context, such as in C<if> or
750C<and>, to constructs in non-void context.
00785cb7
RS
751
752=item *
753
754Extend the optimisation of hashes in boolean context to C<scalar(%hash)>,
755C<%hash ? ... : ...>, and C<sub { %hash || ... }>.
756
757=item *
758
0bba4573
RS
759Filetest ops manage the stack in a fractionally more efficient manner.
760
761=item *
762
9abd6633 763Globs used in a numeric context are now numified directly in most cases,
0bba4573 764rather than being numerified via stringification.
e5ba1bf1 765
0fef449b
RS
766=item *
767
768The C<x> repetition operator is now folded to a single constant at compile
769time if called in scalar context with constant operands and no parentheses
770around the left operand.
771
e5ba1bf1
FC
772=back
773
774=head1 Modules and Pragmata
775
e5ba1bf1
FC
776=head2 New Modules and Pragmata
777
778=over 4
779
780=item *
781
e7ae12cf
RS
782L<Config::Perl::V> version 0.16 has been added as a dual-lifed module.
783It provides structured data retrieval of C<perl -V> output including
784information only known to the C<perl> binary and not available via L<Config>.
e5ba1bf1
FC
785
786=back
787
788=head2 Updated Modules and Pragmata
789
9abd6633
RS
790This is only an overview of selected module updates. For a complete
791list of updates, run:
792
793 $ corelist --diff 5.14.0 5.16.0
794
795You can substitute your favorite version in place of 5.14.0, too.
796
e5ba1bf1
FC
797=over 4
798
799=item *
800
801L<XXX> has been upgraded from version A.xx to B.yy.
802
803=back
804
805=head2 Removed Modules and Pragmata
806
0bba4573 807=over
e5ba1bf1
FC
808
809=item *
810
0bba4573
RS
811L<Version::Requirements> has been removed from the core distribution. It is
812available under a different name: L<CPAN::Meta::Requirements>.
e5ba1bf1
FC
813
814=back
815
816=head1 Documentation
817
9abd6633 818=head2 Changes to Existing Documentation
e5ba1bf1 819
9abd6633 820=head3 L<perlcheat>
e5ba1bf1 821
9abd6633 822=over 4
e5ba1bf1 823
9abd6633 824=item *
e5ba1bf1 825
9abd6633 826L<perlcheat> has been reorganized, and a few new sections were added.
e5ba1bf1 827
9abd6633 828=back
e5ba1bf1 829
0bba4573 830=head3 L<perldata>
e5ba1bf1 831
0bba4573
RS
832=over 4
833
834=item *
835
836Now explicitly documents the behaviour of hash initializer lists that
837contain duplicate keys.
838
839=back
840
841=head3 L<perldiag>
842
843=over 4
844
845=item *
846
847The explanation of symbolic references being prevented by "strict refs"
848now doesn't assume that the reader knows what symbolic references are.
849
850=back
851
9abd6633 852=head3 L<perlfaq>
e5ba1bf1
FC
853
854=over 4
855
856=item *
857
9abd6633 858L<perlfaq> has been synchronized with version 5.0150040 from CPAN.
37133b20 859
e5ba1bf1
FC
860=back
861
9abd6633 862=head3 L<perlfunc>
0fef449b
RS
863
864=over 4
865
866=item *
867
9abd6633 868The return value of C<pipe> is now documented.
0fef449b
RS
869
870=item *
871
9abd6633 872Clarified documentation of C<our>.
0fef449b
RS
873
874=back
875
94b31d3f
RS
876=head3 L<perlop>
877
878=over 4
879
880=item *
881
882Loop control verbs (C<dump>, C<goto>, C<next>, C<last> and C<redo>) have always
883had the same precedence as assignment operators, but this was not documented
884until now.
885
886=back
887
0bba4573 888=head3 Diagnostics
e5ba1bf1
FC
889
890The following additions or changes have been made to diagnostic output,
891including warnings and fatal error messages. For the complete list of
892diagnostic messages, see L<perldiag>.
893
894XXX New or changed warnings emitted by the core's C<C> code go here. Also
895include any changes in L<perldiag> that reconcile it to the C<C> code.
896
897=head2 New Diagnostics
898
899XXX Newly added diagnostic messages go under here, separated into New Errors
900and New Warnings
901
902=head3 New Errors
903
904=over 4
905
906=item *
907
94b31d3f
RS
908L<Unterminated delimiter for here document|perldiag/"Unterminated delimiter for here document">
909
910This message now occurs when a here document label has an initial quotation
911mark but the final quotation mark is missing.
912
913This replaces a bogus and misleading error message about not finding the label
914itself [perl #114104].
915
916=item *
917
918L<panic: child pseudo-process was never scheduled|perldiag/"panic: child pseudo-process was never scheduled">
919
920This error is thrown when a child pseudo-process in the ithreads implementation
921on Windows was not scheduled within the time period allowed and therefore was
922not able to initialize properly [perl #88840].
923
924=item *
925
37133b20
RS
926L<Group name must start with a non-digit word character in regex; marked by <-- HERE in mE<sol>%sE<sol>|perldiag/"Group name must start with a non-digit word character in regex; marked by <-- HERE in m/%s/">
927
928This error has been added for C<(?&0)>, which is invalid. It used to
929produce an incomprehensible error message [perl #101666].
930
931=item *
932
933L<Can't use an undefined value as a subroutine reference|perldiag/"Can't use an undefined value as %s reference">
934
935Calling an undefined value as a subroutine now produces this error message.
936It used to, but was accidentally disabled, first in Perl 5.004 for
937non-magical variables, and then in Perl 5.14 for magical (e.g., tied)
938variables. It has now been restored. In the mean time, undef was treated
939as an empty string [perl #113576].
e5ba1bf1 940
e4c2d125
S
941=item *
942
943L<Experimental "%s" subs not enabled|perldiag/"Experimental "%s" subs not enabled">
944
945To use lexical subs, you must first enable them:
946
947 no warnings 'experimental::lexical_subs';
948 use feature 'lexical_subs';
949 my sub foo { ... }
950
e5ba1bf1
FC
951=back
952
953=head3 New Warnings
954
955=over 4
956
957=item *
958
0d146223
RS
959L<%c* is deprecated, and will become a syntax error|perldiag/"%c* is deprecated, and will become a syntax error">
960
961Use of C<@*>, C<&*>, C<**> or C<%*> is now deprecated, and will generate a
962compile time warning, enabled by default. In future such code will fail to
963compile with a syntax error. Removing these variables, along with C<$*>,
964will permit future syntax additions.
965
966=item *
967
e7ae12cf
RS
968XXX: This needs more detail.
969
970Strings with code points over 0xFF may not be mapped into in-memory file
971handles
972
973=item *
974
816361ee
RS
975L<'%s' resolved to '\o{%s}%d'|perldiag/"'%s' resolved to '\o{%s}%d'">
976
977=item *
978
979L<'Trailing white-space in a charnames alias definition is deprecated'|perldiag/"Trailing white-space in a charnames alias definition is deprecated">
980
981=item *
982
983L<'A sequence of multiple spaces in a charnames alias definition is deprecated'|perldiag/"A sequence of multiple spaces in a charnames alias definition is deprecated">
984
985=item *
986
987L<'Passing malformed UTF-8 to "%s" is deprecated'|perldiag/"Passing malformed UTF-8 to "%s" is deprecated">
988
816361ee
RS
989=item *
990
00785cb7
RS
991L<Subroutine "&%s" is not available|perldiag/"Subroutine "&%s" is not available">
992
993(W closure) During compilation, an inner named subroutine or eval is
994attempting to capture an outer lexical subroutine that is not currently
995available. This can happen for one of two reasons. First, the lexical
996subroutine may be declared in an outer anonymous subroutine that has not
997yet been created. (Remember that named subs are created at compile time,
998while anonymous subs are created at run-time.) For example,
999
1000 sub { my sub a {...} sub f { \&a } }
1001
1002At the time that f is created, it can't capture the current the "a" sub,
1003since the anonymous subroutine hasn't been created yet. Conversely, the
1004following won't give a warning since the anonymous subroutine has by now
1005been created and is live:
1006
1007 sub { my sub a {...} eval 'sub f { \&a }' }->();
1008
1009The second situation is caused by an eval accessing a variable that has
1010gone out of scope, for example,
1011
1012 sub f {
9abd6633
RS
1013 my sub a {...}
1014 sub { eval '\&a' }
00785cb7
RS
1015 }
1016 f()->();
1017
1018Here, when the '\&a' in the eval is being compiled, f() is not currently
1019being executed, so its &a is not available for capture.
1020
1021=item *
1022
1023L<"%s" subroutine &%s masks earlier declaration in same %s|perldiag/"%s" subroutine &%s masks earlier declaration in same %s>
1024
1025(W misc) A "my" or "state" subroutine has been redeclared in the
1026current scope or statement, effectively eliminating all access to
1027the previous instance. This is almost always a typographical error.
1028Note that the earlier subroutine will still exist until the end of
1029the scope or until all closure references to it are destroyed.
1030
1031=item *
1032
1033L<The %s feature is experimental|perldiag/"The %s feature is experimental">
1034
1035(S experimental) This warning is emitted if you enable an experimental
1036feature via C<use feature>. Simply suppress the warning if you want
1037to use the feature, but know that in doing so you are taking the risk
1038of using an experimental feature which may change or be removed in a
1039future Perl version:
1040
7a3f436e 1041 no warnings "experimental::lexical_subs";
00785cb7
RS
1042 use feature "lexical_subs";
1043
1044=item *
1045
1046L<sleep(%u) too large|perldiag/"sleep(%u) too large">
1047
1048(W overflow) You called C<sleep> with a number that was larger than it can
1049reliably handle and C<sleep> probably slept for less time than requested.
1050
1051=item *
1052
94b31d3f
RS
1053L<Wide character in setenv|perldiag/"Wide character in %s">
1054
1055Attempts to put wide characters into environment variables via C<%ENV> now
1056provoke this warning.
1057
1058=item *
1059
37133b20
RS
1060"L<Invalid negative number (%s) in chr|perldiag/"Invalid negative number (%s) in chr">"
1061
1062C<chr()> now warns when passed a negative value [perl #83048].
1063
1064=item *
1065
1066"L<Integer overflow in srand|perldiag/"Integer overflow in srand">"
1067
1068C<srand()> now warns when passed a value that doesn't fit in a C<UV> (since the
1069value will be truncated rather than overflowing) [perl #40605].
1070
1071=item *
1072
1073"L<-i used with no filenames on the command line, reading from STDIN|perldiag/"-i used with no filenames on the command line, reading from STDIN">"
1074
1075Running perl with the C<-i> flag now warns if no input files are provided on
1076the command line [perl #113410].
e5ba1bf1
FC
1077
1078=back
1079
1080=head2 Changes to Existing Diagnostics
1081
e5ba1bf1
FC
1082=over 4
1083
1084=item *
1085
0d146223
RS
1086L<$* is no longer supported, and will become a syntax error|perldiag/"$* is no longer supported, and will become a syntax error">
1087
1088The warning that use of C<$*> and C<$#> is no longer supported is now
1089generated for every location that references them. Previously it would fail
1090to be generated if another variable using the same typeglob was seen first
1091(e.g. C<@*> before C<$*>), and would not be generated for the second and
1092subsequent uses. (It's hard to fix the failure to generate warnings at all
1093without also generating them every time, and warning every time is
1094consistent with the warnings that C<$[> used to generate.)
1095
1096=item *
1097
9abd6633
RS
1098The warnings for C<\b{> and C<\B{> were added. They are a deprecation
1099warning which should be turned off by that category. One should not
1100have to turn off regular regexp warnings as well to get rid of these.
e7ae12cf
RS
1101
1102=item *
1103
d268df4d
RS
1104L<Constant(%s): Call to &{$^H{%s}} did not return a defined value|perldiag/Constant(%s): Call to &{$^H{%s}} did not return a defined value>
1105
1106Constant overloading that returns C<undef> results in this error message.
1107For numeric constants, it used to say "Constant(undef)". "undef" has been
1108replaced with the number itself.
1109
1110=item *
1111
f7b06e7f
RS
1112The error produced when a module cannot be loaded now includes a hint that
1113the module may need to be installed: "Can't locate hopping.pm in @INC (you
1114may need to install the hopping module) (@INC contains: ...)"
1115
1116=item *
1117
00785cb7
RS
1118L<vector argument not supported with alpha versions|perldiag/vector argument not supported with alpha versions>
1119
1120This warning was not suppressable, even with C<no warnings>. Now it is
1121suppressible, and has been moved from the "internal" category to the
1122"printf" category.
1123
1124=item *
1125
1126C<< Can't do {n,m} with n > m in regex; marked by <-- HERE in m/%s/ >>
1127
1128This fatal error has been turned into a warning that reads:
1129
1130L<< Quantifier {n,m} with n > m can't match in regex | perldiag/Quantifier {n,m} with n > m can't match in regex >>
1131
1132(W regexp) Minima should be less than or equal to maxima. If you really want
1133your regexp to match something 0 times, just put {0}.
1134
1135=item *
1136
0fef449b
RS
1137The "Runaway prototype" warning that occurs in bizarre cases has been
1138removed as being unhelpful and inconsistent.
1139
1140=item *
1141
1142The "Not a format reference" error has been removed, as the only case in
1143which it could be triggered was a bug.
1144
1145=item *
1146
1147The "Unable to create sub named %s" error has been removed for the same
1148reason.
e5ba1bf1 1149
37133b20
RS
1150=item *
1151
1152The 'Can't use "my %s" in sort comparison' error has been downgraded to a
1153warning, '"my %s" used in sort comparison' (with 'state' instead of 'my'
1154for state variables). In addition, the heuristics for guessing whether
1155lexical $a or $b has been misused have been improved to generate fewer
1156false positives. Lexical $a and $b are no longer disallowed if they are
1157outside the sort block. Also, a named unary or list operator inside the
1158sort block no longer causes the $a or $b to be ignored [perl #86136].
1159
e5ba1bf1
FC
1160=back
1161
1162=head1 Utility Changes
1163
f7b06e7f 1164=head3 L<h2xs>
e5ba1bf1
FC
1165
1166=over 4
1167
1168=item *
1169
f7b06e7f 1170F<h2xs> no longer produces invalid code for empty defines. [perl #20636]
e5ba1bf1
FC
1171
1172=back
1173
1174=head1 Configuration and Compilation
1175
e5ba1bf1
FC
1176=over 4
1177
1178=item *
1179
e7ae12cf
RS
1180Added C<useversionedarchname> option to Configure
1181
1182When set, it includes 'api_versionstring' in 'archname'. E.g.
1183x86_64-linux-5.13.6-thread-multi. It is unset by default.
1184
1185This feature was requested by Tim Bunce, who observed that
1186INSTALL_BASE creates a library structure that does not
1187differentiate by perl version. Instead, it places architecture
1188specific files in "$install_base/lib/perl5/$archname". This makes
1189it difficult to use a common INSTALL_BASE library path with
1190multiple versions of perl.
1191
1192By setting -Duseversionedarchname, the $archname will be
1193distinct for architecture *and* API version, allowing mixed use of
1194INSTALL_BASE.
1195
1196=item *
1197
1198Configure will honour the external C<MAILDOMAIN> environment variable, if set.
1199
1200=item *
1201
1202C<installman> no longer ignores the silent option
1203
1204=item *
1205
1206Both C<META.yml> and C<META.json> files are now included in the distribution.
1207
1208=item *
1209
00785cb7
RS
1210F<Configure> will now correctly detect C<isblank()> when compiling with a C++
1211compiler.
1212
1213=item *
1214
94b31d3f
RS
1215The pager detection in F<Configure> has been improved to allow responses which
1216specify options after the program name, e.g. B</usr/bin/less -R>, if the user
1217accepts the default value. This helps B<perldoc> when handling ANSI escapes
1218[perl #72156].
e5ba1bf1
FC
1219
1220=back
1221
1222=head1 Testing
1223
e5ba1bf1
FC
1224=over 4
1225
1226=item *
1227
0bba4573
RS
1228The test suite now has a section for tests that require very large amounts
1229of memory. These tests won't run by default; they can be enabled by
1230setting the C<PERL_TEST_MEMORY> environment variable to the number of
1231gibibytes of memory that may be safely used.
e5ba1bf1
FC
1232
1233=back
1234
1235=head1 Platform Support
1236
e5ba1bf1
FC
1237=head2 Discontinued Platforms
1238
e5ba1bf1
FC
1239=over 4
1240
d5ed3fc2
RS
1241=item BeOS
1242
1243BeOS was an operating system for personal computers developed by Be Inc,
1244initially for their BeBox hardware. The OS Haiku was written as an open
1245source replacement/continuation for BeOS, and its perl port is current and
1246actively maintained.
1247
94b31d3f 1248=item UTS Global
e5ba1bf1 1249
94b31d3f
RS
1250Support code relating to UTS global has been removed. UTS was a mainframe
1251version of System V created by Amdahl, subsequently sold to UTS Global. The
1252port has not been touched since before Perl 5.8.0, and UTS Global is now
1253defunct.
e5ba1bf1 1254
00785cb7
RS
1255=item VM/ESA
1256
1257Support for VM/ESA has been removed. The port was tested on 2.3.0, which
1258IBM ended service on in March 2002. 2.4.0 ended service in June 2003, and
1259was superseded by Z/VM. The current version of Z/VM is V6.2.0, and scheduled
1260for end of service on 2015/04/30.
1261
f7b06e7f
RS
1262=item MPE/IX
1263
1264Support for MPE/IX has been removed.
1265
7e7c78a1
RS
1266=item EPOC
1267
1268Support code relating to EPOC has been removed. EPOC was a family of
1269operating systems developed by Psion for mobile devices. It was the
1270predecessor of Symbian. The port was last updated in April 2002.
1271
816361ee
RS
1272=item Rhapsody
1273
1274Support for Rhapsody has been removed.
1275
e5ba1bf1
FC
1276=back
1277
1278=head2 Platform-Specific Notes
1279
30bcad58 1280=head3 AIX
e5ba1bf1 1281
30bcad58
RS
1282Configure now always adds C<-qlanglvl=extc99> to the CC flags on AIX when
1283using xlC. This will make it easier to compile a number of XS-based modules
1284that assume C99 [perl #113778].
e5ba1bf1 1285
30bcad58 1286=head3 clang++
e5ba1bf1 1287
0bba4573
RS
1288There is now a workaround for a compiler bug that prevented compiling
1289with clang++ since Perl 5.15.7 [perl #112786].
1290
30bcad58 1291=head3 C++
0bba4573
RS
1292
1293When compiling the Perl core as C++ (which is only semi-supported), the
1294mathom functions are now compiled as C<extern "C">, to ensure proper
1295binary compatibility. (However, binary compatibility isn't generally
1296guaranteed anyway in the situations where this would matter.)
1297
30bcad58
RS
1298=head3 Darwin
1299
1300Stop hardcoding an alignment on 8 byte boundaries to fix builds using
1301-Dusemorebits.
1302
1303=head3 Haiku
1304
1305Perl should now work out of the box on Haiku R1 Alpha 4.
1306
1307=head3 MidnightBSD
1308
1309C<libc_r> was removed from recent versions of MidnightBSD and older versions
1310work better with C<pthread>. Threading is now enabled using C<pthread> which
1311corrects build errors with threading enabled on 0.4-CURRENT.
1312
1313=head3 Solaris
1314
1315In Configure, avoid running sed commands with flags not supported on Solaris.
1316
1317=head3 VMS
1318
1319=over
1320
1321=item *
7e7c78a1
RS
1322
1323Where possible, the case of filenames and command-line arguments is now
1324preserved by enabling the CRTL features C<DECC$EFS_CASE_PRESERVE> and
1325C<DECC$ARGV_PARSE_STYLE> at start-up time. The latter only takes effect
1326when extended parse is enabled in the process from which Perl is run.
1327
30bcad58 1328=item *
e7ae12cf
RS
1329
1330The character set for Extended Filename Syntax (EFS) is now enabled by default
1331on VMS. Among other things, this provides better handling of dots in directory
1332names, multiple dots in filenames,and spaces in filenames. To obtain the old
1333behavior, set the logical name C<DECC$EFS_CHARSET> to C<DISABLE>.
1334
30bcad58 1335=item *
e7ae12cf 1336
30bcad58 1337Fix linking on builds configured with -Dusemymalloc=y.
e7ae12cf 1338
30bcad58 1339=item *
7e7c78a1 1340
30bcad58 1341It should now be possible to compile Perl as C++ on VMS.
7e7c78a1 1342
30bcad58 1343=item *
816361ee 1344
30bcad58
RS
1345All C header files from the top-level directory of the distribution are now
1346installed on VMS, providing consistency with a long-standing practice on other
1347platforms. Previously only a subset were installed, which broke non-core
1348extension builds for extensions that depended on the missing include files.
816361ee 1349
30bcad58 1350=item *
816361ee 1351
30bcad58
RS
1352Quotes are now removed from the command verb (but not the parameters) for
1353commands spawned via C<system>, backticks, or a piped C<open>. Previously,
1354quotes on the verb were passed through to DCL, which would fail to recognize
1355the command. Also, if the verb is actually a path to an image or command
1356procedure on an ODS-5 volume, quoting it now allows the path to contain spaces.
816361ee 1357
30bcad58 1358=item *
00785cb7 1359
30bcad58 1360The B<a2p> build has been fixed for the HP C++ compiler on OpenVMS.
00785cb7 1361
30bcad58 1362=back
00785cb7 1363
30bcad58 1364=head3 Win32
f7b06e7f 1365
30bcad58 1366=over
f7b06e7f 1367
30bcad58 1368=item *
00785cb7 1369
30bcad58
RS
1370Perl can now be built using Microsoft's Visual C++ 2012 compiler by specifying
1371CCTYPE=MSVC110 (or MSVC110FREE if you are using the free Express edition for
1372Windows Desktop) in F<win32/Makefile>.
00785cb7 1373
30bcad58 1374=item *
00785cb7 1375
30bcad58 1376The option to build without USE_SOCKETS_AS_HANDLES has been removed.
00785cb7 1377
30bcad58 1378=item *
00785cb7 1379
30bcad58
RS
1380Fixed a problem where perl could crash while cleaning up threads (including the
1381main thread) in threaded debugging builds on Win32 and possibly other platforms
1382[perl #114496].
00785cb7 1383
30bcad58 1384=item *
0bba4573 1385
30bcad58
RS
1386A rare race condition that would lead to L<sleep|perlfunc/sleep> taking more
1387time than requested, and possibly even hanging, has been fixed [perl #33096].
e5ba1bf1 1388
30bcad58 1389=item *
0fef449b
RS
1390
1391C<link> on Win32 now attempts to set C<$!> to more appropriate values
1392based on the Win32 API error code. [perl #112272]
1393
1394Perl no longer mangles the environment block, e.g. when launching a new
1395sub-process, when the environment contains non-ASCII characters. Known
1396problems still remain, however, when the environment contains characters
1397outside of the current ANSI codepage (e.g. see the item about Unicode in
1398C<%ENV> in L<http://perl5.git.perl.org/perl.git/blob/HEAD:/Porting/todo.pod>).
1399[perl #113536]
1400
30bcad58 1401=item *
37133b20
RS
1402
1403Building perl with some Windows compilers used to fail due to a problem
1404with miniperl's C<glob> operator (which uses the C<perlglob> program)
1405deleting the PATH environment variable [perl #113798].
1406
30bcad58 1407=item *
37133b20 1408
30bcad58
RS
1409A new makefile option, USE_64_BIT_INT, has been added to the Windows
1410makefiles. Set this to "define" when building a 32-bit perl if you want
1411it to use 64-bit integers.
37133b20 1412
30bcad58
RS
1413Machine code size reductions, already made to the DLLs of XS modules in
1414Perl 5.17.2, have now been extended to the perl DLL itself.
94b31d3f 1415
30bcad58
RS
1416Building with VC++ 6.0 was inadvertently broken in Perl 5.17.2 but has
1417now been fixed again.
94b31d3f 1418
30bcad58 1419=back
37133b20 1420
30bcad58 1421=head3 WinCE
37133b20 1422
30bcad58
RS
1423Building on WinCE is now possible once again, although more work is required
1424to fully restore a clean build.
e5ba1bf1
FC
1425
1426=head1 Internal Changes
1427
0bba4573 1428=over
e5ba1bf1 1429
0bba4573 1430=item *
e5ba1bf1 1431
e7ae12cf
RS
1432Synonyms for the misleadingly named C<av_len()> has been created:
1433C<av_top_index()> and C<av_tindex>. All three of these return the
1434number of the highest index in the array, not the number of elements it
1435contains.
816361ee
RS
1436
1437=item *
1438
d268df4d
RS
1439SvUPGRADE() is no longer an expression. Originally this macro (and its
1440underlying function, sv_upgrade()) were documented as boolean, although
1441in reality they always croaked on error and never returned false. In 2005
1442the documentation was updated to specify a void return value, but
1443SvUPGRADE() was left always returning 1 for backwards compatibility. This
1444has now been removed, and SvUPGRADE() is now a statement with no return
1445value.
1446
1447So this is now a syntax error:
1448
1449 if (!SvUPGRADE(sv)) { croak(...); }
1450
1451If you have code like that, simply replace it with
1452
1453 SvUPGRADE(sv);
1454
1455or to to avoid compiler warnings with older perls, possibly
1456
1457 (void)SvUPGRADE(sv);
1458
1459=item *
1460
1461Perl has a new copy-on-write mechanism that allows any SvPOK scalar to be
1462upgraded to a copy-on-write scalar. A reference count on the string buffer
1463is stored in the string buffer itself.
1464
1465This breaks a few XS modules by allowing copy-on-write scalars to go
1466through code paths that never encountered them before.
1467
1468This behaviour can still be disabled by running F<Configure> with
1469B<-Accflags=-DPERL_NO_COW>. This option will probably be removed in Perl
14705.20.
1471
1472=item *
1473
1474Copy-on-write no longer uses the SvFAKE and SvREADONLY flags. Hence,
1475SvREADONLY indicates a true read-only SV.
1476
1477Use the SvIsCOW macro (as before) to identify a copy-on-write scalar.
1478
1479=item *
1480
d268df4d
RS
1481PL_glob_index is gone.
1482
1483=item *
1484
7e7c78a1
RS
1485The private Perl_croak_no_modify has had its context parameter removed. It is
1486now has a void prototype. Users of the public API croak_no_modify remain
1487unaffected.
1488
1489=item *
1490
1491Copy-on-write (shared hash key) scalars are no longer marked read-only.
1492C<SvREADONLY> returns false on such an SV, but C<SvIsCOW> still returns
1493true.
1494
1495=item *
1496
1497A new op type, C<OP_PADRANGE> has been introduced. The perl peephole
1498optimiser will, where possible, substitute a single padrange op for a
1499pushmark followed by one or more pad ops, and possibly also skipping list
1500and nextstate ops. In addition, the op can carry out the tasks associated
1501with the RHS of a my(...) = @_ assignment, so those ops may be optimised
1502away too.
1503
1504=item *
1505
f7b06e7f
RS
1506Case-insensitive matching inside a [bracketed] character class with a
1507multi-character fold, no longer excludes one of the possibilities in the
1508circumstances that it used to. [perl #89774].
1509
1510=item *
1511
1512C<PL_formfeed> has been removed.
1513
1514=item *
1515
1516The regular expression engine no longer reads one byte past the end of the
1517target string. While for all internally well-formed scalars this should
1518never have been a problem, this change facilitates clever tricks with
1519string buffers in CPAN modules. [perl #73542]
1520
1521=item *
1522
1523Inside a BEGIN block, C<PL_compcv> now points to the currently-compiling
1524subroutine, rather than the BEGIN block itself.
1525
1526=item *
1527
1528C<mg_length> has been deprecated.
1529
1530=item *
1531
1532C<sv_len> now always returns a byte count and C<sv_len_utf8> a character
1533count. Previously, C<sv_len> and C<sv_len_utf8> were both buggy and would
1534sometimes returns bytes and sometimes characters. C<sv_len_utf8> no longer
1535assumes that its argument is in UTF8. Neither of these creates UTF8 caches
1536for tied or overloaded values or for non-PVs any more.
1537
1538=item *
1539
1540C<sv_mortalcopy> now copies string buffers of shared hash key scalars when
1541called from XS modules [perl #79824].
1542
1543=item *
1544
1545C<RXf_SPLIT> and C<RXf_SKIPWHITE> are no longer used. They are now
1546#defined as 0.
1547
1548=item *
1549
1550The new C<RXf_MODIFIES_VARS> flag can be set by custom regular expression
1551engines to indicate that the execution of the regular expression may cause
1552variables to be modified. This lets C<s///> know to skip certain
1553optimisations. Perl's own regular expression engine sets this flag for the
1554special backtracking verbs that set $REGMARK and $REGERROR.
1555
1556=item *
1557
00785cb7
RS
1558The APIs for accessing lexical pads have changed considerably.
1559
30bcad58
RS
1560C<PADLIST>s are now longer C<AV>s, but their own type instead.
1561C<PADLIST>s now contain a C<PAD> and a C<PADNAMELIST> of C<PADNAME>s,
1562rather than C<AV>s for the pad and the list of pad names. C<PAD>s,
1563C<PADNAMELIST>s, and C<PADNAME>s are to be accessed as such through the
1564newly added pad API instead of the plain C<AV> and C<SV> APIs. See
1565L<perlapi> for details.
00785cb7
RS
1566
1567=item *
1568
1569In the regex API, the numbered capture callbacks are passed an index
1570indicating what match variable is being accessed. There are special
1571index values for the C<$`, $&, $&> variables. Previously the same three
1572values were used to retrieve C<${^PREMATCH}, ${^MATCH}, ${^POSTMATCH}>
1573too, but these have now been assigned three separate values. See
1574L<perlreapi/Numbered capture callbacks>.
1575
1576=item *
1577
1578C<PL_sawampersand> was previously a boolean indicating that any of
1579C<$`, $&, $&> had been seen; it now contains three one-bit flags
1580indicating the presence of each of the variables individually.
1581
00785cb7
RS
1582=item *
1583
0bba4573
RS
1584The C<CV *> typemap entry now supports C<&{}> overloading and typeglobs,
1585just like C<&{...}> [perl #96872].
e5ba1bf1
FC
1586
1587=item *
1588
0bba4573
RS
1589The C<SVf_AMAGIC> flag to indicate overloading is now on the stash, not the
1590object. It is now set automatically whenever a method or @ISA changes, so
1591its meaning has changed, too. It now means "potentially overloaded". When
1592the overload table is calculated, the flag is automatically turned off if
1593there is no overloading, so there should be no noticeable slowdown.
1594
1595The staleness of the overload tables is now checked when overload methods
1596are invoked, rather than during C<bless>.
1597
1598"A" magic is gone. The changes to the handling of the C<SVf_AMAGIC> flag
1599eliminate the need for it.
1600
1601C<PL_amagic_generation> has been removed as no longer necessary. For XS
1602modules, it is now a macro alias to C<PL_na>.
1603
1604The fallback overload setting is now stored in a stash entry separate from
1605overloadedness itself.
1606
1607=item *
1608
1609The character-processing code has been cleaned up in places. The changes
1610should be operationally invisible.
e5ba1bf1 1611
0fef449b
RS
1612=item *
1613
1614The C<study> function was made a no-op in 5.16. It was simply disabled via
1615a C<return> statement; the code was left in place. Now the code supporting
1616what C<study> used to do has been removed.
1617
1618=item *
1619
1620Under threaded perls, there is no longer a separate PV allocated for every
1621COP to store its package name (C<< cop->stashpv >>). Instead, there is an
1622offset (C<< cop->stashoff >>) into the new C<PL_stashpad> array, which
1623holds stash pointers.
1624
1625=item *
1626
1627In the pluggable regex API, the C<regexp_engine> struct has acquired a new
1628field C<op_comp>, which is currently just for perl's internal use, and
1629should be initialised to NULL by other regex plugin modules.
1630
1631=item *
1632
1633A new function C<alloccoptash> has been added to the API, but is considered
1634experimental. See L<perlapi>.
1635
37133b20
RS
1636=item *
1637
1638Perl used to implement get magic in a way that would sometimes hide bugs in
1639code could call mg_get() too many times on magical values. This hiding of
1640errors no longer occurs, so long-standing bugs may become visible now. If
1641you see magic-related errors in XS code, check to make sure it, together
1642with the Perl API functions it uses, calls mg_get() only once on SvGMAGICAL()
1643values.
1644
1645=item *
1646
1647OP allocation for CVs now uses a slab allocator. This simplifies
1648memory management for OPs allocated to a CV, so cleaning up after a
1649compilation error is simpler and safer [perl #111462][perl #112312].
1650
1651=item *
1652
1653PERL_DEBUG_READONLY_OPS has been rewritten to work with the new slab
1654allocator, allowing it to catch more violations than before.
1655
1656=item *
1657
1658The old slab allocator for ops, which was only enabled for PERL_IMPLICIT_SYS
1659and PERL_DEBUG_READONLY_OPS, has been retired.
1660
e5ba1bf1
FC
1661=back
1662
1663=head1 Selected Bug Fixes
1664
94b31d3f
RS
1665=over 4
1666
1667=item *
e5ba1bf1 1668
d29861e7
RS
1669Here-doc terminators no longer require a terminating newline character when
1670they occur at the end of a file. This was already the case at the end of a
1671string eval [perl #65838].
1672
1673=item *
1674
e7ae12cf
RS
1675-DPERL_GLOBAL_STRUCT builds now free the global struct B<after>
1676they've finished using it.
1677
1678=item *
1679
30bcad58
RS
1680A trailing '/' on a path in @INC will no longer have an additional '/'
1681appended.
e7ae12cf
RS
1682
1683=item *
1684
1685The C<:crlf> layer now works when unread data doesn't fit into its own
1686buffer. [perl #112244].
1687
1688=item *
1689
1690C<ungetc()> now handles UTF-8 encoded data. [perl #116322].
1691
1692=item *
1693
816361ee
RS
1694A bug in the core typemap caused any C types that map to the T_BOOL core
1695typemap entry to not be set, updated, or modified when the T_BOOL variable was
1696used in an OUTPUT: section with an exception for RETVAL. T_BOOL in an INPUT:
1697section was not affected. Using a T_BOOL return type for an XSUB (RETVAL)
1698was not affected. A side effect of fixing this bug is, if a T_BOOL is specified
1699in the OUTPUT: section (which previous did nothing to the SV), and a read only
1700SV (literal) is passed to the XSUB, croaks like "Modification of a read-only
1701value attempted" will happen. [perl #115796]
1702
1703=item *
1704
1705On many platforms, providing a directory name as the script name caused perl
1706to do nothing and report success. It should now universally report an error
1707and exit nonzero. [perl #61362]
1708
1709=item *
1710
30bcad58
RS
1711C<sort {undef} ...> under fatal warnings no longer crashes. It had
1712begun crashing in Perl 5.16.
d268df4d
RS
1713
1714=item *
1715
1716Stashes blessed into each other
1717(C<bless \%Foo::, 'Bar'; bless \%Bar::, 'Foo'>) no longer result in double
1718frees. This bug started happening in Perl 5.16.
1719
1720=item *
1721
1722Numerous memory leaks have been fixed, mostly involving fatal warnings and
1723syntax errors.
1724
1725=item *
1726
d268df4d
RS
1727Some failed regular expression matches such as C<'f' =~ /../g> were not
1728resetting C<pos>. Also, "match-once" patterns (C<m?...?g>) failed to reset
1729it, too, when invoked a second time [perl #23180].
1730
1731=item *
1732
1733Accessing C<$&> after a pattern match now works if it had not been seen
1734before the match. I.e., this applies to C<${'&'}> (under C<no strict>) and
1735C<eval '$&'>. The same applies to C<$'> and C<$`> [perl #4289].
1736
1737=item *
1738
1739Several bugs involving C<local *ISA> and C<local *Foo::> causing stale
1740MRO caches have been fixed.
1741
1742=item *
1743
1744Defining a subroutine when its typeglob has been aliased no longer results
1745in stale method caches. This bug was introduced in Perl 5.10.
1746
1747=item *
1748
1749Localising a typeglob containing a subroutine when the typeglob's package
1750has been deleted from its parent stash no longer produces an error. This
1751bug was introduced in Perl 5.14.
1752
1753=item *
1754
1755Under some circumstances, C<local *method=...> would fail to reset method
1756caches upon scope exit.
1757
1758=item *
1759
1760C</[.foo.]/> is no longer an error, but produces a warning (as before) and
1761is treated as C</[.fo]/> [perl #115818].
1762
1763=item *
1764
1765C<goto $tied_var> now calls FETCH before deciding what type of goto
1766(subroutine or label) this is.
1767
1768=item *
1769
1770Renaming packages through glob assignment
1771(C<*Foo:: = *Bar::; *Bar:: = *Baz::>) in combination with C<m?...?> and
1772C<reset> no longer makes threaded builds crash.
1773
1774=item *
1775
d268df4d
RS
1776A number of bugs related to assigning a list to hash have been fixed. Many of
1777these involve lists with repeated keys like C<(1, 1, 1, 1)>.
1778
1779=over 4
1780
1781=item *
1782
1783The expression C<scalar(%h = (1, 1, 1, 1))> now returns C<4>, not C<2>.
1784
1785=item *
1786
1787The return value of C<%h = (1, 1, 1)> in list context was wrong. Previously
1788this would return C<(1, undef, 1)>, now it returns C<(1, undef)>.
1789
1790=item *
1791
1792Perl now issues the same warning on C<($s, %h) = (1, {})> as it does for
1793C<(%h) = ({})>, "Reference found where even-sized list expected".
1794
1795=item *
1796
1797A number of additional edge cases in list assignment to hashes were
1798corrected. For more details see commit 23b7025ebc.
1799
1800=back
1801
1802=item *
1803
f7b06e7f
RS
1804Attributes applied to lexical variables no longer leak memory.
1805[perl #114764]
1806
1807=item *
1808
1809C<dump>, C<goto>, C<last>, C<next>, C<redo> or C<require> followed by a
1810bareword (or version) and then an infix operator is no longer a syntax
1811error. It used to be for those infix operators (like C<+>) that have a
1812different meaning where a term is expected. [perl #105924]
1813
1814=item *
1815
1816C<require a::b . 1> and C<require a::b + 1> no longer produce erroneous
1817ambiguity warnings. [perl #107002]
1818
1819=item *
1820
1821Class method calls are now allowed on any string, and not just strings
1822beginning with an alphanumeric character. [perl #105922]
1823
1824=item *
1825
1826An empty pattern created with C<qr//> used in C<m///> no longer triggers
1827the "empty pattern reuses last pattern" behaviour. [perl #96230]
1828
1829=item *
1830
1831Tying a hash during iteration no longer results in a memory leak.
1832
1833=item *
1834
1835Freeing a tied hash during iteration no longer results in a memory leak.
1836
1837=item *
1838
1839List assignment to a tied array or hash that dies on STORE no longer
1840results in a memory leak.
1841
1842=item *
1843
1844If the hint hash (C<%^H>) is tied, compile-time scope entry (which copies
1845the hint hash) no longer leaks memory if FETCH dies. [perl #107000]
1846
1847=item *
1848
1849Constant folding no longer inappropriately triggers the special
1850C<split " "> behaviour. [perl #94490]
1851
1852=item *
1853
1854C<defined scalar(@array)>, C<defined do { &foo }>, and similar constructs
1855now treat the argument to C<defined> as a simple scalar. [perl #97466]
1856
1857=item *
1858
1859Running a custom debugging that defines no C<*DB::DB> glob or provides a
1860subroutine stub for C<&DB::DB> no longer results in a crash, but an error
1861instead. [perl #114990]
1862
1863=item *
1864
1865C<reset ""> now matches its documentation. C<reset> only resets C<m?...?>
1866patterns when called with no argument. An empty string for an argument now
1867does nothing. (It used to be treated as no argument.) [perl #97958]
1868
1869=item *
1870
1871C<printf> with an argument returning an empty list no longer reads past the
1872end of the stack, resulting in erratic behaviour. [perl #77094]
1873
1874=item *
1875
1876C<--subname> no longer produces erroneous ambiguity warnings.
1877[perl #77240]
1878
1879=item *
1880
1881C<v10> is now allowed as a label or package name. This was inadvertently
1882broken when v-strings were added in Perl 5.6. [perl #56880]
1883
1884=item *
1885
f7b06e7f
RS
1886C<length>, C<pos>, C<substr> and C<sprintf> could be confused by ties,
1887overloading, references and typeglobs if the stringification of such
1888changed the internal representation to or from UTF8. [perl #114410]
1889
1890=item *
1891
1892utf8::encode now calls FETCH and STORE on tied variables. utf8::decode now
1893calls STORE (it was already calling FETCH).
1894
1895=item *
1896
1897C<$tied =~ s/$non_utf8/$utf8/> no longer loops infinitely if the tied
1898variable returns a Latin-1 string, shared hash key scalar, or reference or
1899typeglob that stringifies as ASCII or Latin-1. This is a regression from
19005.12.x.
1901
1902=item *
1903
1904C<s///> without /e is now better at detecting when it needs to forego
1905certain optimisations, fixing some buggy cases:
1906
1907=over
1908
1909=item *
1910
1911Match variables in certain constructs (C<&&>, C<||>, C<..> and others) in
1912the replacement part; e.g., C<s/(.)/$l{$a||$1}/g>. [perl #26986]
1913
1914=item *
1915
1916Aliases to match variables in the replacement.
1917
1918=item *
1919
30bcad58 1920C<$REGERROR> or C<$REGMARK> in the replacement. [perl #49190]
f7b06e7f
RS
1921
1922=item *
1923
1924An empty pattern (C<s//$foo/>) that causes the last-successful pattern to
1925be used, when that pattern contains code blocks that modify the variables
1926in the replacement.
1927
1928=back
1929
1930=item *
1931
1932The taintedness of the replacement string no longer affects the taintedness
1933of the return value of C<s///e>.
1934
1935=item *
1936
1937The C<$|> autoflush variable is created on-the-fly when needed. If this
1938happened (e.g., if it was mentioned in a module or eval) when the
1939currently-selected filehandle was a typeglob with an empty IO slot, it used
1940to crash. [perl #115206]
1941
1942=item *
1943
1944Line numbers at the end of a string eval are no longer off by one.
1945[perl #114658]
1946
1947=item *
1948
1949@INC filters (subroutines returned by subroutines in @INC) that set $_ to a
1950copy-on-write scalar no longer cause the parser to modify that string
1951buffer in place.
1952
1953=item *
1954
1955C<length($object)> no longer returns the undefined value if the object has
1956string overloading that returns undef. [perl #115260]
1957
1958=item *
1959
1960The use of C<PL_stashcache>, the stash name lookup cache for method calls, has
1961been restored,
1962
1963Commit da6b625f78f5f133 in August 2011 inadvertently broke the code that looks
1964up values in C<PL_stashcache>. As it's a only cache, quite correctly everything
1965carried on working without it.
1966
1967=item *
1968
00785cb7
RS
1969The error "Can't localize through a reference" had disappeared in 5.16.0
1970when C<local %$ref> appeared on the last line of an lvalue subroutine.
1971This error disappeared for C<\local %$ref> in perl 5.8.1. It has now
1972been restored.
1973
1974=item *
1975
1976The parsing of here-docs has been improved significantly, fixing several
1977parsing bugs and crashes and one memory leak, and correcting wrong
1978subsequent line numbers under certain conditions.
1979
1980=item *
1981
1982Inside an eval, the error message for an unterminated here-doc no longer
1983has a newline in the middle of it [perl #70836].
1984
1985=item *
1986
1987A substitution inside a substitution pattern (C<s/${s|||}//>) no longer
1988confuses the parser.
1989
1990=item *
1991
1992It may be an odd place to allow comments, but C<s//"" # hello/e> has
1993always worked, I<unless> there happens to be a null character before the
1994first #. Now it works even in the presence of nulls.
1995
1996=item *
1997
1998An invalid range in C<tr///> or C<y///> no longer results in a memory leak.
1999
2000=item *
2001
2002String eval no longer treats a semicolon-delimited quote-like operator at
2003the very end (C<eval 'q;;'>) as a syntax error.
2004
2005=item *
2006
2007C<< warn {$_ => 1} + 1 >> is no longer a syntax error. The parser used to
2008get confused with certain list operators followed by an anonymous hash and
2009then an infix operator that shares its form with a unary operator.
2010
2011=item *
2012
2013C<(caller $n)[6]> (which gives the text of the eval) used to return the
2014actual parser buffer. Modifying it could result in crashes. Now it always
2015returns a copy. The string returned no longer has "\n;" tacked on to the
2016end. The returned text also includes here-doc bodies, which used to be
2017omitted.
2018
2019=item *
2020
2021Reset the utf8 position cache when accessing magical variables to avoid the
2022string buffer and the utf8 position cache getting out of sync
2023[perl #114410].
2024
2025=item *
2026
2027Various cases of get magic being called twice for magical utf8 strings have been
2028fixed.
2029
2030=item *
2031
2032This code (when not in the presence of C<$&> etc)
2033
2034 $_ = 'x' x 1_000_000;
2035 1 while /(.)/;
2036
2037used to skip the buffer copy for performance reasons, but suffered from C<$1>
2038etc changing if the original string changed. That's now been fixed.
2039
2040=item *
2041
2042Perl doesn't use PerlIO anymore to report out of memory messages, as PerlIO
2043might attempt to allocate more memory.
2044
2045=item *
2046
30bcad58
RS
2047In a regular expression, if something is quantified with C<{n,m}> where
2048C<S<n E<gt> m>>, it can't possibly match. Previously this was a fatal
2049error, but now is merely a warning (and that something won't match).
2050[perl #82954].
00785cb7
RS
2051
2052=item *
2053
2054It used to be possible for formats defined in subroutines that have
2055subsequently been undefined and redefined to close over variables in the
2056wrong pad (the newly-defined enclosing sub), resulting in crashes or
2057"Bizarre copy" errors.
2058
2059=item *
2060
2061Redefinition of XSUBs at run time could produce warnings with the wrong
2062line number.
2063
2064=item *
2065
2066The %vd sprintf format does not support version objects for alpha versions.
2067It used to output the format itself (%vd) when passed an alpha version, and
2068also emit an "Invalid conversion in printf" warning. It no longer does,
2069but produces the empty string in the output. It also no longer leaks
2070memory in this case.
2071
2072=item *
2073
00785cb7
RS
2074C<< $obj->SUPER::method >> calls in the main package could fail if the
2075SUPER package had already been accessed by other means.
2076
2077=item *
2078
2079Stash aliasing (C<*foo:: = *bar::>) no longer causes SUPER calls to ignore
2080changes to methods or @ISA or use the wrong package.
2081
2082=item *
2083
2084Method calls on packages whose names end in ::SUPER are no longer treated
2085as SUPER method calls, resulting in failure to find the method.
2086Furthermore, defining subroutines in such packages no longer causes them to
2087be found by SUPER method calls on the containing package [perl #114924].
2088
00785cb7
RS
2089=item *
2090
94b31d3f
RS
2091C<\w> now matches the code points U+200C (ZERO WIDTH NON-JOINER) and U+200D
2092(ZERO WIDTH JOINER). C<\W> no longer matches these. This change is because
2093Unicode corrected their definition of what C<\w> should match.
e5ba1bf1 2094
94b31d3f
RS
2095=item *
2096
2097C<dump LABEL> no longer leaks its label.
2098
2099=item *
2100
2101Constant folding no longer changes the behaviour of functions like C<stat()>
2102and C<truncate()> that can take either filenames or handles.
2103C<stat 1 ? foo : bar> nows treats its argument as a file name (since it is an
2104arbitrary expression), rather than the handle "foo".
2105
2106=item *
2107
2108C<truncate FOO, $len> no longer falls back to treating "FOO" as a file name if
2109the filehandle has been deleted. This was broken in Perl 5.16.0.
2110
2111=item *
2112
2113Subroutine redefinitions after sub-to-glob and glob-to-glob assignments no
2114longer cause double frees or panic messages.
2115
2116=item *
2117
2118C<s///> now turns vstrings into plain strings when performing a substitution,
2119even if the resulting string is the same (C<s/a/a/>).
2120
2121=item *
2122
2123Prototype mismatch warnings no longer erroneously treat constant subs as having
2124no prototype when they actually have "".
2125
2126=item *
2127
2128Constant subroutines and forward declarations no longer prevent prototype
2129mismatch warnings from omitting the sub name.
2130
2131=item *
2132
2133C<undef> on a subroutine now clears call checkers.
2134
2135=item *
2136
2137The C<ref> operator started leaking memory on blessed objects in Perl 5.16.0.
2138This has been fixed [perl #114340].
2139
2140=item *
2141
2142C<use> no longer tries to parse its arguments as a statement, making
2143C<use constant { () };> a syntax error [perl #114222].
2144
2145=item *
2146
2147On debugging builds, "uninitialized" warnings inside formats no longer cause
2148assertion failures.
2149
2150=item *
2151
2152On debugging builds, subroutines nested inside formats no longer cause
2153assertion failures [perl #78550].
2154
2155=item *
2156
2157Formats and C<use> statements are now permitted inside formats.
2158
2159=item *
2160
2161C<print $x> and C<sub { print $x }-E<gt>()> now always produce the same output.
2162It was possible for the latter to refuse to close over $x if the variable was
2163not active; e.g., if it was defined outside a currently-running named
2164subroutine.
2165
2166=item *
2167
2168Similarly, C<print $x> and C<print eval '$x'> now produce the same output.
2169This also allows "my $x if 0" variables to be seen in the debugger [perl
2170#114018].
2171
2172=item *
2173
2174Formats called recursively no longer stomp on their own lexical variables, but
2175each recursive call has its own set of lexicals.
2176
2177=item *
2178
2179Attempting to free an active format or the handle associated with it no longer
2180results in a crash.
2181
2182=item *
2183
2184Format parsing no longer gets confused by braces, semicolons and low-precedence
2185operators. It used to be possible to use braces as format delimiters (instead
2186of C<=> and C<.>), but only sometimes. Semicolons and low-precedence operators
2187in format argument lines no longer confuse the parser into ignoring the line's
2188return value. In format argument lines, braces can now be used for anonymous
2189hashes, instead of being treated always as C<do> blocks.
2190
2191=item *
2192
2193Formats can now be nested inside code blocks in regular expressions and other
2194quoted constructs (C</(?{...})/> and C<qq/${...}/>) [perl #114040].
2195
2196=item *
2197
2198Formats are no longer created after compilation errors.
2199
2200=item *
2201
94b31d3f
RS
2202Under debugging builds, the B<-DA> command line option started crashing in Perl
22035.16.0. It has been fixed [perl #114368].
2204
2205=item *
2206
94b31d3f
RS
2207A potential deadlock scenario involving the premature termination of a pseudo-
2208forked child in a Windows build with ithreads enabled has been fixed. This
2209resolves the common problem of the F<t/op/fork.t> test hanging on Windows [perl
2210#88840].
2211
2212=item *
2213
2214The microperl build, broken since Perl 5.15.7, has now been restored.
2215
2216=item *
2217
2218The code which generates errors from C<require()> could potentially read one or
2219two bytes before the start of the filename for filenames less than three bytes
2220long and ending C</\.p?\z/>. This has now been fixed. Note that it could
2221never have happened with module names given to C<use()> or C<require()> anyway.
2222
2223=item *
2224
2225The handling of pathnames of modules given to C<require()> has been made
2226thread-safe on VMS.
2227
2228=item *
2229
94b31d3f
RS
2230A bug in the compilation of a C</(?{})/> expression which affected the TryCatch
2231test suite has been fixed [perl #114242].
2232
2233=item *
2234
94b31d3f
RS
2235Pod can now be nested in code inside a quoted construct outside of a string
2236eval. This used to work only within string evals [perl #114040].
e5ba1bf1
FC
2237
2238=item *
2239
0bba4573
RS
2240C<goto ''> now looks for an empty label, producing the "goto must have
2241label" error message, instead of exiting the program [perl #111794].
e5ba1bf1 2242
0bba4573 2243=item *
e5ba1bf1 2244
0bba4573
RS
2245C<goto "\0"> now dies with "Can't find label" instead of "goto must have
2246label".
e5ba1bf1 2247
0bba4573 2248=item *
e5ba1bf1 2249
0bba4573
RS
2250The C function C<hv_store> used to result in crashes when used on C<%^H>
2251[perl #111000].
e5ba1bf1 2252
0bba4573
RS
2253=item *
2254
2255A call checker attached to a closure prototype via C<cv_set_call_checker>
2256is now copied to closures cloned from it. So C<cv_set_call_checker> now
2257works inside an attribute handler for a closure.
e5ba1bf1
FC
2258
2259=item *
2260
0bba4573
RS
2261Writing to C<$^N> used to have no effect. Now it croaks with "Modification
2262of a read-only value" by default, but that can be overridden by a custom
2263regular expression engine, as with C<$1> [perl #112184].
2264
23dd6e2e
FC
2265=item *
2266
0bba4573
RS
2267C<undef> on a control character glob (C<undef *^H>) no longer emits an
2268erroneous warning about ambiguity [perl #112456].
23dd6e2e 2269
0bba4573
RS
2270=item *
2271
2272For efficiency's sake, many operators and built-in functions return the
2273same scalar each time. Lvalue subroutines and subroutines in the CORE::
2274namespace were allowing this implementation detail to leak through.
2275C<print &CORE::uc("a"), &CORE::uc("b")> used to print "BB". The same thing
2276would happen with an lvalue subroutine returning the return value of C<uc>.
2277Now the value is copied in such cases.
23dd6e2e
FC
2278
2279=item *
2280
0bba4573
RS
2281C<method {}> syntax with an empty block or a block returning an empty list
2282used to crash or use some random value left on the stack as its invocant.
2283Now it produces an error.
b92848b5 2284
0f023b5a
FC
2285=item *
2286
0bba4573 2287C<vec> now works with extremely large offsets (E<gt>2 GB) [perl #111730].
0f023b5a
FC
2288
2289=item *
2290
0bba4573
RS
2291Changes to overload settings now take effect immediately, as do changes to
2292inheritance that affect overloading. They used to take effect only after
2293C<bless>.
2294
2295Objects that were created before a class had any overloading used to remain
2296non-overloaded even if the class gained overloading through C<use overload>
2297or @ISA changes, and even after C<bless>. This has been fixed
2298[perl #112708].
c53e3a75
FC
2299
2300=item *
2301
0bba4573 2302Classes with overloading can now inherit fallback values.
c53e3a75
FC
2303
2304=item *
2305
0bba4573
RS
2306Overloading was not respecting a fallback value of 0 if there were
2307overloaded objects on both sides of an assignment operator like C<+=>
2308[perl #111856].
0f023b5a
FC
2309
2310=item *
2311
0bba4573
RS
2312C<pos> now croaks with hash and array arguments, instead of producing
2313erroneous warnings.
0f023b5a
FC
2314
2315=item *
2316
0bba4573
RS
2317C<while(each %h)> now implies C<while(defined($_ = each %h))>, like
2318C<readline> and C<readdir>.
0f023b5a 2319
0bba4573
RS
2320=item *
2321
2322Subs in the CORE:: namespace no longer crash after C<undef *_> when called
2323with no argument list (C<&CORE::time> with no parentheses).
2324
2325=item *
2326
0bba4573
RS
2327C<unpack> no longer produces the "'/' must follow a numeric type in unpack"
2328error when it is the data that are at fault [perl #60204].
2329
2330=item *
2331
2332C<join> and C<"@array"> now call FETCH only once on a tied C<$">
2333[perl #8931].
2334
2335=item *
2336
2337Some subroutine calls generated by compiling core ops affected by a
2338C<CORE::GLOBAL> override had op checking performed twice. The checking
2339is always idempotent for pure Perl code, but the double checking can
2340matter when custom call checkers are involved.
2341
2342=item *
2343
2344A race condition used to exist around fork that could cause a signal sent to
2345the parent to be handled by both parent and child. Signals are now blocked
2346briefly around fork to prevent this from happening [perl #82580].
e5ba1bf1 2347
0fef449b
RS
2348=item *
2349
2350The implementation of code blocks in regular expressions, such as C<(?{})>
2351and C<(??{})>, has been heavily reworked to eliminate a whole slew of bugs.
2352The main user-visible changes are:
2353
2354=over 4
2355
2356=item *
2357
2358Code blocks within patterns are now parsed in the same pass as the
2359surrounding code; in particular it is no longer necessary to have balanced
2360braces: this now works:
2361
2362 /(?{ $x='{' })/
2363
2364This means that this error message is longer generated:
2365
2366 Sequence (?{...}) not terminated or not {}-balanced in regex
2367
2368but a new error may be seen:
2369
2370 Sequence (?{...}) not terminated with ')'
2371
2372In addition, literal code blocks within run-time patterns are only
2373compiled once, at perl compile-time:
2374
2375 for my $p (...) {
2376 # this 'FOO' block of code is compiled once,
2377 # at the same time as the surrounding 'for' loop
2378 /$p{(?{FOO;})/;
2379 }
2380
2381=item *
2382
2383Lexical variables are now sane as regards scope, recursion and closure
2384behavior. In particular, C</A(?{B})C/> behaves (from a closure viewpoint)
2385exactly like C</A/ && do { B } && /C/>, while C<qr/A(?{B})C/> is like
2386C<sub {/A/ && do { B } && /C/}>. So this code now works how you might
2387expect, creating three regexes that match 0, 1, and 2:
2388
2389 for my $i (0..2) {
2390 push @r, qr/^(??{$i})$/;
2391 }
2392 "1" =~ $r[1]; # matches
2393
2394=item *
2395
2396The C<use re 'eval'> pragma is now only required for code blocks defined
2397at runtime; in particular in the following, the text of the C<$r> pattern is
2398still interpolated into the new pattern and recompiled, but the individual
2399compiled code-blocks within C<$r> are reused rather than being recompiled,
2400and C<use re 'eval'> isn't needed any more:
2401
2402 my $r = qr/abc(?{....})def/;
2403 /xyz$r/;
2404
2405=item *
2406
2407Flow control operators no longer crash. Each code block runs in a new
2408dynamic scope, so C<next> etc. will not see
2409any enclosing loops. C<return> returns a value
2410from the code block, not from any enclosing subroutine.
2411
2412=item *
2413
2414Perl normally caches the compilation of run-time patterns, and doesn't
2415recompile if the pattern hasn't changed, but this is now disabled if
2416required for the correct behavior of closures. For example:
2417
2418 my $code = '(??{$x})';
2419 for my $x (1..3) {
2420 # recompile to see fresh value of $x each time
2421 $x =~ /$code/;
2422 }
2423
0fef449b
RS
2424=item *
2425
2426The C</msix> and C<(?msix)> etc. flags are now propagated into the return
2427value from C<(??{})>; this now works:
2428
2429 "AB" =~ /a(??{'b'})/i;
2430
2431=item *
2432
2433Warnings and errors will appear to come from the surrounding code (or for
2434run-time code blocks, from an eval) rather than from an C<re_eval>:
2435
2436 use re 'eval'; $c = '(?{ warn "foo" })'; /$c/;
2437 /(?{ warn "foo" })/;
2438
2439formerly gave:
2440
2441 foo at (re_eval 1) line 1.
2442 foo at (re_eval 2) line 1.
2443
2444and now gives:
2445
2446 foo at (eval 1) line 1.
2447 foo at /some/prog line 2.
2448
2449=back
2450
2451=item *
2452
2453Perl now works as well as can be expected on all releases of Unicode so
2454far. In v5.16, it worked on Unicodes 6.0 and 6.1, but there were
2455various bugs for earlier releases; the older the release the more
2456problems.
2457
2458=item *
2459
2460C<vec> no longer produces "uninitialized" warnings in lvalue context
2461[perl #9423].
2462
2463=item *
2464
2465An optimization involving fixed strings in regular expressions could cause
2466a severe performance penalty in edge cases. This has been fixed
2467[perl #76546].
2468
2469=item *
2470
2471In certain cases, including empty subpatterns within a regular expression (such
2472as C<(?:)> or C<(?:|)>) could disable some optimizations. This has been fixed.
2473
2474=item *
2475
2476The "Can't find an opnumber" message that C<prototype> produces when passed
2477a string like "CORE::nonexistent_keyword" now passes UTF-8 and embedded
2478NULs through unchanged [perl #97478].
2479
2480=item *
2481
2482C<prototype> now treats magical variables like C<$1> the same way as
2483non-magical variables when checking for the CORE:: prefix, instead of
2484treating them as subroutine names.
2485
2486=item *
2487
2488Under threaded perls, a runtime code block in a regular expression could
2489corrupt the package name stored in the op tree, resulting in bad reads
2490in C<caller>, and possibly crashes [perl #113060].
2491
2492=item *
2493
2494Referencing a closure prototype (C<\&{$_[1]}> in an attribute handler for a
2495closure) no longer results in a copy of the subroutine (or assertion
2496failures on debugging builds).
2497
2498=item *
2499
2500C<eval '__PACKAGE__'> now returns the right answer on threaded builds if
2501the current package has been assigned over (as in
2502C<*ThisPackage:: = *ThatPackage::>) [perl #78742].
2503
2504=item *
2505
2506If a package is deleted by code that it calls, it is possible for C<caller>
2507to see a stack frame belonging to that deleted package. C<caller> could
2508crash if the stash's memory address was reused for a scalar and a
2509substitution was performed on the same scalar [perl #113486].
2510
2511=item *
2512
2513C<UNIVERSAL::can> no longer treats its first argument differently
2514depending on whether it is a string or number internally.
2515
2516=item *
2517
2518C<open> with C<< <& >> for the mode checks to see whether the third argument is
2519a number, in determining whether to treat it as a file descriptor or a handle
2520name. Magical variables like C<$1> were always failing the numeric check and
2521being treated as handle names.
2522
2523=item *
2524
2525C<warn>'s handling of magical variables (C<$1>, ties) has undergone several
2526fixes. C<FETCH> is only called once now on a tied argument or a tied C<$@>
2527[perl #97480]. Tied variables returning objects that stringify as "" are
2528no longer ignored. A tied C<$@> that happened to return a reference the
2529I<previous> time it was used is no longer ignored.
2530
2531=item *
2532
2533C<warn ""> now treats C<$@> with a number in it the same way, regardless of
2534whether it happened via C<$@=3> or C<$@="3">. It used to ignore the
2535former. Now it appends "\t...caught", as it has always done with
2536C<$@="3">.
2537
2538=item *
2539
2540Numeric operators on magical variables (e.g., S<C<$1 + 1>>) used to use
2541floating point operations even where integer operations were more appropriate,
2542resulting in loss of accuracy on 64-bit platforms [perl #109542].
2543
2544=item *
2545
2546Unary negation no longer treats a string as a number if the string happened
2547to be used as a number at some point. So, if C<$x> contains the string "dogs",
2548C<-$x> returns "-dogs" even if C<$y=0+$x> has happened at some point.
2549
2550=item *
2551
2552In Perl 5.14, C<-'-10'> was fixed to return "10", not "+10". But magical
2553variables (C<$1>, ties) were not fixed till now [perl #57706].
2554
2555=item *
2556
2557Unary negation now treats strings consistently, regardless of the internal
2558C<UTF8> flag.
2559
2560=item *
2561
2562A regression introduced in Perl v5.16.0 involving
2563C<tr/I<SEARCHLIST>/I<REPLACEMENTLIST>/> has been fixed. Only the first
2564instance is supposed to be meaningful if a character appears more than
2565once in C<I<SEARCHLIST>>. Under some circumstances, the final instance
2566was overriding all earlier ones. [perl #113584]
2567
2568=item *
2569
2570Regular expressions like C<qr/\87/> previously silently inserted a NUL
2571character, thus matching as if it had been written C<qr/\00087/>. Now it
2572matches as if it had been written as C<qr/87/>, with a message that the
2573sequence C<"\8"> is unrecognized.
2574
2575=item *
2576
2577C<__SUB__> now works in special blocks (C<BEGIN>, C<END>, etc.).
2578
2579=item *
2580
2581Thread creation on Windows could theoretically result in a crash if done
2582inside a C<BEGIN> block. It still does not work properly, but it no longer
2583crashes [perl #111610].
2584
2585=item *
2586
2587C<\&{''}> (with the empty string) now autovivifies a stub like any other
2588sub name, and no longer produces the "Unable to create sub" error
2589[perl #94476].
2590
37133b20
RS
2591=item *
2592
2593A regression introduced in v5.14.0 has been fixed, in which some calls
2594to the C<re> module would clobber C<$_> [perl #113750].
2595
2596=item *
2597
2598C<do FILE> now always either sets or clears C<$@>, even when the file can't be
2599read. This ensures that testing C<$@> first (as recommended by the
2600documentation) always returns the correct result.
2601
2602=item *
2603
2604The array iterator used for the C<each @array> construct is now correctly
2605reset when C<@array> is cleared (RT #75596). This happens for example when the
2606array is globally assigned to, as in C<@array = (...)>, but not when its
2607B<values> are assigned to. In terms of the XS API, it means that C<av_clear()>
2608will now reset the iterator.
2609
2610This mirrors the behaviour of the hash iterator when the hash is cleared.
2611
2612=item *
2613
2614C<< $class->can >>, C<< $class->isa >>, and C<< $class->DOES >> now return
2615correct results, regardless of whether that package referred to by C<$class>
2616exists [perl #47113].
2617
2618=item *
2619
2620Arriving signals no longer clear C<$@> [perl #45173].
2621
2622=item *
2623
2624Allow C<my ()> declarations with an empty variable list [perl #113554].
2625
2626=item *
2627
2628During parsing, subs declared after errors no longer leave stubs
2629[perl #113712].
2630
2631=item *
2632
2633Closures containing no string evals no longer hang on to their containing
2634subroutines, allowing variables closed over by outer subroutines to be
2635freed when the outer sub is freed, even if the inner sub still exists
2636[perl #89544].
2637
2638=item *
2639
2640Duplication of in-memory filehandles by opening with a "<&=" or ">&=" mode
2641stopped working properly in 5.16.0. It was causing the new handle to
2642reference a different scalar variable. This has been fixed [perl #113764].
2643
2644=item *
2645
2646C<qr//> expressions no longer crash with custom regular expression engines
2647that do not set C<offs> at regular expression compilation time
2648[perl #112962].
2649
2650=item *
2651
2652C<delete local> no longer crashes with certain magical arrays and hashes
2653[perl #112966].
2654
2655=item *
2656
2657C<local> on elements of certain magical arrays and hashes used not to
2658arrange to have the element deleted on scope exit, even if the element did
2659not exist before C<local>.
2660
2661=item *
2662
2663C<scalar(write)> no longer returns multiple items [perl #73690].
2664
2665=item *
2666
2667String to floating point conversions no longer misparse certain strings under
2668C<use locale> [perl #109318].
2669
2670=item *
2671
2672C<@INC> filters that die no longer leak memory [perl #92252].
2673
2674=item *
2675
2676The implementations of overloaded operations are now called in the correct
2677context. This allows, among other things, being able to properly override
2678C<< <> >> [perl #47119].
2679
2680=item *
2681
2682Specifying only the C<fallback> key when calling C<use overload> now behaves
2683properly [perl #113010].
2684
2685=item *
2686
2687C<< sub foo { my $a = 0; while ($a) { ... } } >> and
2688C<< sub foo { while (0) { ... } } >> now return the same thing [perl #73618].
2689
2690=item *
2691
37133b20
RS
2692String negation now behaves the same under C<use integer;> as it does
2693without [perl #113012].
2694
2695=item *
2696
2697C<chr> now returns the Unicode replacement character (U+FFFD) for -1,
2698regardless of the internal representation. -1 used to wrap if the argument
2699was tied or a string internally.
2700
2701=item *
2702
2703Using a C<format> after its enclosing sub was freed could crash as of
2704perl 5.12.0, if the format referenced lexical variables from the outer sub.
2705
2706=item *
2707
2708Using a C<format> after its enclosing sub was undefined could crash as of
2709perl 5.10.0, if the format referenced lexical variables from the outer sub.
2710
2711=item *
2712
2713Using a C<format> defined inside a closures, which format references
2714lexical variables from outside, never really worked unless the C<write>
2715call was directly inside the closure. In 5.10.0 it even started crashing.
2716Now the copy of that closure nearest the top of the call stack is used to
2717find those variables.
2718
2719=item *
2720
2721Formats that close over variables in special blocks no longer crash if a
2722stub exists with the same name as the special block before the special
2723block is compiled.
2724
2725=item *
2726
2727The parser no longer gets confused, treating C<eval foo ()> as a syntax
2728error if preceded by C<print;> [perl #16249].
2729
2730=item *
2731
2732The return value of C<syscall> is no longer truncated on 64-bit platforms
2733[perl #113980].
2734
2735=item *
2736
2737Constant folding no longer causes C<print 1 ? FOO : BAR> to print to the
2738FOO handle [perl #78064].
2739
2740=item *
2741
2742C<do subname> now calls the named subroutine and uses the file name it
2743returns, instead of opening a file named "subname".
2744
2745=item *
2746
2747Subroutines looked up by rv2cv check hooks (registered by XS modules) are
2748now taken into consideration when determining whether C<foo bar> should be
2749the sub call C<foo(bar)> or the method call C<< "bar"->foo >>.
2750
2751=item *
2752
2753C<CORE::foo::bar> is no longer treated specially, allowing global overrides
2754to be called directly via C<CORE::GLOBAL::uc(...)> [perl #113016].
2755
2756=item *
2757
2758Calling an undefined sub whose typeglob has been undefined now produces the
2759customary "Undefined subroutine called" error, instead of "Not a CODE
2760reference".
2761
2762=item *
2763
2764Two bugs involving @ISA have been fixed. C<*ISA = *glob_without_array> and
2765C<undef *ISA; @{*ISA}> would prevent future modifications to @ISA from
2766updating the internal caches used to look up methods. The
2767*glob_without_array case was a regression from Perl 5.12.
2768
2769=item *
2770
2771Regular expression optimisations sometimes caused C<$> with C</m> to
2772produce failed or incorrect matches [perl #114068].
2773
2774=item *
2775
2776C<__SUB__> now works in a C<sort> block when the enclosing subroutine is
2777predeclared with C<sub foo;> syntax [perl #113710].
2778
2779=item *
2780
2781Unicode properties only apply to Unicode code points, which leads to
2782some subtleties when regular expressions are matched against
2783above-Unicode code points. There is a warning generated to draw your
2784attention to this. However, this warning was being generated
2785inappropriately in some cases, such as when a program was being parsed.
2786Non-Unicode matches such as C<\w> and C<[:word;]> should not generate the
2787warning, as their definitions don't limit them to apply to only Unicode
2788code points. Now the message is only generated when matching against
2789C<\p{}> and C<\P{}>. There remains a bug, [perl #114148], for the very
2790few properties in Unicode that match just a single code point. The
2791warning is not generated if they are matched against an above-Unicode
2792code point.
2793
7e7c78a1
RS
2794=item *
2795
2796Uninitialized warnings mentioning hash elements would only mention the
2797element name if it was not in the first bucket of the hash, due to an
2798off-by-one error.
2799
2800=item *
2801
2802A regular expression optimizer bug could cause multiline "^" to behave
2803incorrectly in the presence of line breaks, such that
2804C<"/\n\n" =~ m#\A(?:^/$)#im> would not match [perl #115242].
2805
2806=item *
2807
2808Failed C<fork> in list context no longer currupts the stack.
2809C<@a = (1, 2, fork, 3)> used to gobble up the 2 and assign C<(1, undef, 3)>
2810if the C<fork> call failed.
2811
2812=item *
2813
2814Numerous memory leaks have been fixed, mostly involving tied variables that
2815die, regular expression character classes and code blocks, and syntax
2816errors.
2817
2818=item *
2819
2820Assigning a regular expression (C<${qr//}>) to a variable that happens to
2821hold a floating point number no longer causes assertion failures on
2822debugging builds.
2823
2824=item *
2825
2826Assigning a regular expression to a scalar containing a number no longer
2827causes subsequent nummification to produce random numbers.
2828
2829=item *
2830
2831Assigning a regular expression to a magic variable no longer wipes away the
2832magic. This is a regression from 5.10.
2833
2834=item *
2835
2836Assigning a regular expression to a blessed scalar no longer results in
2837crashes. This is also a regression from 5.10.
2838
2839=item *
2840
2841Regular expression can now be assigned to tied hash and array elements with
2842flattening into strings.
2843
2844=item *
2845
2846Nummifying a regular expression no longer results in an uninitialized
2847warning.
2848
2849=item *
2850
2851Negative array indices no longer cause EXISTS methods of tied variables to
2852be ignored. This is a regression from 5.12.
2853
2854=item *
2855
2856Negative array indices no longer result in crashes on arrays tied to
2857non-objects.
2858
2859=item *
2860
7e7c78a1
RS
2861C<$byte_overload .= $utf8> no longer results in doubly-encoded UTF8 if the
2862left-hand scalar happened to have produced a UTF8 string the last time
2863overloading was invoked.
2864
2865=item *
2866
2867C<goto &sub> now uses the current value of @_, instead of using the array
2868the subroutine was originally called with. This means
2869C<local @_ = (...); goto &sub> now works [perl #43077].
2870
2871=item *
2872
2873If a debugger is invoked recursively, it no longer stomps on its own
2874lexical variables. Formerly under recursion all calls would share the same
2875set of lexical variables [perl #115742].
2876
2877=item *
2878
2879C<*_{ARRAY}> returned from a subroutine no longer spontaneously
2880becomes empty.
2881
e5ba1bf1
FC
2882=back
2883
0bba4573 2884=head1 Known Problems
e5ba1bf1 2885
0bba4573
RS
2886=over 4
2887
2888=item *
2889
30bcad58 2890XXX: the imperfect behavior of the ** deprecation
0bba4573
RS
2891
2892=back
e5ba1bf1
FC
2893
2894=head1 Acknowledgements
2895
2896XXX Generate this with:
2897
de3d8d88 2898 perl Porting/acknowledgements.pl v5.17.12..HEAD
e5ba1bf1
FC
2899
2900=head1 Reporting Bugs
2901
2902If you find what you think is a bug, you might check the articles recently
2903posted to the comp.lang.perl.misc newsgroup and the perl bug database at
2904http://rt.perl.org/perlbug/ . There may also be information at
2905http://www.perl.org/ , the Perl Home Page.
2906
2907If you believe you have an unreported bug, please run the L<perlbug> program
2908included with your release. Be sure to trim your bug down to a tiny but
2909sufficient test case. Your bug report, along with the output of C<perl -V>,
2910will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
2911
2912If the bug you are reporting has security implications, which make it
2913inappropriate to send to a publicly archived mailing list, then please send it
2914to perl5-security-report@perl.org. This points to a closed subscription
2915unarchived mailing list, which includes all the core committers, who will be
2916able to help assess the impact of issues, figure out a resolution, and help
2917co-ordinate the release of patches to mitigate or fix the problem across all
2918platforms on which Perl is supported. Please only use this address for
2919security issues in the Perl core, not for modules independently distributed on
2920CPAN.
2921
2922=head1 SEE ALSO
2923
2924The F<Changes> file for an explanation of how to view exhaustive details on
2925what changed.
2926
2927The F<INSTALL> file for how to build Perl.
2928
2929The F<README> file for general stuff.
2930
2931The F<Artistic> and F<Copying> files for copyright information.
2932
2933=cut