This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
better perl version output in corelist-diff
[perl5.git] / pod / perl5120delta.pod
CommitLineData
01358b4a
JV
1=head1 NAME
2
3perl5120delta - what is new for perl v5.12.0
4
72d4e865 5=head1 XXX - THIS DOCUMENT IS ONLY CURRENT THROUGH PERL5115
3ab3a109 6
dac9950b 7FIX ME BEFORE RELEASE
3ab3a109
JV
8
9OTHER ISSUES:
10
11UPDATED MODULE LIST NEEDS TO BE GENERATED
12ORDERING NEEDS CHECKING
13HEAVY COPYEDITING IS NEEDED
14
15
01358b4a
JV
16=head1 DESCRIPTION
17
18This document describes differences between the 5.10.0 release and
19the 5.12.0 release.
20
72d4e865 21Many of the bug fixes in 5.12.0 are already included in the 5.10.1
b16f1257 22maintenance release.
72d4e865
JV
23
24You can see the list of those changes in the 5.10.1 release notes (L<perl5101delta>).
25
26
27=head1 New features and New syntax
28
29=head2 New C<package NAME VERSION> syntax
30
31This new syntax allows a module author to set the $VERSION of a namespace
32when the namespace is declared with 'package'. It eliminates the need
33for C<our $VERSION = ...> and similar constructs. E.g.
34
35 package Foo::Bar 1.23;
36 # $Foo::Bar::VERSION == 1.23
37
38There are several advantages to this:
39
b16f1257 40=over
72d4e865
JV
41
42=item *
43
44C<$VERSION> is parsed in exactly the same way as C<use NAME VERSION>
45
46=item *
47
48C<$VERSION> is set at compile time
49
50=item *
51
52C<$VERSION> is a version object that provides proper overloading of
53comparision operators so comparing C<$VERSION> to decimal (1.23) or
54dotted-decimal (v1.2.3) version numbers works correctly.
55
56=item *
57
58Eliminates C<$VERSION = ...> and C<eval $VERSION> clutter
59
60=item *
61
62As it requires VERSION to be a numeric literal or v-string
63literal, it can be statically parsed by toolchain modules
64without C<eval> the way MM-E<gt>parse_version does for C<$VERSION = ...>
65
66=item *
67
68It does not break old code with only C<package NAME>, but code that uses
69C<package NAME VERSION> will need to be restricted to perl 5.12.0 or newer
70This is analogous to the change to C<open> from two-args to three-args.
71Users requiring the latest Perl will benefit, and perhaps after several
72years, it will become a standard practice.
73
74=back
75
76However, C<package NAME VERSION> requires a new, 'strict' version
77number format. See L<"Version number formats"> for details.
78
79
80=head2 The C<...> operator
81
82A new operator, C<...>, nicknamed the Yada Yada operator, has been added.
83It is intended to mark placeholder code that is not yet implemented.
84See L<perlop/"Yada Yada Operator">. (chromatic)
85
86=head2 Implicit strictures
87
88Using the C<use VERSION> syntax with a version number greater or equal
89to 5.11.0 will lexically enable strictures just like C<use strict>
90would do (in addition to enabling features.) The following:
91
92 use 5.12.0;
93
94means:
95
96 use strict;
97 use feature ':5.12';
01358b4a 98
01358b4a 99
3ab3a109
JV
100=head1 Core Enhancements
101
102=head2 qr overloading
103
104It is now possible to overload the C<qr//> operator, that is,
105conversion to regexp, like it was already possible to overload
106conversion to boolean, string or number of objects. It is invoked when
c66407fa 107an object appears on the right hand side of the C<=~> operator or when
3ab3a109
JV
108it is interpolated into a regexp. See L<overload>.
109
110=head2 Pluggable keywords
111
112Extension modules can now cleanly hook into the Perl parser to define
113new kinds of keyword-headed expression and compound statement. The
114syntax following the keyword is defined entirely by the extension. This
115allow a completely non-Perl sublanguage to be parsed inline, with the
b16f1257 116correct ops cleanly generated.
3ab3a109
JV
117
118See L<perlapi/PL_keyword_plugin> for the mechanism. The Perl core
119source distribution also includes a new module
120L<XS::APItest::KeywordRPN>, which implements reverse Polish notation
121arithmetic via pluggable keywords. This module is mainly used for test
122purposes, and is not normally installed, but also serves as an example
123of how to use the new mechanism.
124
72d4e865
JV
125Perl's developers consider this feature to be experimental. We may remove
126it or change it in a backwards-incompatible way in Perl 5.14.
127
3ab3a109
JV
128=head2 APIs for more internals
129
130The lowest layers of the lexer and parts of the pad system now have C
131APIs available to XS extensions. These are necessary to support proper
132use of pluggable keywords, but have other uses too. The new APIs are
133experimental, and only cover a small proportion of what would be
134necessary to take full advantage of the core's facilities in these
135areas. It is intended that the Perl 5.13 development cycle will see the
136addition of a full range of clean, supported interfaces.
137
72d4e865
JV
138Perl's developers consider this feature to be experimental. We may remove
139it or change it in a backwards-incompatible way in Perl 5.14.
140
3ab3a109
JV
141=head2 Overridable function lookup
142
143Where an extension module hooks the creation of rv2cv ops to modify the
144subroutine lookup process, this now works correctly for bareword
145subroutine calls. This means that prototypes on subroutines referenced
146this way will be processed correctly. (Previously bareword subroutine
147names were initially looked up, for parsing purposes, by an unhookable
148mechanism, so extensions could only properly influence subroutine names
149that appeared with an C<&> sigil.)
150
72d4e865 151=head2 Unicode version 5.2
3ab3a109 152
72d4e865
JV
153Perl 5.12 comes with Unicode 5.2, the latest version available to
154us at the time of release. This version of Unicode was released in
155October 2009. See L<http://www.unicode.org/versions/Unicode5.2.0> for
156further details about what's changed in this version of the standard.
157See L<perlunicode> for instructions on installing and using other versions
158of Unicode.
3ab3a109 159
b16f1257 160=head2 Overhaul of Unicode property support
3ab3a109 161
72d4e865
JV
162Perl's developers have made a concerted effort to update Perl to be in
163sync with the latest Unicode standard. Changes for this include:
b21d8e53 164
72d4e865
JV
165Perl can now handle every Unicode character property. New documentation,
166L<perluniprops>, lists all available non-Unihan character properties. By
167default, perl does not expose Unihan, deprecated or Unicode-internal
168properties. See below for more details on these; there is also a section
169in the pod listing them, and explaining why they are not exposed.
3ab3a109
JV
170
171Perl now fully supports the Unicode compound-style of using C<=> and C<:>
172in writing regular expressions: C<\p{property=value}> and
173C<\p{property:value}> (both of which mean the same thing).
174
175Perl now fully supports the Unicode loose matching rules for text
72d4e865 176between the braces in C<\p{...}> constructs. In addition, Perl allows
3ab3a109
JV
177underscores between digits of numbers.
178
72d4e865 179Perl now accepts all the Unicode-defined synonyms for properties and property values.
3ab3a109
JV
180
181C<qr/\X/>, which matches a Unicode logical character, has been expanded to work
72d4e865
JV
182better with various Asian languages. It now is defined as an I<extended
183grapheme cluster>. (See L<http://www.unicode.org/reports/tr29/>).
c66407fa 184Anything matched previously and that made sense will continue to be
72d4e865 185accepted. Additionally:
3ab3a109
JV
186
187=over
188
189=item *
190
b21d8e53 191C<\X> will not break apart a C<S<CR LF>> sequence.
3ab3a109
JV
192
193=item *
194
b21d8e53 195C<\X> will now match a sequence which includes the C<ZWJ> and C<ZWNJ> characters.
3ab3a109
JV
196
197=item *
198
199C<\X> will now always match at least one character, including an initial mark.
200Marks generally come after a base character, but it is possible in Unicode to
201have them in isolation, and C<\X> will now handle that case, for example at the
72d4e865
JV
202beginning of a line, or after a C<ZWSP>. And this is the part where C<\X>
203doesn't match the things that it used to that don't make sense. Formerly, for
3ab3a109
JV
204example, you could have the nonsensical case of an accented LF.
205
206=item *
207
208C<\X> will now match a (Korean) Hangul syllable sequence, and the Thai and Lao
209exception cases.
210
211=back
212
213Otherwise, this change should be transparent for the non-affected languages.
214
215C<\p{...}> matches using the Canonical_Combining_Class property were
72d4e865 216completely broken in previous releases of Perl. They should now work correctly.
3ab3a109 217
72d4e865 218Before Perl 5.12, the Unicode C<Decomposition_Type=Compat> property and a
3ab3a109
JV
219Perl extension had the same name, which led to neither matching all the
220correct values (with more than 100 mistakes in one, and several thousand
72d4e865
JV
221in the other). The Perl extension has now been renamed to be
222C<Decomposition_Type=Noncanonical> (short: C<dt=noncanon>). It has the same
3ab3a109
JV
223meaning as was previously intended, namely the union of all the
224non-canonical Decomposition types, with Unicode C<Compat> being just one of
225those.
226
72d4e865
JV
227C<\p{Decomposition_Type=Canonical}> now includes the Hangul syllables.
228
229C<\p{Uppercase}> and C<\p{Lowercase}> now work as the Unicode standard says they should.
230This means they each match a few more characters than they used to.
3ab3a109 231
72d4e865 232C<\p{Cntrl}> now matches the same characters as C<\p{Control}>. This means it
3ab3a109 233no longer will match Private Use (gc=co), Surrogates (gc=cs), nor Format
72d4e865
JV
234(gc=cf) code points. The Format code points represent the biggest
235possible problem. All but 36 of them are either officially deprecated
236or strongly discouraged from being used. Of those 36, likely the most
3ab3a109 237widely used are the soft hyphen (U+00AD), and BOM, ZWSP, ZWNJ, WJ, and
b21d8e53 238similar characters, plus bidirectional controls.
3ab3a109 239
b16f1257 240C<\p{Alpha}> now matches the same characters as C<\p{Alphabetic}>. Before 5.12, Perl's definition
3ab3a109 241definition included a number of things that aren't really alpha (all
72d4e865
JV
242marks) while omitting many that were. The
243definitions of C<\p{Alnum}> and C<\p{Word}> depend on Alpha's definition and have changed accordingly.
3ab3a109 244
72d4e865 245C<\p{Word}> no longer incorrectly matches non-word characters such as fractions.
3ab3a109
JV
246
247C<\p{Print}> no longer matches the line control characters: Tab, LF, CR,
72d4e865 248FF, VT, and NEL. This brings it in line with standards and the documentation.
3ab3a109 249
72d4e865 250C<\p{XDigit}> now matches the same characters as C<\p{Hex_Digit}>. This
b21d8e53
KW
251means that in addition to the characters it currently matches,
252C<[A-Fa-f0-9]>, it will also match the 22 fullwidth equivalents, for
253example U+FF10: FULLWIDTH DIGIT ZERO.
254
3ab3a109
JV
255The Numeric type property has been extended to include the Unihan
256characters.
257
258There is a new Perl extension, the 'Present_In', or simply 'In',
72d4e865 259property. This is an extension of the Unicode Age property, but
3ab3a109 260C<\p{In=5.0}> matches any code point whose usage has been determined
72d4e865 261I<as of> Unicode version 5.0. The C<\p{Age=5.0}> only matches code points
3ab3a109
JV
262added in I<precisely> version 5.0.
263
72d4e865
JV
264A number of properties now have the correct values for unassigned
265code points. The affected properties are
3ab3a109
JV
266Bidi_Class, East_Asian_Width, Joining_Type, Decomposition_Type,
267Hangul_Syllable_Type, Numeric_Type, and Line_Break.
268
269The Default_Ignorable_Code_Point, ID_Continue, and ID_Start properties
72d4e865 270are now up to date with current Unicode definitions.
3ab3a109 271
72d4e865
JV
272Earlier versions of Perl erroneously exposed certain properties that are supposed to be Unicode internal-only.
273Use of these in regular expressions will now generate, if enabled, a deprecation warning message.
3ab3a109
JV
274The properties are: Other_Alphabetic, Other_Default_Ignorable_Code_Point,
275Other_Grapheme_Extend, Other_ID_Continue, Other_ID_Start, Other_Lowercase,
276Other_Math, and Other_Uppercase.
277
72d4e865
JV
278It is now possible to change which Unicode properties Perl understands
279on a per-installation basis. As mentioned above, certain properties
280are turned off by default. These include all the Unihan properties
281(which should be accessible via the CPAN module Unicode::Unihan) and any
282deprecated or Unicode internal-only property that Perl has never exposed.
3ab3a109
JV
283
284The generated files in the C<lib/unicore/To> directory are now more
285clearly marked as being stable, directly usable by applications.
286New hash entries in them give the format of the normal entries,
72d4e865
JV
287which allows for easier machine parsing. Perl can generate files
288in this directory for any property, though most are suppressed.
289You can find instructions for changing which are written in L<perluniprops>.
3ab3a109
JV
290
291=head2 Regular Expressions
292
293U+0FFFF is now a legal character in regular expressions.
294
3ab3a109
JV
295=head2 A proper interface for pluggable Method Resolution Orders
296
72d4e865
JV
297As of Perl 5.12.0 there is a new interface for plugging and using method
298resolution orders other than the default linear depth first search.
3ab3a109
JV
299The C3 method resolution order added in 5.10.0 has been re-implemented as
300a plugin, without changing its Perl-space interface. See L<perlmroapi> for
301more information.
302
303=head2 The C<overloading> pragma
304
305This pragma allows you to lexically disable or enable overloading
306for some or all operations. (Yuval Kogman)
307
b3b85878 308
5e75e599
KW
309=head2 \N{...} now compiles better, always forces UTF-8 internal representation.
310
311There were several problems that have been fixed with recognizing C<\N{...}>
72d4e865 312constructs. As part of this, any scalar or regex that has either a
5e75e599 313C<\N{I<name>}> or C<\N{U+I<wide hex char>}> in its definition will be stored in
72d4e865 314UTF-8 format. (This was true previously for all occurences of C<\N{I<name>}>
5e75e599
KW
315that did not use a custom translator, but now it's always true.)
316
72d4e865 317=head2 C<\N> experimental regex escape
3ab3a109 318
72d4e865
JV
319Perl now supports C<\N>, a new regex escape which you can think of as
320the inverse of C<\n>. It will match any character that is not a newline,
321independently from the presence or absence of the single line match
322modifier C</s>. It is not usable within a character class. C<\N{3}>
323means to match 3 non-newlines; C<\N{5,}> means to match at least 5.
324C<\N{NAME}> still means the character or sequence named C<NAME>, but
325C<NAME> no longer can be things like C<3>, or C<5,>.
326
327This will break a L<custom charnames translator|charnames/CUSTOM
328TRANSLATORS> which allows numbers for character names, as C<\N{3}> will
329now mean to match 3 non-newline characters, and not the character whose
330name is C<3>. (No name defined by the Unicode standard is a number,
331so only custom translators might be affected.)
332
333Perl's developers are somewhat concerned about possible user confusion
334with the existing C<\N{...}> construct which matches characters by their
335Unicode name. Consequently, this feature is experimental. We may remove
336it or change it in a backwards-incompatible way in Perl 5.14.
3ab3a109
JV
337
338=head2 DTrace support
339
72d4e865 340Perl now has some support for DTrace. See "DTrace support" in F<INSTALL>.
3ab3a109
JV
341
342=head2 Support for C<configure_requires> in CPAN module metadata
343
344Both C<CPAN> and C<CPANPLUS> now support the C<configure_requires> keyword
345in the F<META.yml> metadata file included in most recent CPAN distributions.
346This allows distribution authors to specify configuration prerequisites that
347must be installed before running F<Makefile.PL> or F<Build.PL>.
348
349See the documentation for C<ExtUtils::MakeMaker> or C<Module::Build> for more
350on how to specify C<configure_requires> when creating a distribution for CPAN.
351
352=head2 C<each> is now more flexible
353
354The C<each> function can now operate on arrays.
355
356=head2 Y2038 compliance
357
72d4e865 358Perl's core time-related functions are now Y2038 compliant. (It may not mean much to you, but your kids will love it!)
3ab3a109
JV
359
360=head2 C<$,> flexibility
361
362The variable C<$,> may now be tied.
363
364=head2 // in where clauses
365
366// now behaves like || in when clauses
367
368=head2 Enabling warnings from your shell environment
369
370You can now set C<-W> from the C<PERL5OPT> environment variable
371
372=head2 C<delete local>
373
374C<delete local> now allows you to locally delete a hash entry.
375
376=head2 New support for Abstract namespace sockets
377
378Abstract namespace sockets are Linux-specific socket type that live in
379AF_UNIX family, slightly abusing it to be able to use arbitrary
380character arrays as addresses: They start with nul byte and are not
381terminated by nul byte, but with the length passed to the socket()
382system call.
383
72d4e865 384=head2 32-bit limit on substr arguments removed
3ab3a109 385
72d4e865
JV
386The 32-bit limit on C<substr> arguments has now been removed. The full range
387of the system's signed and unsigned integers is now available for the C<pos>
388and C<len> arguments.
3ab3a109 389
72d4e865 390=head1 Incompatible Changes
3ab3a109 391
72d4e865 392=head2 Deprecations warn by default
3ab3a109 393
72d4e865
JV
394Perl now defaults to issuing a warning if a deprecated language feature
395is used.
252eec4f 396
72d4e865
JV
397To disable this feature in a given lexical scope, you should use C<no
398warnings 'deprecated';> For information about which language features
399are deprecated and explanations of various deprecation warnings, please
400see L<perldiag.pod>
3ab3a109
JV
401
402=head2 Version number formats
403
404Acceptable version number formats have been formalized into "strict" and
72d4e865 405"lax" rules. C<package NAME VERSION> takes a strict version number.
fab55263 406C<UNIVERSAL::VERSION> and the L<version> object constructors take lax
72d4e865
JV
407version numbers. Providing an invalid version will result in a fatal
408error. The version argument in C<use NAME VERSION> is first parsed as a
fab55263
DG
409numeric literal or v-string and then passed to C<UNIVERSAL::VERSION>
410(and must then pass the "lax" format test).
411
72d4e865 412These formats are documented fully in the L<version> module. To a first
fab55263
DG
413approximation, a "strict" version number is a positive decimal number
414(integer or decimal-fraction) without exponentiation or else a
415dotted-decimal v-string with a leading 'v' character and at least three
72d4e865
JV
416components. A "lax" version number allows v-strings with fewer than
417three components or without a leading 'v'. Under "lax" rules, both
fab55263
DG
418decimal and dotted-decimal versions may have a trailing "alpha"
419component separated by an underscore character after a fractional or
420dotted-decimal component.
3ab3a109
JV
421
422The L<version> module adds C<version::is_strict> and C<version::is_lax>
423functions to check a scalar against these rules.
424
c66407fa 425=head2 @INC reorganization
3ab3a109
JV
426
427In @INC, ARCHLIB and PRIVLIB now occur after after the current version's
428site_perl and vendor_perl.
429
430=head2 Switch statement changes
431
432The handling of complex expressions by the C<given>/C<when> switch
433statement has been enhanced. These enhancements are also available in
c66407fa
RS
4345.10.1 and subsequent 5.10 releases. There are two new cases where
435C<when> now interprets its argument as a boolean, instead of an
436expression to be used in a smart match:
3ab3a109
JV
437
438=head2 flip-flop operators
439
440The C<..> and C<...> flip-flop operators are now evaluated in boolean
441context, following their usual semantics; see L<perlop/"Range Operators">.
442
443Note that, as in perl 5.10.0, C<when (1..10)> will not work to test
444whether a given value is an integer between 1 and 10; you should use
445C<when ([1..10])> instead (note the array reference).
446
447However, contrary to 5.10.0, evaluating the flip-flop operators in boolean
448context ensures it can now be useful in a C<when()>, notably for
449implementing bistable conditions, like in:
450
451 when (/^=begin/ .. /^=end/) {
452 # do something
453 }
454
455=head2 defined-or operator
456
457A compound expression involving the defined-or operator, as in
458C<when (expr1 // expr2)>, will be treated as boolean if the first
459expression is boolean. (This just extends the existing rule that applies
460to the regular or operator, as in C<when (expr1 || expr2)>.)
461
462=head2 Smart match changes
463
464This section details more changes brought to the semantics to
465the smart match operator, that naturally also modify the behaviour
466of the switch statements where smart matching is implicitly used.
c66407fa 467These changes were also made for the 5.10.1 release, and will remain in
3ab3a109
JV
468subsequent 5.10 releases.
469
3ab3a109
JV
470=head3 Changes to type-based dispatch
471
472The smart match operator C<~~> is no longer commutative. The behaviour of
473a smart match now depends primarily on the type of its right hand
474argument. Moreover, its semantics have been adjusted for greater
475consistency or usefulness in several cases. While the general backwards
476compatibility is maintained, several changes must be noted:
477
478=over 4
479
480=item *
481
482Code references with an empty prototype are no longer treated specially.
483They are passed an argument like the other code references (even if they
484choose to ignore it).
485
486=item *
487
488C<%hash ~~ sub {}> and C<@array ~~ sub {}> now test that the subroutine
489returns a true value for each key of the hash (or element of the
490array), instead of passing the whole hash or array as a reference to
491the subroutine.
492
493=item *
494
495Due to the commutativity breakage, code references are no longer
496treated specially when appearing on the left of the C<~~> operator,
497but like any vulgar scalar.
498
499=item *
500
501C<undef ~~ %hash> is always false (since C<undef> can't be a key in a
502hash). No implicit conversion to C<""> is done (as was the case in perl
5035.10.0).
504
505=item *
506
507C<$scalar ~~ @array> now always distributes the smart match across the
508elements of the array. It's true if one element in @array verifies
509C<$scalar ~~ $element>. This is a generalization of the old behaviour
510that tested whether the array contained the scalar.
511
512=back
513
514The full dispatch table for the smart match operator is given in
515L<perlsyn/"Smart matching in detail">.
516
517=head3 Smart match and overloading
518
519According to the rule of dispatch based on the rightmost argument type,
520when an object overloading C<~~> appears on the right side of the
521operator, the overload routine will always be called (with a 3rd argument
522set to a true value, see L<overload>.) However, when the object will
523appear on the left, the overload routine will be called only when the
c66407fa
RS
524rightmost argument is a simple scalar. This way, distributivity of smart
525match across arrays is not broken, as well as the other behaviours with
526complex types (coderefs, hashes, regexes). Thus, writers of overloading
527routines for smart match mostly need to worry only with comparing
528against a scalar, and possibly with stringification overloading; the
529other common cases will be automatically handled consistently.
3ab3a109
JV
530
531C<~~> will now refuse to work on objects that do not overload it (in order
532to avoid relying on the object's underlying structure). (However, if the
533object overloads the stringification or the numification operators, and
534if overload fallback is active, it will be used instead, as usual.)
535
536=head2 Labels can't be keywords
537
538Labels used as targets for the C<goto>, C<last>, C<next> or C<redo>
539statements cannot be keywords anymore. This restriction will prevent
540potential confusion between the C<goto LABEL> and C<goto EXPR> syntaxes:
541for example, a statement like C<goto print> would jump to a label whose
542name would be the return value of C<print()>, (usually 1), instead of a
543label named C<print>. Moreover, the other control flow statements
544would just ignore any keyword passed to them as a label name. Since
545such labels cannot be defined anymore, this kind of error will be
546avoided.
547
548=head2 Other incompatible changes
549
550=over 4
551
552=item *
553
b16f1257
JV
554The definitions of a number of Unicode properties have changed to match
555those of the current Unicode standard. These are listed above under
556L</Overhaul of Unicode property support>. This could break code that
557is expecting the old definitions.
3ab3a109
JV
558
559=item *
560
b21d8e53
KW
561The boolkeys op moved to the group of hash ops. This breaks binary
562compatibility.
c66407fa
RS
563
564=item *
565
72d4e865 566Filehandles are now always blessed into C<IO::File>.
c66407fa
RS
567
568The previous behaviour was to bless Filehandles into L<FileHandle>
569(an empty proxy class) if it was loaded into memory and otherwise
570to bless them into C<IO::Handle>.
571
572=item *
573
574The semantics of C<use feature :5.10*> have changed slightly.
575See L<"Modules and Pragmata"> for more information.
3ab3a109
JV
576
577=item *
578
579The version control system used for the development of the perl
72d4e865 580interpreter has been switched from Perforce to git. This is mainly an
3ab3a109
JV
581internal issue that only affects people actively working on the perl core;
582but it may have minor external visibility, for example in some of details
583of the output of C<perl -V>. See L<perlrepository> for more information.
584
585=item *
586
587The internal structure of the C<ext/> directory in the perl source has
588been reorganised. In general, a module C<Foo::Bar> whose source was
589stored under F<ext/Foo/Bar/> is now located under F<ext/Foo-Bar/>. Also,
590nearly all dual-life modules have been moved from F<lib/> to F<ext/>. This
591is purely a source tarball change, and should make no difference to the
592compilation or installation of perl, unless you have a very customised build
593process that explicitly relies on this structure, or which hard-codes the
594C<nonxs_ext> F<Configure> parameter. Specifically, this change does not by
595default alter the location of any files in the final installation.
596
597=item *
598
599As part of the C<Test::Harness> 2.x to 3.x upgrade, the experimental
600C<Test::Harness::Straps> module has been removed.
601See L</"Updated Modules"> for more details.
602
603=item *
604
605As part of the C<ExtUtils::MakeMaker> upgrade, the
606C<ExtUtils::MakeMaker::bytes> and C<ExtUtils::MakeMaker::vmsish> modules
607have been removed from this distribution.
608
609=item *
610
611C<Module::CoreList> no longer contains the C<%:patchlevel> hash.
612
613=item *
614
615This one is actually a change introduced in 5.10.0, but it was missed
616from that release's perldelta, so it is mentioned here instead.
617
618A bugfix related to the handling of the C</m> modifier and C<qr> resulted
619in a change of behaviour between 5.8.x and 5.10.0:
620
621 # matches in 5.8.x, doesn't match in 5.10.0
622 $re = qr/^bar/; "foo\nbar" =~ /$re/m;
623
624=item *
625
626C<length undef> now returns undef.
627
628=item *
629
630Unsupported private C API functions are now declared "static" to prevent
631leakage to Perl's public API.
632
633=item *
634
635To support the bootstrapping process, F<miniperl> no longer builds with
636UTF-8 support in the regexp engine.
637
638This allows a build to complete with PERL_UNICODE set and a UTF-8 locale.
639Without this there's a bootstrapping problem, as miniperl can't load the UTF-8
640components of the regexp engine, because they're not yet built.
641
642=item *
643
c66407fa
RS
644F<miniperl>'s @INC is now restricted to just C<-I...>, the split of
645C<$ENV{PERL5LIB}>, and "C<.>"
3ab3a109
JV
646
647=item *
648
649A space or a newline is now required after a C<"#line XXX"> directive.
650
651=item *
652
653Tied filehandles now have an additional method EOF which provides the EOF type
654
655=item *
656
c66407fa
RS
657To better match all other flow control statements, C<foreach> may no
658longer be used as an attribute.
3ab3a109
JV
659
660=back
661
662=head1 Deprecations
663
664From time to time, Perl's developers find it necessary to deprecate
665features or modules we've previously shipped as part of the core
666distribution. We are well aware of the pain and frustration that a
667backwards-incompatible change to Perl can cause for developers building
668or maintaining software in Perl. You can be sure that when we deprecate
669a functionality or syntax, it isn't a choice we make lightly. Sometimes,
670we choose to deprecate functionality or syntax because it was found to
671be poorly designed or implemented. Sometimes, this is because they're
672holding back other features or causing performance problems. Sometimes,
673the reasons are more complex. Wherever possible, we try to keep deprecated
674functionality available to developers in its previous form for at least
72d4e865 675one major release. So long as a deprecated feature isn't actively
3ab3a109
JV
676disrupting our ability to maintain and extend Perl, we'll try to leave
677it in place as long as possible.
678
679The following items are now deprecated.
680
681=over 4
682
683=item Use of C<:=> to mean an empty attribute list is now deprecated.
684
685An accident of Perl's parser meant that these constructions were all
686equivalent:
687
688 my $pi := 4;
689 my $pi : = 4;
690 my $pi : = 4;
691
692with the C<:> being treated as the start of an attribute list, which
693ends before the C<=>. As whitespace is not significant here, all are
694parsed as an empty attribute list, hence all the above are equivalent
695to, and better written as
696
697 my $pi = 4;
698
699because no attribute processing is done for an empty list.
700
701As is, this meant that C<:=> cannot be used as a new token, without
702silently changing the meaning of existing code. Hence that particular
703form is now deprecated, and will become a syntax error. If it is
704absolutely necessary to have empty attribute lists (for example,
705because of a code generator) then avoid the warning by adding a space
706before the C<=>.
707
c66407fa 708=item C<< UNIVERSAL->import() >>
3ab3a109 709
72d4e865 710The method C<< UNIVERSAL->import() >> is now deprecated. Attempting to
3ab3a109 711pass import arguments to a C<use UNIVERSAL> statement will result in a
c66407fa 712deprecation warning.
3ab3a109
JV
713
714=item Use of "goto" to jump into a construct is deprecated
715
c66407fa
RS
716Using C<goto> to jump from an outer scope into an inner scope is now
717deprecated. This rare use case was causing problems in the
718implementation of scopes.
3ab3a109 719
8c66a230
KW
720=item Custom character names in \N{name} should look like names
721
72d4e865 722In C<\N{I<name>}>, I<name> can be just about anything. The standard Unicode
8c66a230 723names have a very limited domain, but a custom name translator could create
72d4e865 724names that are, for example, made up entirely of punctuation symbols. It is
8c66a230
KW
725now deprecated to make names that don't begin with an alphabetic character, and
726aren't alphanumeric or contain other than a very few other characters,
72d4e865 727namely spaces, dashes, parentheses and colons. Because of the added meaning of
8c66a230 728C<\N> (See L</C<\N> experimental regex escape>), names that look like curly
72d4e865 729brace -enclosed quantifiers won't work. For example, C<\N{3,4}> now means to
8c66a230
KW
730match 3 to 4 non-newlines; before a custom name C<3,4> could have been created.
731
3ab3a109
JV
732=item Deprecated Modules
733
734The following modules will be removed from the core distribution in a future
735release, and should be installed from CPAN instead. Distributions on CPAN
736which require these should add them to their prerequisites. The core versions
737of these modules warnings will issue a deprecation warning.
738
8df7d2a3
JV
739If you ship a packaged version of Perl, either alone or as part of a larger
740system, then you should carefully consider the reprecussions of core module
72d4e865 741deprecations. You may want to consider shipping your default build of
8df7d2a3
JV
742Perl with packages for some or all deprecated modules which install into
743C<vendor> or C<site> perl library directories. This will inhibit the
744deprecation warnings.
745
746Alternatively, you may want to consider patching F<lib/deprecate.pm>
747to provide deprecation warnings specific to your packaging system or
b951c6bd
NC
748distribution of Perl, consistent with how your packaging system or
749distribution manages a staged transition from a release where the
750installation of a single package provides the given functionality, to a later
751release where the system administrator needs to know to install multiple
752packages to get that same functionality.
8df7d2a3 753
3ab3a109
JV
754=over
755
c66407fa
RS
756=item L<Class::ISA>
757
758=item L<Pod::Plainer>
759
760=item L<Shell>
3ab3a109 761
c66407fa 762=item L<Switch>
3ab3a109 763
72d4e865 764Switch is buggy and should be avoided. See L<perlsyn/"Switch
c66407fa 765statements"> for its replacement.
3ab3a109
JV
766
767=back
768
769=item suidperl
770
771C<suidperl> has been removed. It used to provide a mechanism to
772emulate setuid permission bits on systems that don't support it properly.
773
774=item Assignment to $[
775
776=item attrs
777
778Remove attrs, which has been deprecated since 1999-10-02.
779
780=item Use of the attribute :locked on subroutines.
781
782=item Use of "locked" with the attributes pragma.
783
784=item Use of "unique" with the attributes pragma.
785
786=item Numerous Perl 4-era libraries:
787
788F<termcap.pl>, F<tainted.pl>, F<stat.pl>, F<shellwords.pl>, F<pwd.pl>,
789F<open3.pl>, F<open2.pl>, F<newgetopt.pl>, F<look.pl>, F<find.pl>,
790F<finddepth.pl>, F<importenv.pl>, F<hostname.pl>, F<getopts.pl>,
791F<getopt.pl>, F<getcwd.pl>, F<flush.pl>, F<fastcwd.pl>, F<exceptions.pl>,
792F<ctime.pl>, F<complete.pl>, F<cacheout.pl>, F<bigrat.pl>, F<bigint.pl>,
793F<bigfloat.pl>, F<assert.pl>, F<abbrev.pl>, F<dotsh.pl>, and
794F<timelocal.pl> are all now deprecated. Using them will incur a warning.
795
796=back
797
798=head1 Modules and Pragmata
799
800=head2 Dual-lifed modules moved
801
802Dual-lifed modules maintained primarily in the Perl core now live in dist/.
803Dual-lifed modules maintained primarily on CPAN now live in cpan/
804
805In previous releases of Perl, it was customary to enumerate all module
c66407fa
RS
806changes in this section of the C<perldelta> file. From 5.11.0 forward
807only notable updates (such as new or deprecated modules ) will be listed
808in this section. For a complete reference to the versions of modules
809shipped in a given release of perl, please see L<Module::CoreList>.
3ab3a109
JV
810
811=head2 New Modules and Pragmata
812
813=over 4
814
815=item *
816
817C<autodie>
818
819This is a new lexically-scoped alternative for the C<Fatal> module.
820The bundled version is 2.06_01. Note that in this release, using a string
821eval when C<autodie> is in effect can cause the autodie behaviour to leak
822into the surrounding scope. See L<autodie/"BUGS"> for more details.
823
824=item *
825
826C<Compress::Raw::Bzip2>
827
828This has been added to the core (version 2.020).
829
830=item *
831
832C<parent>
833
834This pragma establishes an ISA relationship with base classes at compile
c66407fa
RS
835time. It provides the key feature of C<base> without further unwanted
836behaviors.
3ab3a109
JV
837
838=item *
839
840C<Parse::CPAN::Meta>
841
842This has been added to the core (version 1.39).
843
844=back
845
846=head2 Pragmata Changes
847
848=over 4
849
850=item *
851
852C<overloading>
853
854See L</"The C<overloading> pragma"> above.
855
856=item *
857
858C<attrs>
859
860The C<attrs> pragma has been removed. It had been marked as deprecated since
8615.6.0.
862
863=item *
864
865C<charnames>
866
867The Unicode F<NameAliases.txt> database file has been added. This has the
868effect of adding some extra C<\N> character names that formerly wouldn't
869have been recognised; for example, C<"\N{LATIN CAPITAL LETTER GHA}">.
870
871=item *
872
873C<feature>
874
875The meaning of the C<:5.10> and C<:5.10.X> feature bundles has
876changed slightly. The last component, if any (i.e. C<X>) is simply ignored.
877This is predicated on the assumption that new features will not, in
878general, be added to maintenance releases. So C<:5.10> and C<:5.10.X>
879have identical effect. This is a change to the behaviour documented for
8805.10.0.
881
882=item *
883
884C<mro>
885
886Upgraded from version 1.00 to 1.01. Performance for single inheritance is 40%
887faster - see L</"Performance Enhancements"> below.
888
889C<mro> is now implemented as an XS extension. The documented interface has not
890changed. Code relying on the implementation detail that some C<mro::>
891methods happened to be available at all times gets to "keep both pieces".
892
893=item *
894
895C<diagnostics>
896
897Supports %.0f formatting internally.
898
899=item *
900
901C<overload>
902
903Allow overloading of 'qr'.
904
905=item *
906
907C<constant>
908
909Upgraded from version 1.19 to 1.20.
910
911=item *
912
913C<diagnostics>
914
c66407fa
RS
915This pragma no longer suppresses C<Use of uninitialized value in range
916(or flip)> warnings. [perl #71204]
3ab3a109
JV
917
918=item *
919
920C<feature>
921
72d4e865 922Upgraded from 1.13 to 1.14. Added the C<unicode_strings> feature:
3ab3a109
JV
923
924 use feature "unicode_strings";
925
926This pragma turns on Unicode semantics for the case-changing operations
c66407fa
RS
927(C<uc>, C<lc>, C<ucfirst>, C<lcfirst>) on strings that don't have the
928internal UTF-8 flag set, but that contain single-byte characters between
929128 and 255.
3ab3a109
JV
930
931=item *
932
933C<threads>
934
935Upgraded from version 1.74 to 1.75.
936
937=item *
938
939C<less>
940
c66407fa 941Upgraded from version 0.02 to 0.03.
3ab3a109 942
c66407fa
RS
943This version introduces the C<stash_name> method to allow subclasses of
944C<less> to pick where in %^H to store their stash.
3ab3a109
JV
945
946=item *
947
948C<version>
949
950Upgraded from version 0.77 to 0.81.
951
952This version adds support for L</Version number formats> as described earlier
953in this document and in its own documentation.
954
955=item *
956
957C<warnings>
958
959Upgraded from 1.07 to 1.09.
960
961Added new C<warnings::fatal_enabled()> function.
72d4e865 962This version adds the C<illegalproto> warning category. See also L</New or
3ab3a109
JV
963Changed Diagnostics> for this change.
964
965=back
966
967
968=head2 Updated Modules
969
970=over 4
971
972=item XXX TODO RECALCULATE THIS VS 5.10.0
973
974=back
975
976=head2 Removed Modules and Pragmata
977
978=over 4
979
980=item *
981
982C<Devel::DProf::V>
983
72d4e865 984Removed from the Perl core. Prior version was 'undef'.
3ab3a109
JV
985
986=back
987
988=head1 Documentation
989
990=head2 New Documentation
991
992=over 4
993
994=item *
995
996L<perlhaiku>
997
998This contains instructions on how to build perl for the Haiku platform.
999
1000=item *
1001
1002L<perlmroapi>
1003
1004This describes the new interface for pluggable Method Resolution Orders.
1005
1006=item *
1007
1008L<perlperf>
1009
1010This document, by Richard Foley, provides an introduction to the use of
1011performance and optimization techniques which can be used with particular
1012reference to perl programs.
1013
1014=item *
1015
1016L<perlrepository>
1017
1018This describes how to access the perl source using the I<git> version
1019control system.
1020
1021=item *
1022
1023L<perlpolicy> extends the "Social contract about contributed modules" into
1024the beginnings of a document on Perl porting policies.
1025
1026=back
1027
1028=head2 Changes to Existing Documentation
1029
72d4e865
JV
1030=over
1031
1032
1033=item *
1034
3ab3a109
JV
1035The various large F<Changes*> files (which listed every change made to perl
1036over the last 18 years) have been removed, and replaced by a small file,
1037also called F<Changes>, which just explains how that same information may
1038be extracted from the git version control system.
1039
72d4e865
JV
1040=item *
1041
3ab3a109
JV
1042The file F<Porting/patching.pod> has been deleted, as it mainly described
1043interacting with the old Perforce-based repository, which is now obsolete.
1044Information still relevant has been moved to L<perlrepository>.
1045
3ab3a109 1046
72d4e865
JV
1047=item *
1048
1049The syntax C<unless (EXPR) BLOCK else BLOCK> is now documented as valid, as
1050is the syntax C<unless (EXPR) BLOCK elsif (EXPR) BLOCK ... else BLOCK>,
1051although actually using the latter may not be the best idea for the
1052readability of your source code.
1053
3ab3a109
JV
1054
1055=item *
1056
1057Documented -X overloading.
1058
1059=item *
1060
1061Documented that C<when()> treats specially most of the filetest operators
1062
1063=item *
1064
c66407fa 1065Documented C<when> as a syntax modifier
3ab3a109
JV
1066
1067=item *
1068
c66407fa 1069Eliminated "Old Perl threads tutorial", which described 5005 threads.
3ab3a109
JV
1070
1071F<pod/perlthrtut.pod> is the same material reworked for ithreads.
1072
1073=item *
1074
1075Correct previous documentation: v-strings are not deprecated
1076
72d4e865 1077With version objects, we need them to use MODULE VERSION syntax. This
c66407fa 1078patch removes the deprecation notice.
3ab3a109
JV
1079
1080=item *
1081
1082Added security contact information to L<perlsec>
1083
1084A significant fraction of the core documentation has been updated to clarify
1085the behavior of Perl's Unicode handling.
1086
1087Much of the remaining core documentation has been reviewed and edited
1088for clarity, consistent use of language, and to fix the spelling of Tom
1089Christiansen's name.
1090
1091The Pod specification (L<perlpodspec>) has been updated to bring the
c66407fa 1092specification in line with modern usage already supported by most Pod
72d4e865
JV
1093systems. A parameter string may now follow the format name in a
1094"begin/end" region. Links to URIs with a text description are now
1095allowed. The usage of C<LE<lt>"section"E<gt>> has been marked as
c66407fa 1096deprecated.
3ab3a109
JV
1097
1098L<if.pm|if> has been documented in L<perlfunc/use> as a means to get
c66407fa
RS
1099conditional loading of modules despite the implicit BEGIN block around
1100C<use>.
3ab3a109
JV
1101
1102=item *
1103
c66407fa 1104The documentation for C<$1> in perlvar.pod has been clarified.
3ab3a109 1105
a620a577
KW
1106=item *
1107
1108C<\N{U+I<wide hex char>}> is now documented.
1109
3ab3a109
JV
1110=back
1111
1112=head1 Performance Enhancements
1113
1114=over 4
1115
1116=item *
1117
1118A new internal cache means that C<isa()> will often be faster.
1119
1120=item *
1121
1122The implementation of C<C3> Method Resolution Order has been optimised -
1123linearisation for classes with single inheritance is 40% faster. Performance
1124for multiple inheritance is unchanged.
1125
1126=item *
1127
1128Under C<use locale>, the locale-relevant information is now cached on
1129read-only values, such as the list returned by C<keys %hash>. This makes
1130operations such as C<sort keys %hash> in the scope of C<use locale> much
1131faster.
1132
1133=item *
1134
1135Empty C<DESTROY> methods are no longer called.
1136
1137=item *
1138
1139Faster C<Perl_sv_utf8_upgrade()>
1140
1141=item *
1142
1143Speed up C<keys> on empty hash
1144
1145=item *
1146
1147C<if (%foo)> has been optimized to be faster than C<if (keys %foo)>
1148
1149=item *
1150
1151Reversing an array to itself (as in C<@a = reverse @a>) in void context
1152now happens in-place and is several orders of magnitude faster than it
1153used to be. It will also preserve non-existent elements whenever
1154possible, i.e. for non magical arrays or tied arrays with C<EXISTS> and
1155C<DELETE> methods.
1156
1157=back
1158
1159=head1 Installation and Configuration Improvements
1160
1161=head2 F<ext/> reorganisation
1162
1163The layout of directories in F<ext> has been revised. Specifically, all
1164extensions are now flat, and at the top level, with C</> in pathnames
1165replaced by C<->, so that F<ext/Data/Dumper/> is now F<ext/Data-Dumper/>,
72d4e865 1166etc. The names of the extensions as specified to F<Configure>, and as
3ab3a109
JV
1167reported by C<%Config::Config> under the keys C<dynamic_ext>,
1168C<known_extensions>, C<nonxs_ext> and C<static_ext> have not changed, and
1169still use C</>. Hence this change will not have any affect once perl is
1170installed. C<Safe> has been split out from being part of C<Opcode>, and
1171C<mro> is now an extension in its own right.
1172
1173Nearly all dual-life modules have been moved from F<lib> to F<ext>, and will
1174now appear as known C<nonxs_ext>. This will made no difference to the
1175structure of an installed perl, nor will the modules installed differ,
1176unless you run F<Configure> with options to specify an exact list of
1177extensions to build. In this case, you will rapidly become aware that you
1178need to add to your list, because various modules needed to complete the
1179build, such as C<ExtUtils::ParseXS>, have now become extensions, and
1180without them the build will fail well before it attempts to run the
1181regression tests.
1182
b16f1257 1183=head2 Other Installation and Configuration Improvements
72d4e865
JV
1184
1185=over 4
1186
1187=item *
1188
1189L<perlapi>, L<perlintern>, L<perlmodlib> and L<perltoc> are now all
1190generated at build time, rather than being shipped as part of the release.
1191
1192=item *
3ab3a109
JV
1193
1194If C<vendorlib> and C<vendorarch> are the same, then they are only added to
1195C<@INC> once.
1196
72d4e865
JV
1197=item *
1198
3ab3a109
JV
1199C<$Config{usedevel}> and the C-level C<PERL_USE_DEVEL> are now defined if
1200perl is built with C<-Dusedevel>.
1201
72d4e865
JV
1202=item *
1203
3ab3a109
JV
1204F<Configure> will enable use of C<-fstack-protector>, to provide protection
1205against stack-smashing attacks, if the compiler supports it.
1206
72d4e865
JV
1207=item *
1208
3ab3a109 1209F<Configure> will now determine the correct prototypes for re-entrant
c66407fa 1210functions and for C<gconvert> if you are using a C++ compiler rather
3ab3a109
JV
1211than a C compiler.
1212
72d4e865
JV
1213=item *
1214
3ab3a109
JV
1215On Unix, if you build from a tree containing a git repository, the
1216configuration process will note the commit hash you have checked out, for
1217display in the output of C<perl -v> and C<perl -V>. Unpushed local commits
1218are automatically added to the list of local patches displayed by
1219C<perl -V>.
1220
72d4e865
JV
1221=item *
1222
3ab3a109
JV
1223USE_ATTRIBUTES_FOR_PERLIO is now reported in the compile-time options
1224listed by the C<-V> switch.
1225
72d4e865
JV
1226=item *
1227
1228Support for SystemTap's C<dtrace> compatibility layer has been added and an
1229issue with linking C<miniperl> has been fixed in the process.
1230
1231=item *
1232
1233C<less -R> is now used instead of C<less> for C<groff>'s new usage of ANSI
1234escape codes by setting C<$Config{less}> (and thereby C<$Config{pager}>,
1235which fixes RT #72156.
1236
1237=item *
1238
1239USE_PERL_ATOF is now reported in the compile-time options listed by the C<-V>
1240switch.
1241
1242=back
1243
1244
3ab3a109
JV
1245=head2 Compilation improvements
1246
1247As part of the flattening of F<ext>, all extensions on all platforms are
1248built by F<make_ext.pl>. This replaces the Unix-specific
1249F<ext/util/make_ext>, VMS-specific F<make_ext.com> and Win32-specific
1250F<win32/buildext.pl>.
1251
3ab3a109
JV
1252=head1 Changed Internals
1253
1254=over 4
1255
1256=item *
1257
1258C<Perl_pmflag> has been removed from the public API. Calling it now
1259generates a deprecation warning, and it will be removed in a future
1260release. Although listed as part of the API, it was never documented,
1261and only ever used in F<toke.c>, and prior to 5.10, F<regcomp.c>. In
1262core, it has been replaced by a static function.
1263
1264=item *
1265
1266Perl_magic_setmglob now knows about globs, fixing RT #71254.
1267
1268=item *
1269
1270TODO: C<SVt_RV> is gone. RVs are now stored in IVs
1271
1272=item *
1273
1274TODO: REGEXPs are first class
1275
1276=item *
1277
1278TODO: OOK is reworked, such that an OOKed scalar is PV not PVIV
1279
1280=item *
1281
1282The J.R.R. Tolkien quotes at the head of C source file have been checked and
1283proper citations added, thanks to a patch from Tom Christiansen.
1284
1285=item *
1286
1287C<Perl_vcroak()> now accepts a null first argument. In addition, a full audit
1288was made of the "not NULL" compiler annotations, and those for several
1289other internal functions were corrected.
1290
1291=item *
1292
1293New macros C<dSAVEDERRNO>, C<dSAVE_ERRNO>, C<SAVE_ERRNO>, C<RESTORE_ERRNO>
1294have been added to formalise the temporary saving of the C<errno>
1295variable.
1296
1297=item *
1298
1299The function C<Perl_sv_insert_flags> has been added to augment
1300C<Perl_sv_insert>.
1301
1302=item *
1303
1304The function C<Perl_newSV_type(type)> has been added, equivalent to
1305C<Perl_newSV()> followed by C<Perl_sv_upgrade(type)>.
1306
1307=item *
1308
1309The function C<Perl_newSVpvn_flags()> has been added, equivalent to
1310C<Perl_newSVpvn()> and then performing the action relevant to the flag.
1311
1312Two flag bits are currently supported.
1313
1314=over 4
1315
1316=item *
1317
1318C<SVf_UTF8>
1319
1320This will call C<SvUTF8_on()> for you. (Note that this does not convert an
1321sequence of ISO 8859-1 characters to UTF-8). A wrapper, C<newSVpvn_utf8()>
1322is available for this.
1323
1324=item *
1325
1326C<SVs_TEMP>
1327
1328Call C<Perl_sv_2mortal()> on the new SV.
1329
1330=back
1331
1332There is also a wrapper that takes constant strings, C<newSVpvs_flags()>.
1333
1334=item *
1335
1336The function C<Perl_croak_xs_usage> has been added as a wrapper to
1337C<Perl_croak>.
1338
1339=item *
1340
1341The functions C<PerlIO_find_layer> and C<PerlIO_list_alloc> are now
1342exported.
1343
1344=item *
1345
1346C<PL_na> has been exterminated from the core code, replaced by local STRLEN
1347temporaries, or C<*_nolen()> calls. Either approach is faster than C<PL_na>,
17270880 1348which is a pointer dereference into the interpreter structure under ithreads,
3ab3a109
JV
1349and a global variable otherwise.
1350
1351=item *
1352
1353C<Perl_mg_free()> used to leave freed memory accessible via C<SvMAGIC()> on
1354the scalar. It now updates the linked list to remove each piece of magic
1355as it is freed.
1356
1357=item *
1358
1359Under ithreads, the regex in C<PL_reg_curpm> is now reference counted. This
1360eliminates a lot of hackish workarounds to cope with it not being reference
1361counted.
1362
1363=item *
1364
1365C<Perl_mg_magical()> would sometimes incorrectly turn on C<SvRMAGICAL()>.
1366This has been fixed.
1367
1368=item *
1369
1370The I<public> IV and NV flags are now not set if the string value has
1371trailing "garbage". This behaviour is consistent with not setting the
1372public IV or NV flags if the value is out of range for the type.
1373
1374=item *
1375
1376SV allocation tracing has been added to the diagnostics enabled by C<-Dm>.
1377The tracing can alternatively output via the C<PERL_MEM_LOG> mechanism, if
1378that was enabled when the F<perl> binary was compiled.
1379
1380=item *
1381
1382Smartmatch resolution tracing has been added as a new diagnostic. Use C<-DM> to
1383enable it.
1384
1385=item *
1386
1387A new debugging flag C<-DB> now dumps subroutine definitions, leaving
1388C<-Dx> for its original purpose of dumping syntax trees.
1389
1390=item *
1391
1392Uses of C<Nullav>, C<Nullcv>, C<Nullhv>, C<Nullop>, C<Nullsv> etc have been
1393replaced by C<NULL> in the core code, and non-dual-life modules, as C<NULL>
1394is clearer to those unfamiliar with the core code.
1395
1396=item *
1397
1398A macro C<MUTABLE_PTR(p)> has been added, which on (non-pedantic) gcc will
1399not cast away C<const>, returning a C<void *>. Macros C<MUTABLE_SV(av)>,
1400C<MUTABLE_SV(cv)> etc build on this, casting to C<AV *> etc without
1401casting away C<const>. This allows proper compile-time auditing of
1402C<const> correctness in the core, and helped picked up some errors (now
1403fixed).
1404
1405=item *
1406
1407Macros C<mPUSHs()> and C<mXPUSHs()> have been added, for pushing SVs on the
1408stack and mortalizing them.
1409
1410=item *
1411
1412Use of the private structure C<mro_meta> has changed slightly. Nothing
1413outside the core should be accessing this directly anyway.
1414
1415=item *
1416
1417A new tool, F<Porting/expand-macro.pl> has been added, that allows you
1418to view how a C preprocessor macro would be expanded when compiled.
1419This is handy when trying to decode the macro hell that is the perl
1420guts.
1421
1422=back
1423
1424=head1 Testing
1425
1426=head2 New Tests
1427
1428Many modules updated from CPAN incorporate new tests.
1429Several tests that have the potential to hang forever if they fail now
1430incorporate a "watchdog" functionality that will kill them after a timeout,
1431which helps ensure that C<make test> and C<make test_harness> run to
1432completion automatically. (Jerry Hedden).
1433
1434Some core-specific tests have been added:
1435
1436=over 4
1437
1438=item *
1439
1440Significant cleanups to core tests to ensure that language and
1441interpreter features are not used before they're tested.
1442
1443=item *
1444
c66407fa
RS
1445C<make test_porting> now runs a number of important pre-commit checks
1446which might be of use to anyone working on the Perl core.
3ab3a109
JV
1447
1448=item *
1449
1450F<t/porting/podcheck.t> automatically checks the well-formedness of
1451POD found in all .pl, .pm and .pod files in the F<MANIFEST>, other than in
1452dual-lifed modules which are primarily maintained outside the Perl core.
1453
1454=item *
1455
1456F<t/porting/manifest.t> now tests that all files listed in MANIFEST are present.
1457
1458=item *
1459
1460F<t/op/while_readdir.t>
1461
1462Test that a bare readdir in while loop sets $_.
1463
1464=item *
1465
c66407fa 1466F<t/comp/retainedlines.t>
3ab3a109
JV
1467
1468Check that the debugger can retain source lines from C<eval>.
1469
1470=item *
1471
c66407fa 1472F<t/io/perlio_fail.t>
3ab3a109
JV
1473
1474Check that bad layers fail.
1475
1476=item *
1477
c66407fa 1478F<t/io/perlio_leaks.t>
3ab3a109
JV
1479
1480Check that PerlIO layers are not leaking.
1481
1482=item *
1483
c66407fa 1484F<t/io/perlio_open.t>
3ab3a109
JV
1485
1486Check that certain special forms of open work.
1487
1488=item *
1489
c66407fa 1490F<t/io/perlio.t>
3ab3a109
JV
1491
1492General PerlIO tests.
1493
1494=item *
1495
c66407fa 1496F<t/io/pvbm.t>
3ab3a109
JV
1497
1498Check that there is no unexpected interaction between the internal types
1499C<PVBM> and C<PVGV>.
1500
1501=item *
1502
c66407fa 1503F<t/mro/package_aliases.t>
3ab3a109
JV
1504
1505Check that mro works properly in the presence of aliased packages.
1506
1507=item *
1508
c66407fa 1509F<t/op/dbm.t>
3ab3a109
JV
1510
1511Tests for C<dbmopen> and C<dbmclose>.
1512
1513=item *
1514
c66407fa 1515F<t/op/index_thr.t>
3ab3a109
JV
1516
1517Tests for the interaction of C<index> and threads.
1518
1519=item *
1520
c66407fa 1521F<t/op/pat_thr.t>
3ab3a109
JV
1522
1523Tests for the interaction of esoteric patterns and threads.
1524
1525=item *
1526
c66407fa 1527F<t/op/qr_gc.t>
3ab3a109
JV
1528
1529Test that C<qr> doesn't leak.
1530
1531=item *
1532
c66407fa 1533F<t/op/reg_email_thr.t>
3ab3a109
JV
1534
1535Tests for the interaction of regex recursion and threads.
1536
1537=item *
1538
c66407fa 1539F<t/op/regexp_qr_embed_thr.t>
3ab3a109
JV
1540
1541Tests for the interaction of patterns with embedded C<qr//> and threads.
1542
1543=item *
1544
c66407fa 1545F<t/op/regexp_unicode_prop.t>
3ab3a109
JV
1546
1547Tests for Unicode properties in regular expressions.
1548
1549=item *
1550
c66407fa 1551F<t/op/regexp_unicode_prop_thr.t>
3ab3a109
JV
1552
1553Tests for the interaction of Unicode properties and threads.
1554
1555=item *
1556
c66407fa 1557F<t/op/reg_nc_tie.t>
3ab3a109
JV
1558
1559Test the tied methods of C<Tie::Hash::NamedCapture>.
1560
1561=item *
1562
c66407fa 1563F<t/op/reg_posixcc.t>
3ab3a109
JV
1564
1565Check that POSIX character classes behave consistently.
1566
1567=item *
1568
c66407fa 1569F<t/op/re.t>
3ab3a109
JV
1570
1571Check that exportable C<re> functions in F<universal.c> work.
1572
1573=item *
1574
c66407fa 1575F<t/op/setpgrpstack.t>
3ab3a109
JV
1576
1577Check that C<setpgrp> works.
1578
1579=item *
1580
c66407fa 1581F<t/op/substr_thr.t>
3ab3a109
JV
1582
1583Tests for the interaction of C<substr> and threads.
1584
1585=item *
1586
c66407fa 1587F<t/op/upgrade.t>
3ab3a109
JV
1588
1589Check that upgrading and assigning scalars works.
1590
1591=item *
1592
c66407fa 1593F<t/uni/lex_utf8.t>
3ab3a109
JV
1594
1595Check that Unicode in the lexer works.
1596
1597=item *
1598
c66407fa 1599F<t/uni/tie.t>
3ab3a109
JV
1600
1601Check that Unicode and C<tie> work.
1602
1603=item *
1604
c66407fa 1605F<t/comp/final_line_num.t>
3ab3a109
JV
1606
1607See if line numbers are correct at EOF
1608
1609=item *
1610
c66407fa 1611F<t/comp/form_scope.t>
3ab3a109
JV
1612
1613See if format scoping works
1614
1615=item *
1616
c66407fa 1617F<t/comp/line_debug.t>
3ab3a109 1618
c66407fa 1619See if C<< @{"_<$file"} >> works
3ab3a109
JV
1620
1621=item *
1622
c66407fa 1623F<t/op/filetest_t.t>
3ab3a109
JV
1624
1625See if -t file test works
1626
1627=item *
1628
c66407fa 1629F<t/op/qr.t>
3ab3a109
JV
1630
1631See if qr works
1632
1633=item *
1634
c66407fa 1635F<t/op/utf8cache.t>
3ab3a109
JV
1636
1637Tests malfunctions of utf8 cache
1638
1639=item *
1640
c66407fa 1641F<t/re/uniprops.t>
3ab3a109
JV
1642
1643Test unicode \p{} regex constructs
1644
b16f1257
JV
1645=item *
1646
1647F<t/op/filehandle.t>
72d4e865
JV
1648
1649Tests some suitably portable filetest operators to check that they work as
1650expected, particularly in the light of some internal changes made in how
1651filehandles are blessed.
1652
b16f1257
JV
1653=item *
1654
1655F<t/op/time_loop.t>
72d4e865
JV
1656
1657Tests that times greater than C<2**63>, which can now be handed to C<gmtime>
1658and C<localtime>, do not cause an internal overflow or an excessively long
1659loop.
1660
3ab3a109
JV
1661=back
1662
1663=head2 Testing improvements
1664
1665=over 4
1666
72d4e865
JV
1667=item Parallel tests
1668
1669The core distribution can now run its regression tests in parallel on
1670Unix-like platforms. Instead of running C<make test>, set C<TEST_JOBS> in
1671your environment to the number of tests to run in parallel, and run
1672C<make test_harness>. On a Bourne-like shell, this can be done as
1673
1674 TEST_JOBS=3 make test_harness # Run 3 tests in parallel
1675
1676An environment variable is used, rather than parallel make itself, because
1677L<TAP::Harness> needs to be able to schedule individual non-conflicting test
1678scripts itself, and there is no standard interface to C<make> utilities to
1679interact with their job schedulers.
1680
1681Note that currently some test scripts may fail when run in parallel (most
1682notably C<ext/IO/t/io_dir.t>). If necessary run just the failing scripts
1683again sequentially and see if the failures go away.
1684
b16f1257 1685=item Test harness flexibility
3ab3a109
JV
1686
1687It's now possible to override C<PERL5OPT> and friends in F<t/TEST>
1688
1689=back
1690
1691
1692=head1 New or Changed Diagnostics
1693
1694Several new diagnostics, see L<perldiag> for details.
1695
1696=over 4
1697
1698=item *
1699
1700C<Bad plugin affecting keyword '%s'>
1701
1702=item *
1703
1704C<gmtime(%.0f) too large>
1705
1706=item *
1707
1708C<Lexing code attempted to stuff non-Latin-1 character into Latin-1 input>
1709
1710=item *
1711
1712C<Lexing code internal error (%s)>
1713
1714=item *
1715
1716C<localtime(%.0f) too large>
1717
1718=item *
1719
1720C<Overloaded dereference did not return a reference>
1721
1722=item *
1723
1724C<Overloaded qr did not return a REGEXP>
1725
1726=item *
1727
1728C<Perl_pmflag() is deprecated, and will be removed from the XS API>
1729
1730=item *
1731
1732New warning category C<illegalproto>
1733
1734The two warnings :
1735
1736 Illegal character in prototype for %s : %s
1737 Prototype after '%c' for %s : %s
1738
1739have been moved from the C<syntax> top-level warnings category into a new
1740first-level category, C<illegalproto>. These two warnings are currently the
1741only ones emitted during parsing of an invalid/illegal prototype, so one
1742can now do
1743
1744 no warnings 'illegalproto';
1745
1746to suppress only those, but not other syntax-related warnings. Warnings where
1747prototypes are changed, ignored, or not met are still in the C<prototype>
1748category as before. (Matt S. Trout)
1749
1750=item *
1751
1752lvalue attribute ignored after the subroutine has been defined
1753
1754This new warning is issued when one attempts to mark a subroutine as
1755lvalue after it has been defined.
1756
1757=item *
1758
c66407fa
RS
1759warn if C<++> or C<--> are unable to change the value because it's
1760beyond the limit of representation
3ab3a109
JV
1761
1762This uses a new warnings category: "imprecision".
1763
1764=item *
c66407fa
RS
1765
1766C<lc>, C<uc>, C<lcfirst>, and C<ucfirst> warn when passed undef.
3ab3a109
JV
1767
1768=item *
1769
1770Show constant in "Useless use of a constant in void context"
1771
1772=item *
1773
1774Make the new warning report undef constants as undef
1775
1776=item *
1777
1778Add a new warning, "Prototype after '%s'"
1779
1780=item *
1781
c66407fa
RS
1782Tweak the "Illegal character in prototype" warning so it's more precise
1783when reporting illegal characters after _
3ab3a109
JV
1784
1785=item *
1786
c66407fa 1787Correct the unintended interpolation of C<$\> in regex
3ab3a109
JV
1788
1789=item *
1790
c66407fa
RS
1791Make overflow warnings in C<gmtime> and C<localtime> only occur when
1792warnings are enabled
3ab3a109
JV
1793
1794=item *
1795
1796Improve mro merging error messages.
1797
1798They are now very similar to those produced by Algorithm::C3.
1799
1800=item *
1801
1802Amelioration of the error message "Unrecognized character %s in column %d"
1803
1804Changes the error message to "Unrecognized character %s; marked by E<lt>--
1805HERE after %sE<lt>-- HERE near column %d". This should make it a little
1806simpler to spot and correct the suspicious character.
1807
1808=item *
1809
c66407fa
RS
1810Explicitely point to C<$.> when it causes an uninitialized warning for
1811ranges in scalar context
3ab3a109
JV
1812
1813=item *
1814
3ab3a109
JV
1815C<split> now warns when called in void context
1816
1817=item *
1818
1819C<printf>-style functions called with too few arguments will now issue the
1820warning C<"Missing argument in %s"> [perl #71000]
1821
1822=item *
1823
1824C<panic: sv_chop %s>
1825
1826This new fatal error occurs when the C routine C<Perl_sv_chop()> was
1827passed a position that is not within the scalar's string buffer. This
1828could be caused by buggy XS code, and at this point recovery is not
1829possible.
1830
1831=item *
1832
3ab3a109
JV
1833C<Deep recursion on subroutine "%s">
1834
1835It is now possible to change the depth threshold for this warning from the
1836default of 100, by recompiling the F<perl> binary, setting the C
1837pre-processor macro C<PERL_SUB_DEPTH_WARN> to the desired value.
1838
1839=item *
1840
1841Perl now properly returns a syntax error instead of segfaulting
c66407fa 1842if C<each>, C<keys>, or C<values> is used without an argument.
3ab3a109
JV
1843
1844=item *
1845
c66407fa
RS
1846C<tell()> now fails properly if called without an argument and when no
1847previous file was read.
3ab3a109 1848
c66407fa
RS
1849C<tell()> now returns C<-1>, and sets errno to C<EBADF>, thus restoring
1850the 5.8.x behaviour.
3ab3a109
JV
1851
1852=item *
1853
c66407fa
RS
1854C<overload> no longer implicitly unsets fallback on repeated 'use
1855overload' lines.
3ab3a109
JV
1856
1857=item *
1858
1859POSIX::strftime() can now handle Unicode characters in the format string.
1860
1861=item *
1862
c66407fa
RS
1863The Windows select() implementation now supports all empty C<fd_set>s
1864more correctly.
3ab3a109
JV
1865
1866=item *
1867
c66407fa
RS
1868The "syntax" category was removed from 5 warnings that should only be in
1869"deprecated".
3ab3a109
JV
1870
1871=item *
1872
c66407fa
RS
1873Three fatal C<pack>/C<unpack> error messages have been normalized to
1874"panic: %s"
3ab3a109
JV
1875
1876=item *
1877
1878"Unicode character is illegal" has been rephrased to be more accurate
1879
1880It now reads C<Unicode non-character is illegal in interchange> and the
1881perldiag documentation has been expanded a bit.
1882
1883=item *
1884
72d4e865
JV
1885The fatal error C<Malformed UTF-8 returned by \N> is now produced if the
1886C<charnames> handler returns malformed UTF-8.
3ab3a109 1887
72d4e865
JV
1888=item *
1889
1890If an unresolved named character or sequence was encountered when compiling a
1891regex pattern then the fatal error C<\\N{NAME} must be resolved by the lexer>
1892is now produced. This can happen, for example, when using a single-quotish
1893context like C<$re = '\N{SPACE}'; $re;>. See L<perldiag> for more examples of
1894how the lexer can get bypassed.
1895
1896=item *
1897
1898The fatal error C<Invalid hexadecimal number in \\N{U+...}> will be produced
1899if the character constant represented by C<...> is not a valid hexadecimal
b16f1257 1900number.
72d4e865
JV
1901
1902=item *
1903
1904The new meaning of C<\N> as C<[^\n]> is not valid in a bracketed character
1905class, just like C<.> in a character class loses its special meaning, and will
1906cause the fatal error C<\\N in a character class must be a named character:
1907\\N{...}>.
1908
1909=item *
1910
1911The rules on what is legal for the C<...> in C<\N{...}> have been tightened
1912up so that unless the C<...> begins with an alphabetic character and continues
1913with a combination of alphanumerics, dashes, spaces, parentheses or colons
1914then the warning C<Deprecated character(s) in \\N{...} starting at '%s'> is
1915now issued.
1916
1917=item *
1918
1919The warning C<Using just the first characters returned by \N{}> will be
1920issued if the C<charnames> handler returns a sequence of characters which
1921exceeds the limit of the number of characters that can be used. The message
1922will indicate which characters were used and which were discarded.
1923
1924=item *
1925
1926Currently, all but the first of the several characters that the C<charnames>
1927handler may return are discarded when used in a regular expression pattern
1928bracketed character class. If this happens then the warning C<Using just the
1929first character returned by \N{} in character class> will be issued.
1930
1931=item *
1932
1933The warning C<Missing right brace on \\N{} or unescaped left brace after \\N.
1934Assuming the latter> will be issued if Perl encounters a C<\N{> but doesn't
1935find a matching C<}>. In this case Perl doesn't know if it was mistakenly
1936omitted, or if "match non-newline" followed by "match a C<{>" was desired.
1937It assumes the latter because that is actually a valid interpretation as
1938written, unlike the other case. If you meant the former, you need to add the
1939matching right brace. If you did mean the latter, you can silence this
1940warning by writing instead C<\N\{>.
1941
1942=item *
1943
1944C<gmtime> and C<localtime> called with numbers smaller than they can reliably
1945handle will now issue the warnings C<gmtime(%.0f) too small> and
1946C<localtime(%.0f) too small>.
1947
1948=back
3ab3a109 1949
c66407fa
RS
1950The following diagnostics have been removed:
1951
1952=over 4
1953
1954=item *
1955
1956C<Runaway format>
1957
1958=item *
1959
1960C<Can't locate package %s for the parents of %s>
1961
1962This warning has been removed. In general, it only got produced in
1963conjunction with other warnings, and removing it allowed an ISA lookup
1964optimisation to be added.
1965
1966=item *
1967
1968C<v-string in use/require is non-portable>
1969
1970=back
1971
3ab3a109
JV
1972=head1 Utility Changes
1973
1974=over 4
1975
1976=item *
1977
1978F<h2ph>
1979
1980Now looks in C<include-fixed> too, which is a recent addition to gcc's
1981search path.
1982
1983=item *
1984
1985F<h2xs>
1986
1987No longer incorrectly treats enum values like macros (Daniel Burr).
1988
1989Now handles C++ style constants (C<//>) properly in enums. (A patch from
1990Rainer Weikusat was used; Daniel Burr also proposed a similar fix).
1991
1992=item *
1993
1994F<perl5db.pl>
1995
1996C<LVALUE> subroutines now work under the debugger.
1997
1998The debugger now correctly handles proxy constant subroutines, and
1999subroutine stubs.
2000
2001=item *
2002
2003F<perlbug>
2004
2005F<perlbug> now uses C<%Module::CoreList::bug_tracker> to print out upstream bug
2006tracker URLs.
2007
2008Where the user names a module that their bug report is about, and we know the
2009URL for its upstream bug tracker, provide a message to the user explaining
2010that the core copies the CPAN version directly, and provide the URL for
2011reporting the bug directly to upstream.
2012
2013=item *
2014
2015F<perlthanks>
2016
2017Perl 5.11.0 added a new utility F<perlthanks>, which is a variant of
2018F<perlbug>, but for sending non-bug-reports to the authors and maintainers
2019of Perl. Getting nothing but bug reports can become a bit demoralising:
2020we'll see if this changes things.
2021
2022=item *
2023
2024F<perlbug>
2025
2026No longer reports "Message sent" when it hasn't actually sent the message
2027
2028=item *
2029
2030F<a2p>
2031
2032Fixed bugs with the match() operator in list context, remove mention of
c66407fa 2033C<$[>.
3ab3a109
JV
2034
2035=back
2036
2037=head1 Selected Bug Fixes
2038
2039=over 4
2040
2041=item *
2042
2043Ensure that pp_qr returns a new regexp SV each time. Resolves RT #69852.
2044
2045Instead of returning a(nother) reference to the (pre-compiled) regexp in the
2046optree, use reg_temp_copy() to create a copy of it, and return a reference to
2047that. This resolves issues about Regexp::DESTROY not being called in a timely
2048fashion (the original bug tracked by RT #69852), as well as bugs related to
2049blessing regexps, and of assigning to regexps, as described in correspondence
2050added to the ticket.
2051
2052It transpires that we also need to undo the SvPVX() sharing when ithreads
2053cloning a Regexp SV, because mother_re is set to NULL, instead of a cloned
2054copy of the mother_re. This change might fix bugs with regexps and threads in
2055certain other situations, but as yet neither tests nor bug reports have
2056indicated any problems, so it might not actually be an edge case that it's
2057possible to reach.
2058
2059=item *
2060
3ab3a109
JV
2061Several compilation errors and segfaults when perl was built with C<-Dmad> were fixed.
2062
2063=item *
2064
2065Fixes for lexer API changes in 5.11.2 which broke NYTProf's savesrc option.
2066
2067=item *
2068
c66407fa 2069C<-t> should only return TRUE for file handles connected to a TTY
3ab3a109 2070
c66407fa
RS
2071The Microsoft C version of C<isatty()> returns TRUE for all
2072character mode devices, including the F</dev/null>-style "nul"
3ab3a109
JV
2073device and printers like "lpt1".
2074
2075=item *
2076
2077Fixed a regression caused by commit fafafbaf which caused a panic during
2078parameter passing [perl #70171]
2079
2080=item *
2081
2082On systems which in-place edits without backup files, -i'*' now works as
2083the documentation says it does [perl #70802]
2084
2085=item *
2086
2087Saving and restoring magic flags no longer loses readonly flag.
2088
2089=item *
2090
2091The malformed syntax C<grep EXPR LIST> (note the missing comma) no longer
2092causes abrupt and total failure.
2093
2094=item *
2095
2096Regular expressions compiled with C<qr{}> literals properly set C<$'> when
2097matching again.
2098
2099=item *
2100
2101Using named subroutines with C<sort> should no longer lead to bus errors [perl
2102#71076]
2103
2104=item *
2105
2106Numerous bugfixes catch small issues caused by the recently-added Lexer API.
2107
2108=item *
2109
2110Smart match against C<@_> sometimes gave false negatives. [perl #71078]
2111
2112=item *
2113
c66407fa
RS
2114C<$@> may now be assigned a read-only value (without error or busting
2115the stack).
3ab3a109
JV
2116
2117=item *
2118
2119C<sort> called recursively from within an active comparison subroutine no
2120longer causes a bus error if run multiple times. [perl #71076]
2121
2122=item *
2123
c66407fa 2124Tie::Hash::NamedCapture::* will not abort if passed bad input (RT #71828)
3ab3a109
JV
2125
2126=item *
2127
2128@_ and $_ no longer leak under threads (RT #34342 and #41138, also
2129#70602, #70974)
2130
2131=item *
2132
2133C<-I> on shebang line now adds directories in front of @INC
2134as documented, and as does C<-I> when specified on the command-line.
2135
2136=item *
2137
2138C<kill> is now fatal when called on non-numeric process identifiers.
c66407fa
RS
2139Previously, an C<undef> process identifier would be interpreted as a
2140request to kill process 0, which would terminate the current process
72d4e865 2141group on POSIX systems. Since process identifiers are always integers,
c66407fa 2142killing a non-numeric process is now fatal.
3ab3a109
JV
2143
2144=item *
2145
21465.10.0 inadvertently disabled an optimisation, which caused a measurable
2147performance drop in list assignment, such as is often used to assign
2148function parameters from C<@_>. The optimisation has been re-instated, and
72d4e865 2149the performance regression fixed. (This fix is also present in 5.10.1)
3ab3a109
JV
2150
2151=item *
2152
2153Fixed memory leak on C<while (1) { map 1, 1 }> [RT #53038].
2154
2155=item *
2156
2157Some potential coredumps in PerlIO fixed [RT #57322,54828].
2158
2159=item *
2160
2161The debugger now works with lvalue subroutines.
2162
2163=item *
2164
2165The debugger's C<m> command was broken on modules that defined constants
2166[RT #61222].
2167
2168=item *
2169
2170C<crypt> and string complement could return tainted values for untainted
2171arguments [RT #59998].
2172
2173=item *
2174
2175The C<-i>I<.suffix> command-line switch now recreates the file using
2176restricted permissions, before changing its mode to match the original
2177file. This eliminates a potential race condition [RT #60904].
2178
2179=item *
2180
2181On some Unix systems, the value in C<$?> would not have the top bit set
2182(C<$? & 128>) even if the child core dumped.
2183
2184=item *
2185
2186Under some circumstances, C<$^R> could incorrectly become undefined
2187[RT #57042].
2188
2189=item *
2190
2191In the XS API, various hash functions, when passed a pre-computed hash where
2192the key is UTF-8, might result in an incorrect lookup.
2193
2194=item *
2195
2196XS code including F<XSUB.h> before F<perl.h> gave a compile-time error
2197[RT #57176].
2198
2199=item *
2200
2201C<< $object-E<gt>isa('Foo') >> would report false if the package C<Foo> didn't
2202exist, even if the object's C<@ISA> contained C<Foo>.
2203
2204=item *
2205
2206Various bugs in the new-to 5.10.0 mro code, triggered by manipulating
2207C<@ISA>, have been found and fixed.
2208
2209=item *
2210
2211Bitwise operations on references could crash the interpreter, e.g.
2212C<$x=\$y; $x |= "foo"> [RT #54956].
2213
2214=item *
2215
2216Patterns including alternation might be sensitive to the internal UTF-8
2217representation, e.g.
2218
2219 my $byte = chr(192);
2220 my $utf8 = chr(192); utf8::upgrade($utf8);
2221 $utf8 =~ /$byte|X}/i; # failed in 5.10.0
2222
2223=item *
2224
2225Within UTF8-encoded Perl source files (i.e. where C<use utf8> is in
2226effect), double-quoted literal strings could be corrupted where a C<\xNN>,
2227C<\0NNN> or C<\N{}> is followed by a literal character with ordinal value
2228greater than 255 [RT #59908].
2229
2230=item *
2231
2232C<B::Deparse> failed to correctly deparse various constructs:
2233C<readpipe STRING> [RT #62428], C<CORE::require(STRING)> [RT #62488],
2234C<sub foo(_)> [RT #62484].
2235
2236=item *
2237
2238Using C<setpgrp> with no arguments could corrupt the perl stack.
2239
2240=item *
2241
2242The block form of C<eval> is now specifically trappable by C<Safe> and
72d4e865 2243C<ops>. Previously it was erroneously treated like string C<eval>.
3ab3a109
JV
2244
2245=item *
2246
2247In 5.10.0, the two characters C<[~> were sometimes parsed as the smart
2248match operator (C<~~>) [RT #63854].
2249
2250=item *
2251
2252In 5.10.0, the C<*> quantifier in patterns was sometimes treated as
2253C<{0,32767}> [RT #60034, #60464]. For example, this match would fail:
2254
2255 ("ab" x 32768) =~ /^(ab)*$/
2256
2257=item *
2258
2259C<shmget> was limited to a 32 bit segment size on a 64 bit OS [RT #63924].
2260
2261=item *
2262
2263Using C<next> or C<last> to exit a C<given> block no longer produces a
2264spurious warning like the following:
2265
2266 Exiting given via last at foo.pl line 123
2267
2268=item *
2269
2270On Windows, C<'.\foo'> and C<'..\foo'> were treated differently than
2271C<'./foo'> and C<'../foo'> by C<do> and C<require> [RT #63492].
2272
2273=item *
2274
2275Assigning a format to a glob could corrupt the format; e.g.:
2276
2277 *bar=*foo{FORMAT}; # foo format now bad
2278
2279=item *
2280
2281Attempting to coerce a typeglob to a string or number could cause an
2282assertion failure. The correct error message is now generated,
2283C<Can't coerce GLOB to I<$type>>.
2284
2285=item *
2286
2287Under C<use filetest 'access'>, C<-x> was using the wrong access mode. This
2288has been fixed [RT #49003].
2289
2290=item *
2291
2292C<length> on a tied scalar that returned a Unicode value would not be
2293correct the first time. This has been fixed.
2294
2295=item *
2296
2297Using an array C<tie> inside in array C<tie> could SEGV. This has been
2298fixed. [RT #51636]
2299
2300=item *
2301
2302A race condition inside C<PerlIOStdio_close()> has been identified and
2303fixed. This used to cause various threading issues, including SEGVs.
2304
2305=item *
2306
2307In C<unpack>, the use of C<()> groups in scalar context was internally
2308placing a list on the interpreter's stack, which manifested in various
72d4e865 2309ways, including SEGVs. This is now fixed [RT #50256].
3ab3a109
JV
2310
2311=item *
2312
2313Magic was called twice in C<substr>, C<\&$x>, C<tie $x, $m> and C<chop>.
2314These have all been fixed.
2315
2316=item *
2317
2318A 5.10.0 optimisation to clear the temporary stack within the implicit
2319loop of C<s///ge> has been reverted, as it turned out to be the cause of
2320obscure bugs in seemingly unrelated parts of the interpreter [commit
2321ef0d4e17921ee3de].
2322
2323=item *
2324
2325The line numbers for warnings inside C<elsif> are now correct.
2326
2327=item *
2328
2329The C<..> operator now works correctly with ranges whose ends are at or
2330close to the values of the smallest and largest integers.
2331
2332=item *
2333
2334C<binmode STDIN, ':raw'> could lead to segmentation faults on some platforms.
2335This has been fixed [RT #54828].
2336
2337=item *
2338
2339An off-by-one error meant that C<index $str, ...> was effectively being
2340executed as C<index "$str\0", ...>. This has been fixed [RT #53746].
2341
2342=item *
2343
2344Various leaks associated with named captures in regexes have been fixed
2345[RT #57024].
2346
2347=item *
2348
2349A weak reference to a hash would leak. This was affecting C<DBI>
2350[RT #56908].
2351
2352=item *
2353
2354Using (?|) in a regex could cause a segfault [RT #59734].
2355
2356=item *
2357
2358Use of a UTF-8 C<tr//> within a closure could cause a segfault [RT #61520].
2359
2360=item *
2361
2362Calling C<Perl_sv_chop()> or otherwise upgrading an SV could result in an
2363unaligned 64-bit access on the SPARC architecture [RT #60574].
2364
2365=item *
2366
2367In the 5.10.0 release, C<inc_version_list> would incorrectly list
2368C<5.10.*> after C<5.8.*>; this affected the C<@INC> search order
2369[RT #67628].
2370
2371=item *
2372
2373In 5.10.0, C<pack "a*", $tainted_value> returned a non-tainted value
2374[RT #52552].
2375
2376=item *
2377
2378In 5.10.0, C<printf> and C<sprintf> could produce the fatal error
2379C<panic: utf8_mg_pos_cache_update> when printing UTF-8 strings
2380[RT #62666].
2381
2382=item *
2383
2384In the 5.10.0 release, a dynamically created C<AUTOLOAD> method might be
2385missed (method cache issue) [RT #60220,60232].
2386
2387=item *
2388
2389In the 5.10.0 release, a combination of C<use feature> and C<//ee> could
2390cause a memory leak [RT #63110].
2391
2392=item *
2393
2394C<-C> on the shebang (C<#!>) line is once more permitted if it is also
2395specified on the command line. C<-C> on the shebang line used to be a
2396silent no-op I<if> it was not also on the command line, so perl 5.10.0
2397disallowed it, which broke some scripts. Now perl checks whether it is
2398also on the command line and only dies if it is not [RT #67880].
2399
2400=item *
2401
2402In 5.10.0, certain types of re-entrant regular expression could crash,
2403or cause the following assertion failure [RT #60508]:
2404
2405 Assertion rx->sublen >= (s - rx->subbeg) + i failed
2406
2407=item *
2408
2409Previously missing files from Unicode 5.1 Character Database are now included.
2410
2411=item *
2412
2413C<TMPDIR> is now honored when opening an anonymous temporary file
2414
2415=back
2416
2417=head1 Platform Specific Changes
2418
2419=head2 New Platforms
2420
2421=over
2422
2423=item Haiku
2424
2425Patches from the Haiku maintainers have been merged in. Perl should now
2426build on Haiku.
2427
2428=item MirOS BSD
2429
2430Perl should now build on MirOS BSD.
2431
2432
2433=back
2434
2435=head2 Discontinued Platforms
2436
2437=over
2438
2439=item DomainOS
2440
2441Support for Apollo DomainOS was removed in Perl 5.11.0
2442
2443=item MachTen
2444
2445Support for Tenon Intersystems MachTen Unix layer for MacOS Classic was
2446removed in Perl 5.11.0
2447
2448=item MiNT
2449
2450Support for Atari MiNT was removed in Perl 5.11.0.
2451
2452=back
2453
2454=head2 Updated Platforms
2455
2456=over 4
2457
2458=item Darwin (Mac OS X)
2459
2460=over 4
2461
2462=item *
2463
2464Skip testing the be_BY.CP1131 locale on Darwin 10 (Mac OS X 10.6),
2465as it's still buggy.
2466
2467=item *
2468
2469Correct infelicities in the regexp used to identify buggy locales
2470on Darwin 8 and 9 (Mac OS X 10.4 and 10.5, respectively).
2471
2472=back
2473
2474=item DragonFly BSD
2475
2476=over 4
2477
2478=item *
2479
2480Fix thread library selection [perl #69686]
2481
2482=back
2483
2484=item Win32
2485
2486=over 4
2487
2488=item *
2489
2490Initial support for mingw64 is now available
2491
2492=item *
2493
c66407fa
RS
2494Various bits of Perl's build infrastructure are no longer converted to
2495win32 line endings at release time. If this hurts you, please report the
2496problem with the L<perlbug> program included with perl.
3ab3a109
JV
2497
2498=item *
2499
2500Always add a manifest resource to C<perl.exe> to specify the C<trustInfo>
72d4e865 2501settings for Windows Vista and later. Without this setting Windows
3ab3a109
JV
2502will treat C<perl.exe> as a legacy application and apply various
2503heuristics like redirecting access to protected file system areas
2504(like the "Program Files" folder) to the users "VirtualStore"
2505instead of generating a proper "permission denied" error.
2506
2507For VC8 and VC9 this manifest setting is automatically generated by
2508the compiler/linker (together with the binding information for their
2509respective runtime libraries); for all other compilers we need to
2510embed the manifest resource explicitly in the external resource file.
2511
2512This change also requests the Microsoft Common-Controls version 6.0
2513(themed controls introduced in Windows XP) via the dependency list
72d4e865 2514in the assembly manifest. For VC8 and VC9 this is specified using the
3ab3a109
JV
2515C</manifestdependency> linker commandline option instead.
2516
2517=item *
2518
2519Improved message window handling means that C<alarm> and C<kill> messages
2520will no longer be dropped under race conditions.
2521
2522=back
2523
2524=item cygwin
2525
2526=over 4
2527
2528=item *
2529
2530Enable IPv6 support on cygwin 1.7 and newer
2531
2532=back
2533
2534=item OpenVMS
2535
2536=over 4
2537
2538=item *
2539
2540Make -UDEBUGGING the default on VMS for 5.12.0.
2541
72d4e865 2542Like it has been everywhere else for ages and ages. Also make
3ab3a109
JV
2543command-line selection of -UDEBUGGING and -DDEBUGGING work in
2544configure.com; before the only way to turn it off was by saying
2545no in answer to the interactive question.
2546
2547=item *
2548
2549The default pipe buffer size on VMS has been updated to 8192 on 64-bit
2550systems.
2551
2552=item *
2553
2554Reads from the in-memory temporary files of C<PerlIO::scalar> used to fail
2555if C<$/> was set to a numeric reference (to indicate record-style reads).
2556This is now fixed.
2557
2558=item *
2559
2560VMS now supports C<getgrgid>.
2561
2562=item *
2563
2564Many improvements and cleanups have been made to the VMS file name handling
2565and conversion code.
2566
2567=item *
2568
2569Enabling the C<PERL_VMS_POSIX_EXIT> logical name now encodes a POSIX exit
2570status in a VMS condition value for better interaction with GNV's bash
72d4e865 2571shell and other utilities that depend on POSIX exit values. See
3ab3a109
JV
2572L<perlvms/"$?"> for details.
2573
2574=item *
2575
2576C<File::Copy> now detects Unix compatibility mode on VMS.
2577
2578=back
2579
2580=item AIX
2581
2582Removed F<libbsd> for AIX 5L and 6.1. Only C<flock()> was used from F<libbsd>.
2583
2584Removed F<libgdbm> for AIX 5L and 6.1. The F<libgdbm> is delivered as an
2585optional package with the AIX Toolbox. Unfortunately the 64 bit version
2586is broken.
2587
2588Hints changes mean that AIX 4.2 should work again.
2589
2590=item Cygwin
2591
2592On Cygwin we now strip the last number from the DLL. This has been the
2593behaviour in the cygwin.com build for years. The hints files have been
2594updated.
2595
2596
2597=item FreeBSD
2598
2599The hints files now identify the correct threading libraries on FreeBSD 7
2600and later.
2601
2602=item Irix
2603
2604We now work around a bizarre preprocessor bug in the Irix 6.5 compiler:
2605C<cc -E -> unfortunately goes into K&R mode, but C<cc -E file.c> doesn't.
2606
2607=item NetBSD
2608
2609Hints now supports versions 5.*.
2610
2611=item Stratus VOS
2612
2613Various changes from Stratus have been merged in.
2614
2615=item Symbian
2616
2617There is now support for Symbian S60 3.2 SDK and S60 5.0 SDK.
2618
2619=back
2620
2621=head1 Known Problems
2622
2623This is a list of some significant unfixed bugs, which are regressions
72d4e865 2624from either 5.10.x or 5.8.x.
3ab3a109
JV
2625
2626=over 4
2627
2628=item *
2629
2630C<List::Util::first> misbehaves in the presence of a lexical C<$_>
2631(typically introduced by C<my $_> or implicitly by C<given>). The variable
2632which gets set for each iteration is the package variable C<$_>, not the
2633lexical C<$_> [RT #67694].
2634
2635A similar issue may occur in other modules that provide functions which
2636take a block as their first argument, like
2637
2638 foo { ... $_ ...} list
2639
2640=item *
2641
3ab3a109
JV
2642Some regexes may run much more slowly when run in a child thread compared
2643with the thread the pattern was compiled into [RT #55600].
2644
2645=item *
2646
3d3a8206
KW
2647Things like C<"\N{LATIN SMALL LIGATURE FF}" =~ /\N{LATIN SMALL LETTER F}+/>
2648will appear to hang as they get into a very long running loop [RT #72998].
2649
2650=item *
2651
3ab3a109
JV
2652Untriaged test crashes on Windows 2000
2653
72d4e865 2654Several porters have reported mysterious crashes when Perl's entire test suite is run after a build on certain Windows 2000 systems. When run by hand, the individual tests reportedly work fine.
3ab3a109
JV
2655
2656=item *
2657
2658Known test failures on VMS
2659
2660Perl 5.11.1 fails a small set of core and CPAN tests as of this release.
2661With luck, that'll be sorted out for 5.11.2
2662
3ab3a109
JV
2663=back
2664
2665=head1 Acknowledgements
2666
2667Perl 5.12.0 represents approximately two years of development since
2668Perl 5.10.0 and contains __ lines of changes across ___ files
2669from __ authors and committers:
2670
2671XXX TODO LIST
2672
2673Many of the changes included in this version originated in the CPAN
2674modules included in Perl's core. We're grateful to the entire CPAN
2675community for helping Perl to flourish.
2676
2677=head1 Reporting Bugs
2678
2679If you find what you think is a bug, you might check the articles
2680recently posted to the comp.lang.perl.misc newsgroup and the perl
72d4e865 2681bug database at L<http://rt.perl.org/perlbug/>. There may also be
3ab3a109
JV
2682information at L<http://www.perl.org/>, the Perl Home Page.
2683
2684If you believe you have an unreported bug, please run the B<perlbug>
72d4e865
JV
2685program included with your release. Be sure to trim your bug down
2686to a tiny but sufficient test case. Your bug report, along with the
3ab3a109
JV
2687output of C<perl -V>, will be sent off to perlbug@perl.org to be
2688analyzed by the Perl porting team.
2689
2690If the bug you are reporting has security implications, which make it
2691inappropriate to send to a publicly archived mailing list, then please send
2692it to perl5-security-report@perl.org. This points to a closed subscription
2693unarchived mailing list, which includes all the core committers, who be able
2694to help assess the impact of issues, figure out a resolution, and help
2695co-ordinate the release of patches to mitigate or fix the problem across all
2696platforms on which Perl is supported. Please only use this address for
2697security issues in the Perl core, not for modules independently
2698distributed on CPAN.
2699
2700=head1 SEE ALSO
2701
2702The F<Changes> file for an explanation of how to view exhaustive details
2703on what changed.
2704
2705The F<INSTALL> file for how to build Perl.
2706
2707The F<README> file for general stuff.
2708
2709The F<Artistic> and F<Copying> files for copyright information.
2710
2711=cut