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