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