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