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