This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #82702] Fix commit message internal link.
[perl5.git] / pod / perl5120delta.pod
CommitLineData
c0924907
AB
1=encoding utf8
2
01358b4a
JV
3=head1 NAME
4
5perl5120delta - what is new for perl v5.12.0
6
7=head1 DESCRIPTION
8
702b4ef6
JV
9This document describes differences between the 5.10.0 release and the
105.12.0 release.
01358b4a 11
72d4e865 12Many of the bug fixes in 5.12.0 are already included in the 5.10.1
702b4ef6 13maintenance release.
72d4e865 14
702b4ef6
JV
15You can see the list of those changes in the 5.10.1 release notes
16(L<perl5101delta>).
72d4e865
JV
17
18
b6381718 19=head1 Core Enhancements
72d4e865
JV
20
21=head2 New C<package NAME VERSION> syntax
22
23This new syntax allows a module author to set the $VERSION of a namespace
24when the namespace is declared with 'package'. It eliminates the need
25for C<our $VERSION = ...> and similar constructs. E.g.
26
27 package Foo::Bar 1.23;
28 # $Foo::Bar::VERSION == 1.23
29
30There are several advantages to this:
31
208f012a 32=over
72d4e865
JV
33
34=item *
35
36C<$VERSION> is parsed in exactly the same way as C<use NAME VERSION>
37
38=item *
39
40C<$VERSION> is set at compile time
41
42=item *
43
44C<$VERSION> is a version object that provides proper overloading of
4655b0a1 45comparison operators so comparing C<$VERSION> to decimal (1.23) or
72d4e865
JV
46dotted-decimal (v1.2.3) version numbers works correctly.
47
48=item *
49
50Eliminates C<$VERSION = ...> and C<eval $VERSION> clutter
51
52=item *
53
54As it requires VERSION to be a numeric literal or v-string
55literal, it can be statically parsed by toolchain modules
56without C<eval> the way MM-E<gt>parse_version does for C<$VERSION = ...>
57
e014eb68 58=back
72d4e865
JV
59
60It does not break old code with only C<package NAME>, but code that uses
61C<package NAME VERSION> will need to be restricted to perl 5.12.0 or newer
62This is analogous to the change to C<open> from two-args to three-args.
63Users requiring the latest Perl will benefit, and perhaps after several
64years, it will become a standard practice.
65
72d4e865
JV
66
67However, C<package NAME VERSION> requires a new, 'strict' version
68number format. See L<"Version number formats"> for details.
69
70
71=head2 The C<...> operator
72
73A new operator, C<...>, nicknamed the Yada Yada operator, has been added.
74It is intended to mark placeholder code that is not yet implemented.
79849ba8 75See L<perlop/"Yada Yada Operator">.
72d4e865
JV
76
77=head2 Implicit strictures
78
79Using the C<use VERSION> syntax with a version number greater or equal
80to 5.11.0 will lexically enable strictures just like C<use strict>
81would do (in addition to enabling features.) The following:
82
83 use 5.12.0;
84
85means:
86
87 use strict;
88 use feature ':5.12';
01358b4a 89
b6381718 90=head2 Unicode improvements
01358b4a 91
b6381718
JV
92Perl 5.12 comes with Unicode 5.2, the latest version available to
93us at the time of release. This version of Unicode was released in
94October 2009. See L<http://www.unicode.org/versions/Unicode5.2.0> for
95further details about what's changed in this version of the standard.
96See L<perlunicode> for instructions on installing and using other versions
97of Unicode.
98
99Additionally, Perl's developers have significantly improved Perl's Unicode
100implementation. For full details, see L</Unicode overhaul> below.
101
102=head2 Y2038 compliance
103
104Perl's core time-related functions are now Y2038 compliant. (It may not mean much to you, but your kids will love it!)
3ab3a109
JV
105
106=head2 qr overloading
107
108It is now possible to overload the C<qr//> operator, that is,
109conversion to regexp, like it was already possible to overload
110conversion to boolean, string or number of objects. It is invoked when
c66407fa 111an object appears on the right hand side of the C<=~> operator or when
3ab3a109
JV
112it is interpolated into a regexp. See L<overload>.
113
114=head2 Pluggable keywords
115
116Extension modules can now cleanly hook into the Perl parser to define
117new kinds of keyword-headed expression and compound statement. The
118syntax following the keyword is defined entirely by the extension. This
119allow a completely non-Perl sublanguage to be parsed inline, with the
208f012a 120correct ops cleanly generated.
3ab3a109
JV
121
122See L<perlapi/PL_keyword_plugin> for the mechanism. The Perl core
123source distribution also includes a new module
124L<XS::APItest::KeywordRPN>, which implements reverse Polish notation
125arithmetic via pluggable keywords. This module is mainly used for test
126purposes, and is not normally installed, but also serves as an example
127of how to use the new mechanism.
128
72d4e865
JV
129Perl's developers consider this feature to be experimental. We may remove
130it or change it in a backwards-incompatible way in Perl 5.14.
131
3ab3a109
JV
132=head2 APIs for more internals
133
134The lowest layers of the lexer and parts of the pad system now have C
135APIs available to XS extensions. These are necessary to support proper
136use of pluggable keywords, but have other uses too. The new APIs are
137experimental, and only cover a small proportion of what would be
138necessary to take full advantage of the core's facilities in these
139areas. It is intended that the Perl 5.13 development cycle will see the
140addition of a full range of clean, supported interfaces.
141
72d4e865
JV
142Perl's developers consider this feature to be experimental. We may remove
143it or change it in a backwards-incompatible way in Perl 5.14.
144
3ab3a109
JV
145=head2 Overridable function lookup
146
147Where an extension module hooks the creation of rv2cv ops to modify the
148subroutine lookup process, this now works correctly for bareword
149subroutine calls. This means that prototypes on subroutines referenced
150this way will be processed correctly. (Previously bareword subroutine
151names were initially looked up, for parsing purposes, by an unhookable
152mechanism, so extensions could only properly influence subroutine names
153that appeared with an C<&> sigil.)
154
3ab3a109
JV
155=head2 A proper interface for pluggable Method Resolution Orders
156
72d4e865
JV
157As of Perl 5.12.0 there is a new interface for plugging and using method
158resolution orders other than the default linear depth first search.
3ab3a109
JV
159The C3 method resolution order added in 5.10.0 has been re-implemented as
160a plugin, without changing its Perl-space interface. See L<perlmroapi> for
161more information.
162
b3b85878 163
5e75e599 164
72d4e865 165=head2 C<\N> experimental regex escape
3ab3a109 166
72d4e865
JV
167Perl now supports C<\N>, a new regex escape which you can think of as
168the inverse of C<\n>. It will match any character that is not a newline,
169independently from the presence or absence of the single line match
170modifier C</s>. It is not usable within a character class. C<\N{3}>
171means to match 3 non-newlines; C<\N{5,}> means to match at least 5.
172C<\N{NAME}> still means the character or sequence named C<NAME>, but
173C<NAME> no longer can be things like C<3>, or C<5,>.
174
175This will break a L<custom charnames translator|charnames/CUSTOM
176TRANSLATORS> which allows numbers for character names, as C<\N{3}> will
177now mean to match 3 non-newline characters, and not the character whose
178name is C<3>. (No name defined by the Unicode standard is a number,
179so only custom translators might be affected.)
180
181Perl's developers are somewhat concerned about possible user confusion
182with the existing C<\N{...}> construct which matches characters by their
183Unicode name. Consequently, this feature is experimental. We may remove
184it or change it in a backwards-incompatible way in Perl 5.14.
3ab3a109
JV
185
186=head2 DTrace support
187
72d4e865 188Perl now has some support for DTrace. See "DTrace support" in F<INSTALL>.
3ab3a109
JV
189
190=head2 Support for C<configure_requires> in CPAN module metadata
191
702b4ef6
JV
192Both C<CPAN> and C<CPANPLUS> now support the C<configure_requires>
193keyword in the F<META.yml> metadata file included in most recent CPAN
194distributions. This allows distribution authors to specify configuration
195prerequisites that must be installed before running F<Makefile.PL>
196or F<Build.PL>.
3ab3a109 197
702b4ef6
JV
198See the documentation for C<ExtUtils::MakeMaker> or C<Module::Build> for
199more on how to specify C<configure_requires> when creating a distribution
200for CPAN.
3ab3a109 201
108cd937 202=head2 C<each>, C<keys>, C<values> are now more flexible
3ab3a109 203
108cd937 204The C<each>, C<keys>, C<values> function can now operate on arrays.
3ab3a109 205
8a4f3f14
VP
206=head2 C<when> as a statement modifier
207
208C<when> is now allowed to be used as a statement modifier.
209
3ab3a109
JV
210=head2 C<$,> flexibility
211
212The variable C<$,> may now be tied.
213
61f382b0 214=head2 // in when clauses
3ab3a109
JV
215
216// now behaves like || in when clauses
217
218=head2 Enabling warnings from your shell environment
219
220You can now set C<-W> from the C<PERL5OPT> environment variable
221
222=head2 C<delete local>
223
224C<delete local> now allows you to locally delete a hash entry.
225
226=head2 New support for Abstract namespace sockets
227
228Abstract namespace sockets are Linux-specific socket type that live in
229AF_UNIX family, slightly abusing it to be able to use arbitrary
230character arrays as addresses: They start with nul byte and are not
231terminated by nul byte, but with the length passed to the socket()
232system call.
233
72d4e865 234=head2 32-bit limit on substr arguments removed
3ab3a109 235
702b4ef6
JV
236The 32-bit limit on C<substr> arguments has now been removed. The full
237range of the system's signed and unsigned integers is now available for
238the C<pos> and C<len> arguments.
3ab3a109 239
b6381718 240=head1 Potentially Incompatible Changes
3ab3a109 241
72d4e865 242=head2 Deprecations warn by default
3ab3a109 243
62ccb366
JV
244Over the years, Perl's developers have deprecated a number of language
245features for a variety of reasons. Perl now defaults to issuing a
246warning if a deprecated language feature is used. Many of the deprecations
247Perl now warns you about have been deprecated for many years. You can
248find a list of what was deprecated in a given release of Perl in the
249C<perl5xxdelta.pod> file for that release.
252eec4f 250
72d4e865
JV
251To disable this feature in a given lexical scope, you should use C<no
252warnings 'deprecated';> For information about which language features
253are deprecated and explanations of various deprecation warnings, please
3676dc40 254see L<perldiag>. See L</Deprecations> below for the list of features
b6381718 255and modules Perl's developers have deprecated as part of this release.
3ab3a109
JV
256
257=head2 Version number formats
258
259Acceptable version number formats have been formalized into "strict" and
72d4e865 260"lax" rules. C<package NAME VERSION> takes a strict version number.
fab55263 261C<UNIVERSAL::VERSION> and the L<version> object constructors take lax
72d4e865
JV
262version numbers. Providing an invalid version will result in a fatal
263error. The version argument in C<use NAME VERSION> is first parsed as a
fab55263
DG
264numeric literal or v-string and then passed to C<UNIVERSAL::VERSION>
265(and must then pass the "lax" format test).
266
72d4e865 267These formats are documented fully in the L<version> module. To a first
fab55263
DG
268approximation, a "strict" version number is a positive decimal number
269(integer or decimal-fraction) without exponentiation or else a
270dotted-decimal v-string with a leading 'v' character and at least three
72d4e865
JV
271components. A "lax" version number allows v-strings with fewer than
272three components or without a leading 'v'. Under "lax" rules, both
fab55263
DG
273decimal and dotted-decimal versions may have a trailing "alpha"
274component separated by an underscore character after a fractional or
275dotted-decimal component.
3ab3a109
JV
276
277The L<version> module adds C<version::is_strict> and C<version::is_lax>
278functions to check a scalar against these rules.
279
c66407fa 280=head2 @INC reorganization
3ab3a109 281
b6381718
JV
282In C<@INC>, C<ARCHLIB> and C<PRIVLIB> now occur after after the current
283version's C<site_perl> and C<vendor_perl>. Modules installed into
284C<site_perl> and C<vendor_perl> will now be loaded in preference to
285those installed in C<ARCHLIB> and C<PRIVLIB>.
3ab3a109 286
055e9e16
JV
287
288=head2 REGEXPs are now first class
289
c69ca1d4 290Internally, Perl now treats compiled regular expressions (such as
055e9e16
JV
291those created with C<qr//>) as first class entities. Perl modules which
292serialize, deserialize or otherwise have deep interaction with Perl's
5e1d1895
JV
293internal data structures need to be updated for this change. Most
294affected CPAN modules have already been updated as of this writing.
055e9e16 295
3ab3a109
JV
296=head2 Switch statement changes
297
b6381718
JV
298The C<given>/C<when> switch statement handles complex statements better
299than Perl 5.10.0 did (These enhancements are also available in
3005.10.1 and subsequent 5.10 releases.) There are two new cases where
c66407fa
RS
301C<when> now interprets its argument as a boolean, instead of an
302expression to be used in a smart match:
3ab3a109 303
b6381718
JV
304=over
305
306=item flip-flop operators
3ab3a109
JV
307
308The C<..> and C<...> flip-flop operators are now evaluated in boolean
309context, following their usual semantics; see L<perlop/"Range Operators">.
310
311Note that, as in perl 5.10.0, C<when (1..10)> will not work to test
312whether a given value is an integer between 1 and 10; you should use
313C<when ([1..10])> instead (note the array reference).
314
702b4ef6
JV
315However, contrary to 5.10.0, evaluating the flip-flop operators in
316boolean context ensures it can now be useful in a C<when()>, notably
317for implementing bistable conditions, like in:
3ab3a109
JV
318
319 when (/^=begin/ .. /^=end/) {
320 # do something
321 }
322
b6381718 323=item defined-or operator
3ab3a109
JV
324
325A compound expression involving the defined-or operator, as in
326C<when (expr1 // expr2)>, will be treated as boolean if the first
327expression is boolean. (This just extends the existing rule that applies
328to the regular or operator, as in C<when (expr1 || expr2)>.)
329
b6381718
JV
330=back
331
3ab3a109
JV
332=head2 Smart match changes
333
b6381718
JV
334Since Perl 5.10.0, Perl's developers have made a number of changes to
335the smart match operator. These, of course, also alter the behaviour
3ab3a109 336of the switch statements where smart matching is implicitly used.
c66407fa 337These changes were also made for the 5.10.1 release, and will remain in
3ab3a109
JV
338subsequent 5.10 releases.
339
3ab3a109
JV
340=head3 Changes to type-based dispatch
341
342The smart match operator C<~~> is no longer commutative. The behaviour of
343a smart match now depends primarily on the type of its right hand
344argument. Moreover, its semantics have been adjusted for greater
345consistency or usefulness in several cases. While the general backwards
346compatibility is maintained, several changes must be noted:
347
348=over 4
349
350=item *
351
352Code references with an empty prototype are no longer treated specially.
353They are passed an argument like the other code references (even if they
354choose to ignore it).
355
356=item *
357
358C<%hash ~~ sub {}> and C<@array ~~ sub {}> now test that the subroutine
359returns a true value for each key of the hash (or element of the
360array), instead of passing the whole hash or array as a reference to
361the subroutine.
362
363=item *
364
365Due to the commutativity breakage, code references are no longer
366treated specially when appearing on the left of the C<~~> operator,
367but like any vulgar scalar.
368
369=item *
370
371C<undef ~~ %hash> is always false (since C<undef> can't be a key in a
372hash). No implicit conversion to C<""> is done (as was the case in perl
3735.10.0).
374
375=item *
376
377C<$scalar ~~ @array> now always distributes the smart match across the
378elements of the array. It's true if one element in @array verifies
379C<$scalar ~~ $element>. This is a generalization of the old behaviour
380that tested whether the array contained the scalar.
381
382=back
383
384The full dispatch table for the smart match operator is given in
385L<perlsyn/"Smart matching in detail">.
386
387=head3 Smart match and overloading
388
389According to the rule of dispatch based on the rightmost argument type,
390when an object overloading C<~~> appears on the right side of the
391operator, the overload routine will always be called (with a 3rd argument
392set to a true value, see L<overload>.) However, when the object will
393appear on the left, the overload routine will be called only when the
c66407fa
RS
394rightmost argument is a simple scalar. This way, distributivity of smart
395match across arrays is not broken, as well as the other behaviours with
396complex types (coderefs, hashes, regexes). Thus, writers of overloading
397routines for smart match mostly need to worry only with comparing
398against a scalar, and possibly with stringification overloading; the
399other common cases will be automatically handled consistently.
3ab3a109
JV
400
401C<~~> will now refuse to work on objects that do not overload it (in order
402to avoid relying on the object's underlying structure). (However, if the
403object overloads the stringification or the numification operators, and
404if overload fallback is active, it will be used instead, as usual.)
405
b6381718 406=head2 Other potentially incompatible changes
3ab3a109
JV
407
408=over 4
409
410=item *
411
b16f1257
JV
412The definitions of a number of Unicode properties have changed to match
413those of the current Unicode standard. These are listed above under
702b4ef6
JV
414L</Unicode overhaul>. This change may break code that expects the old
415definitions.
3ab3a109
JV
416
417=item *
418
b6381718 419The boolkeys op has moved to the group of hash ops. This breaks binary
b21d8e53 420compatibility.
c66407fa
RS
421
422=item *
423
72d4e865 424Filehandles are now always blessed into C<IO::File>.
c66407fa
RS
425
426The previous behaviour was to bless Filehandles into L<FileHandle>
427(an empty proxy class) if it was loaded into memory and otherwise
428to bless them into C<IO::Handle>.
429
430=item *
431
432The semantics of C<use feature :5.10*> have changed slightly.
433See L<"Modules and Pragmata"> for more information.
3ab3a109
JV
434
435=item *
436
b6381718
JV
437Perl's developers now use git, rather than Perforce. This should be
438a purely internal change only relevant to people actively working on
439the core. However, you may see minor difference in perl as a consequence
440of the change. For example in some of details of the output of C<perl
441-V>. See L<perlrepository> for more information.
3ab3a109
JV
442
443=item *
444
445As part of the C<Test::Harness> 2.x to 3.x upgrade, the experimental
446C<Test::Harness::Straps> module has been removed.
b6381718 447See L</"Modules and Pragmata"> for more details.
3ab3a109
JV
448
449=item *
450
451As part of the C<ExtUtils::MakeMaker> upgrade, the
452C<ExtUtils::MakeMaker::bytes> and C<ExtUtils::MakeMaker::vmsish> modules
453have been removed from this distribution.
454
455=item *
456
457C<Module::CoreList> no longer contains the C<%:patchlevel> hash.
458
3ab3a109
JV
459
460=item *
461
462C<length undef> now returns undef.
463
464=item *
465
466Unsupported private C API functions are now declared "static" to prevent
467leakage to Perl's public API.
468
469=item *
470
471To support the bootstrapping process, F<miniperl> no longer builds with
472UTF-8 support in the regexp engine.
473
474This allows a build to complete with PERL_UNICODE set and a UTF-8 locale.
702b4ef6
JV
475Without this there's a bootstrapping problem, as miniperl can't load
476the UTF-8 components of the regexp engine, because they're not yet built.
3ab3a109
JV
477
478=item *
479
c66407fa
RS
480F<miniperl>'s @INC is now restricted to just C<-I...>, the split of
481C<$ENV{PERL5LIB}>, and "C<.>"
3ab3a109
JV
482
483=item *
484
485A space or a newline is now required after a C<"#line XXX"> directive.
486
487=item *
488
702b4ef6
JV
489Tied filehandles now have an additional method EOF which provides the
490EOF type.
3ab3a109
JV
491
492=item *
493
c66407fa
RS
494To better match all other flow control statements, C<foreach> may no
495longer be used as an attribute.
3ab3a109 496
208f012a
FR
497=item *
498
499Perl's command-line switch "-P", which was deprecated in version 5.10.0, has
2f16ce2f
A
500now been removed. The CPAN module C<< Filter::cpp >> can be used as an
501alternative.
208f012a 502
3ab3a109
JV
503=back
504
b6381718 505
3ab3a109
JV
506=head1 Deprecations
507
508From time to time, Perl's developers find it necessary to deprecate
509features or modules we've previously shipped as part of the core
510distribution. We are well aware of the pain and frustration that a
511backwards-incompatible change to Perl can cause for developers building
512or maintaining software in Perl. You can be sure that when we deprecate
513a functionality or syntax, it isn't a choice we make lightly. Sometimes,
514we choose to deprecate functionality or syntax because it was found to
515be poorly designed or implemented. Sometimes, this is because they're
516holding back other features or causing performance problems. Sometimes,
517the reasons are more complex. Wherever possible, we try to keep deprecated
518functionality available to developers in its previous form for at least
72d4e865 519one major release. So long as a deprecated feature isn't actively
3ab3a109
JV
520disrupting our ability to maintain and extend Perl, we'll try to leave
521it in place as long as possible.
522
b6381718 523The following items are now deprecated:
3ab3a109 524
b6381718
JV
525=over
526
527=item suidperl
528
529C<suidperl> is no longer part of Perl. It used to provide a mechanism to
530emulate setuid permission bits on systems that don't support it properly.
3ab3a109 531
b6381718
JV
532
533=item Use of C<:=> to mean an empty attribute list
3ab3a109
JV
534
535An accident of Perl's parser meant that these constructions were all
536equivalent:
537
538 my $pi := 4;
539 my $pi : = 4;
540 my $pi : = 4;
541
542with the C<:> being treated as the start of an attribute list, which
543ends before the C<=>. As whitespace is not significant here, all are
544parsed as an empty attribute list, hence all the above are equivalent
545to, and better written as
546
547 my $pi = 4;
548
549because no attribute processing is done for an empty list.
550
551As is, this meant that C<:=> cannot be used as a new token, without
552silently changing the meaning of existing code. Hence that particular
553form is now deprecated, and will become a syntax error. If it is
554absolutely necessary to have empty attribute lists (for example,
555because of a code generator) then avoid the warning by adding a space
556before the C<=>.
557
c66407fa 558=item C<< UNIVERSAL->import() >>
3ab3a109 559
72d4e865 560The method C<< UNIVERSAL->import() >> is now deprecated. Attempting to
3ab3a109 561pass import arguments to a C<use UNIVERSAL> statement will result in a
c66407fa 562deprecation warning.
3ab3a109 563
b6381718
JV
564
565=item Use of "goto" to jump into a construct
3ab3a109 566
c66407fa
RS
567Using C<goto> to jump from an outer scope into an inner scope is now
568deprecated. This rare use case was causing problems in the
569implementation of scopes.
3ab3a109 570
b6381718 571=item Custom character names in \N{name} that don't look like names
8c66a230 572
702b4ef6
JV
573In C<\N{I<name>}>, I<name> can be just about anything. The standard
574Unicode names have a very limited domain, but a custom name translator
575could create names that are, for example, made up entirely of punctuation
576symbols. It is now deprecated to make names that don't begin with an
577alphabetic character, and aren't alphanumeric or contain other than
578a very few other characters, namely spaces, dashes, parentheses
579and colons. Because of the added meaning of C<\N> (See L</C<\N>
580experimental regex escape>), names that look like curly brace -enclosed
581quantifiers won't work. For example, C<\N{3,4}> now means to match 3 to
5824 non-newlines; before a custom name C<3,4> could have been created.
8c66a230 583
3ab3a109
JV
584=item Deprecated Modules
585
702b4ef6
JV
586The following modules will be removed from the core distribution in a
587future release, and should be installed from CPAN instead. Distributions
588on CPAN which require these should add them to their prerequisites. The
589core versions of these modules warnings will issue a deprecation warning.
3ab3a109 590
702b4ef6 591If you ship a packaged version of Perl, either alone or as part of a
c69ca1d4 592larger system, then you should carefully consider the repercussions of
702b4ef6
JV
593core module deprecations. You may want to consider shipping your default
594build of Perl with packages for some or all deprecated modules which
595install into C<vendor> or C<site> perl library directories. This will
596inhibit the deprecation warnings.
8df7d2a3
JV
597
598Alternatively, you may want to consider patching F<lib/deprecate.pm>
702b4ef6
JV
599to provide deprecation warnings specific to your packaging system
600or distribution of Perl, consistent with how your packaging system
601or distribution manages a staged transition from a release where the
602installation of a single package provides the given functionality, to
603a later release where the system administrator needs to know to install
604multiple packages to get that same functionality.
8df7d2a3 605
34153154
JV
606You can silence these deprecation warnings by installing the modules
607in question from CPAN. To install the latest version of all of them,
e4717ba1 608just install C<Task::Deprecations::5_12>.
34153154 609
3ab3a109
JV
610=over
611
c66407fa
RS
612=item L<Class::ISA>
613
614=item L<Pod::Plainer>
615
616=item L<Shell>
3ab3a109 617
c66407fa 618=item L<Switch>
3ab3a109 619
b6381718
JV
620Switch is buggy and should be avoided. You may find Perl's new
621C<given>/C<when> feature a suitable replacement. See L<perlsyn/"Switch
622statements"> for more information.
3ab3a109
JV
623
624=back
625
3ab3a109
JV
626=item Assignment to $[
627
b6381718 628=item Use of the attribute :locked on subroutines
3ab3a109 629
b6381718 630=item Use of "locked" with the attributes pragma
3ab3a109 631
b6381718 632=item Use of "unique" with the attributes pragma
3ab3a109 633
b6381718 634=item Perl_pmflag
3ab3a109 635
b6381718
JV
636C<Perl_pmflag> is no longer part of Perl's public API. Calling it now
637generates a deprecation warning, and it will be removed in a future
638release. Although listed as part of the API, it was never documented,
639and only ever used in F<toke.c>, and prior to 5.10, F<regcomp.c>. In
640core, it has been replaced by a static function.
3ab3a109 641
b6381718 642=item Numerous Perl 4-era libraries
3ab3a109
JV
643
644F<termcap.pl>, F<tainted.pl>, F<stat.pl>, F<shellwords.pl>, F<pwd.pl>,
645F<open3.pl>, F<open2.pl>, F<newgetopt.pl>, F<look.pl>, F<find.pl>,
646F<finddepth.pl>, F<importenv.pl>, F<hostname.pl>, F<getopts.pl>,
647F<getopt.pl>, F<getcwd.pl>, F<flush.pl>, F<fastcwd.pl>, F<exceptions.pl>,
648F<ctime.pl>, F<complete.pl>, F<cacheout.pl>, F<bigrat.pl>, F<bigint.pl>,
649F<bigfloat.pl>, F<assert.pl>, F<abbrev.pl>, F<dotsh.pl>, and
4dfa489a
JV
650F<timelocal.pl> are all now deprecated. Earlier, Perl's developers
651intended to remove these libraries from Perl's core for the 5.14.0 release.
652
653During final testing before the release of 5.12.0, several developers
654discovered current production code using these ancient libraries, some
655inside the Perl core itself. Accordingly, the pumpking granted them
656a stay of execution. They will begin to warn about their deprecation
657in the 5.14.0 release and will be removed in the 5.16.0 release.
3ab3a109 658
b6381718 659
3ab3a109
JV
660=back
661
b6381718 662=head1 Unicode overhaul
3ab3a109 663
b6381718
JV
664Perl's developers have made a concerted effort to update Perl to be in
665sync with the latest Unicode standard. Changes for this include:
3ab3a109 666
b6381718
JV
667Perl can now handle every Unicode character property. New documentation,
668L<perluniprops>, lists all available non-Unihan character properties. By
669default, perl does not expose Unihan, deprecated or Unicode-internal
670properties. See below for more details on these; there is also a section
671in the pod listing them, and explaining why they are not exposed.
3ab3a109 672
702b4ef6
JV
673Perl now fully supports the Unicode compound-style of using C<=>
674and C<:> in writing regular expressions: C<\p{property=value}> and
b6381718 675C<\p{property:value}> (both of which mean the same thing).
3ab3a109 676
702b4ef6
JV
677Perl now fully supports the Unicode loose matching rules for text between
678the braces in C<\p{...}> constructs. In addition, Perl allows underscores
679between digits of numbers.
3ab3a109 680
702b4ef6
JV
681Perl now accepts all the Unicode-defined synonyms for properties and
682property values.
3ab3a109 683
702b4ef6
JV
684C<qr/\X/>, which matches a Unicode logical character, has
685been expanded to work better with various Asian languages. It
686now is defined as an I<extended grapheme cluster>. (See
687L<http://www.unicode.org/reports/tr29/>). Anything matched previously
688and that made sense will continue to be accepted. Additionally:
3ab3a109 689
b6381718 690=over
3ab3a109 691
b6381718
JV
692=item *
693
694C<\X> will not break apart a C<S<CR LF>> sequence.
3ab3a109
JV
695
696=item *
697
702b4ef6
JV
698C<\X> will now match a sequence which includes the C<ZWJ> and C<ZWNJ>
699characters.
b6381718
JV
700
701=item *
3ab3a109 702
702b4ef6
JV
703C<\X> will now always match at least one character, including an initial
704mark. Marks generally come after a base character, but it is possible in
705Unicode to have them in isolation, and C<\X> will now handle that case,
706for example at the beginning of a line, or after a C<ZWSP>. And this is
707the part where C<\X> doesn't match the things that it used to that don't
708make sense. Formerly, for example, you could have the nonsensical case
709of an accented LF.
3ab3a109
JV
710
711=item *
712
702b4ef6
JV
713C<\X> will now match a (Korean) Hangul syllable sequence, and the Thai
714and Lao exception cases.
3ab3a109 715
b6381718 716=back
3ab3a109 717
a56dbb5e
JV
718Otherwise, this change should be transparent for the non-affected
719languages.
3ab3a109 720
b6381718 721C<\p{...}> matches using the Canonical_Combining_Class property were
a56dbb5e
JV
722completely broken in previous releases of Perl. They should now work
723correctly.
724
725Before Perl 5.12, the Unicode C<Decomposition_Type=Compat> property
726and a Perl extension had the same name, which led to neither matching
727all the correct values (with more than 100 mistakes in one, and several
728thousand in the other). The Perl extension has now been renamed to be
729C<Decomposition_Type=Noncanonical> (short: C<dt=noncanon>). It has the
730same meaning as was previously intended, namely the union of all the
731non-canonical Decomposition types, with Unicode C<Compat> being just
732one of those.
3ab3a109 733
b6381718 734C<\p{Decomposition_Type=Canonical}> now includes the Hangul syllables.
3ab3a109 735
a56dbb5e
JV
736C<\p{Uppercase}> and C<\p{Lowercase}> now work as the Unicode standard
737says they should. This means they each match a few more characters than
738they used to.
3ab3a109 739
a56dbb5e
JV
740C<\p{Cntrl}> now matches the same characters as C<\p{Control}>. This
741means it no longer will match Private Use (gc=co), Surrogates (gc=cs),
742nor Format (gc=cf) code points. The Format code points represent the
743biggest possible problem. All but 36 of them are either officially
744deprecated or strongly discouraged from being used. Of those 36, likely
745the most widely used are the soft hyphen (U+00AD), and BOM, ZWSP, ZWNJ,
746WJ, and similar characters, plus bidirectional controls.
3ab3a109 747
a56dbb5e
JV
748C<\p{Alpha}> now matches the same characters as C<\p{Alphabetic}>. Before
7495.12, Perl's definition definition included a number of things that aren't
750really alpha (all marks) while omitting many that were. The definitions
751of C<\p{Alnum}> and C<\p{Word}> depend on Alpha's definition and have
752changed accordingly.
3ab3a109 753
a56dbb5e
JV
754C<\p{Word}> no longer incorrectly matches non-word characters such
755as fractions.
3ab3a109 756
a56dbb5e
JV
757C<\p{Print}> no longer matches the line control characters: Tab, LF,
758CR, FF, VT, and NEL. This brings it in line with standards and the
759documentation.
3ab3a109 760
b6381718
JV
761C<\p{XDigit}> now matches the same characters as C<\p{Hex_Digit}>. This
762means that in addition to the characters it currently matches,
763C<[A-Fa-f0-9]>, it will also match the 22 fullwidth equivalents, for
764example U+FF10: FULLWIDTH DIGIT ZERO.
3ab3a109 765
b6381718
JV
766The Numeric type property has been extended to include the Unihan
767characters.
3ab3a109 768
b6381718
JV
769There is a new Perl extension, the 'Present_In', or simply 'In',
770property. This is an extension of the Unicode Age property, but
771C<\p{In=5.0}> matches any code point whose usage has been determined
772I<as of> Unicode version 5.0. The C<\p{Age=5.0}> only matches code points
773added in I<precisely> version 5.0.
3ab3a109 774
b6381718 775A number of properties now have the correct values for unassigned
a56dbb5e
JV
776code points. The affected properties are Bidi_Class, East_Asian_Width,
777Joining_Type, Decomposition_Type, Hangul_Syllable_Type, Numeric_Type,
778and Line_Break.
3ab3a109 779
b6381718
JV
780The Default_Ignorable_Code_Point, ID_Continue, and ID_Start properties
781are now up to date with current Unicode definitions.
3ab3a109 782
a56dbb5e
JV
783Earlier versions of Perl erroneously exposed certain properties that
784are supposed to be Unicode internal-only. Use of these in regular
785expressions will now generate, if enabled, a deprecation warning message.
b6381718
JV
786The properties are: Other_Alphabetic, Other_Default_Ignorable_Code_Point,
787Other_Grapheme_Extend, Other_ID_Continue, Other_ID_Start, Other_Lowercase,
788Other_Math, and Other_Uppercase.
3ab3a109 789
b6381718
JV
790It is now possible to change which Unicode properties Perl understands
791on a per-installation basis. As mentioned above, certain properties
792are turned off by default. These include all the Unihan properties
793(which should be accessible via the CPAN module Unicode::Unihan) and any
794deprecated or Unicode internal-only property that Perl has never exposed.
3ab3a109 795
b6381718 796The generated files in the C<lib/unicore/To> directory are now more
a56dbb5e
JV
797clearly marked as being stable, directly usable by applications. New hash
798entries in them give the format of the normal entries, which allows for
799easier machine parsing. Perl can generate files in this directory for
800any property, though most are suppressed. You can find instructions
801for changing which are written in L<perluniprops>.
3ab3a109 802
b6381718 803=head1 Modules and Pragmata
3ab3a109 804
a56dbb5e 805=head2 New Modules and Pragmata
3ab3a109 806
b6381718 807=over 4
3ab3a109 808
a56dbb5e 809=item C<autodie>
3ab3a109 810
b6381718
JV
811C<autodie> is a new lexically-scoped alternative for the C<Fatal> module.
812The bundled version is 2.06_01. Note that in this release, using a string
813eval when C<autodie> is in effect can cause the autodie behaviour to leak
814into the surrounding scope. See L<autodie/"BUGS"> for more details.
815
a56dbb5e 816Version 2.06_01 has been added to the Perl core.
3ab3a109 817
a56dbb5e 818=item C<Compress::Raw::Bzip2>
3ab3a109 819
a56dbb5e
JV
820Version 2.024 has been added to the Perl core.
821
822=item C<overloading>
3ab3a109 823
b6381718 824C<overloading> allows you to lexically disable or enable overloading
79849ba8 825for some or all operations.
3ab3a109 826
a56dbb5e
JV
827Version 0.001 has been added to the Perl core.
828
829=item C<parent>
b6381718
JV
830
831C<parent> establishes an ISA relationship with base classes at compile
832time. It provides the key feature of C<base> without further unwanted
833behaviors.
3ab3a109 834
a56dbb5e
JV
835Version 0.223 has been added to the Perl core.
836
837=item C<Parse::CPAN::Meta>
3ab3a109 838
a56dbb5e
JV
839Version 1.40 has been added to the Perl core.
840
841=item C<VMS::DCLsym>
842
843Version 1.03 has been added to the Perl core.
844
845=item C<VMS::Stdio>
846
847Version 2.4 has been added to the Perl core.
848
849=item C<XS::APItest::KeywordRPN>
850
851Version 0.003 has been added to the Perl core.
3ab3a109 852
b6381718 853=back
3ab3a109 854
a56dbb5e 855=head2 Updated Pragmata
3ab3a109 856
b6381718 857=over 4
3ab3a109 858
a56dbb5e
JV
859=item C<base>
860
861Upgraded from version 2.13 to 2.15.
862
863=item C<bignum>
864
865Upgraded from version 0.22 to 0.23.
866
867=item C<charnames>
b6381718
JV
868
869C<charnames> now contains the Unicode F<NameAliases.txt> database file.
870This has the effect of adding some extra C<\N> character names that
871formerly wouldn't have been recognised; for example, C<"\N{LATIN CAPITAL
872LETTER GHA}">.
3ab3a109 873
a56dbb5e
JV
874Upgraded from version 1.06 to 1.07.
875
876=item C<constant>
877
878Upgraded from version 1.13 to 1.20.
879
880=item C<diagnostics>
881
882C<diagnostics> now supports %.0f formatting internally.
883
884C<diagnostics> no longer suppresses C<Use of uninitialized value in range
885(or flip)> warnings. [perl #71204]
886
887Upgraded from version 1.17 to 1.19.
888
889=item C<feature>
3ab3a109 890
702b4ef6
JV
891In C<feature>, the meaning of the C<:5.10> and C<:5.10.X> feature
892bundles has changed slightly. The last component, if any (i.e. C<X>) is
893simply ignored. This is predicated on the assumption that new features
894will not, in general, be added to maintenance releases. So C<:5.10>
895and C<:5.10.X> have identical effect. This is a change to the behaviour
896documented for 5.10.0.
3ab3a109 897
b6381718 898C<feature> now includes the C<unicode_strings> feature:
3ab3a109
JV
899
900 use feature "unicode_strings";
901
902This pragma turns on Unicode semantics for the case-changing operations
c66407fa
RS
903(C<uc>, C<lc>, C<ucfirst>, C<lcfirst>) on strings that don't have the
904internal UTF-8 flag set, but that contain single-byte characters between
905128 and 255.
3ab3a109 906
b7569deb 907Upgraded from version 1.11 to 1.16.
a56dbb5e
JV
908
909=item C<less>
910
911C<less> now includes the C<stash_name> method to allow subclasses of
912C<less> to pick where in %^H to store their stash.
913
914Upgraded from version 0.02 to 0.03.
915
916=item C<lib>
917
918Upgraded from version 0.5565 to 0.62.
919
920=item C<mro>
3ab3a109 921
702b4ef6
JV
922C<mro> is now implemented as an XS extension. The documented interface has
923not changed. Code relying on the implementation detail that some C<mro::>
b6381718 924methods happened to be available at all times gets to "keep both pieces".
3ab3a109 925
a56dbb5e 926Upgraded from version 1.00 to 1.02.
3ab3a109 927
a56dbb5e 928=item C<overload>
3ab3a109 929
b6381718 930C<overload> now allow overloading of 'qr'.
3ab3a109 931
a56dbb5e 932Upgraded from version 1.06 to 1.10.
3ab3a109 933
a56dbb5e 934=item C<threads>
3ab3a109 935
a56dbb5e 936Upgraded from version 1.67 to 1.75.
3ab3a109 937
a56dbb5e
JV
938=item C<threads::shared>
939
940Upgraded from version 1.14 to 1.32.
941
942=item C<version>
3ab3a109 943
702b4ef6
JV
944C<version> now has support for L</Version number formats> as described
945earlier in this document and in its own documentation.
3ab3a109 946
a56dbb5e
JV
947Upgraded from version 0.74 to 0.82.
948
949=item C<warnings>
950
951C<warnings> has a new C<warnings::fatal_enabled()> function. It also
952includes a new C<illegalproto> warning category. See also L</New or
953Changed Diagnostics> for this change.
3ab3a109 954
a56dbb5e 955Upgraded from version 1.06 to 1.09.
3ab3a109
JV
956
957=back
958
a56dbb5e
JV
959=head2 Updated Modules
960
961=over 4
962
963=item C<Archive::Extract>
964
965Upgraded from version 0.24 to 0.38.
966
967=item C<Archive::Tar>
968
969Upgraded from version 1.38 to 1.54.
970
971=item C<Attribute::Handlers>
972
973Upgraded from version 0.79 to 0.87.
974
975=item C<AutoLoader>
976
977Upgraded from version 5.63 to 5.70.
978
979=item C<B::Concise>
980
981Upgraded from version 0.74 to 0.78.
982
983=item C<B::Debug>
984
985Upgraded from version 1.05 to 1.12.
986
987=item C<B::Deparse>
988
702b4ef6 989Upgraded from version 0.83 to 0.96.
a56dbb5e
JV
990
991=item C<B::Lint>
992
993Upgraded from version 1.09 to 1.11_01.
994
995=item C<CGI>
996
997Upgraded from version 3.29 to 3.48.
998
999=item C<Class::ISA>
1000
1001Upgraded from version 0.33 to 0.36.
1002
702b4ef6
JV
1003NOTE: C<Class::ISA> is deprecated and may be removed from a future
1004version of Perl.
a56dbb5e
JV
1005
1006=item C<Compress::Raw::Zlib>
1007
1008Upgraded from version 2.008 to 2.024.
1009
1010=item C<CPAN>
1011
1012Upgraded from version 1.9205 to 1.94_56.
1013
1014=item C<CPANPLUS>
1015
1016Upgraded from version 0.84 to 0.90.
1017
1018=item C<CPANPLUS::Dist::Build>
1019
1020Upgraded from version 0.06_02 to 0.46.
1021
1022=item C<Data::Dumper>
1023
1024Upgraded from version 2.121_14 to 2.125.
1025
1026=item C<DB_File>
1027
1028Upgraded from version 1.816_1 to 1.820.
1029
1030=item C<Devel::PPPort>
1031
1032Upgraded from version 3.13 to 3.19.
1033
1034=item C<Digest>
1035
1036Upgraded from version 1.15 to 1.16.
1037
1038=item C<Digest::MD5>
1039
1040Upgraded from version 2.36_01 to 2.39.
1041
1042=item C<Digest::SHA>
1043
1044Upgraded from version 5.45 to 5.47.
1045
1046=item C<Encode>
1047
1048Upgraded from version 2.23 to 2.39.
1049
1050=item C<Exporter>
1051
1052Upgraded from version 5.62 to 5.64_01.
1053
1054=item C<ExtUtils::CBuilder>
1055
1056Upgraded from version 0.21 to 0.27.
1057
1058=item C<ExtUtils::Command>
1059
1060Upgraded from version 1.13 to 1.16.
1061
1062=item C<ExtUtils::Constant>
1063
1064Upgraded from version 0.2 to 0.22.
1065
1066=item C<ExtUtils::Install>
1067
1068Upgraded from version 1.44 to 1.55.
1069
1070=item C<ExtUtils::MakeMaker>
1071
1072Upgraded from version 6.42 to 6.56.
1073
1074=item C<ExtUtils::Manifest>
1075
1076Upgraded from version 1.51_01 to 1.57.
1077
1078=item C<ExtUtils::ParseXS>
1079
1080Upgraded from version 2.18_02 to 2.21.
1081
1082=item C<File::Fetch>
1083
1084Upgraded from version 0.14 to 0.24.
1085
1086=item C<File::Path>
1087
1088Upgraded from version 2.04 to 2.08_01.
1089
1090=item C<File::Temp>
1091
1092Upgraded from version 0.18 to 0.22.
1093
1094=item C<Filter::Simple>
1095
1096Upgraded from version 0.82 to 0.84.
1097
1098=item C<Filter::Util::Call>
1099
1100Upgraded from version 1.07 to 1.08.
1101
1102=item C<Getopt::Long>
1103
1104Upgraded from version 2.37 to 2.38.
1105
1106=item C<IO>
1107
1108Upgraded from version 1.23_01 to 1.25_02.
1109
1110=item C<IO::Zlib>
1111
1112Upgraded from version 1.07 to 1.10.
1113
1114=item C<IPC::Cmd>
1115
1116Upgraded from version 0.40_1 to 0.54.
1117
1118=item C<IPC::SysV>
1119
1120Upgraded from version 1.05 to 2.01.
1121
1122=item C<Locale::Maketext>
1123
1124Upgraded from version 1.12 to 1.14.
1125
1126=item C<Locale::Maketext::Simple>
1127
1128Upgraded from version 0.18 to 0.21.
1129
1130=item C<Log::Message>
1131
1132Upgraded from version 0.01 to 0.02.
1133
1134=item C<Log::Message::Simple>
1135
1136Upgraded from version 0.04 to 0.06.
1137
1138=item C<Math::BigInt>
1139
1140Upgraded from version 1.88 to 1.89_01.
1141
1142=item C<Math::BigInt::FastCalc>
1143
1144Upgraded from version 0.16 to 0.19.
1145
1146=item C<Math::BigRat>
1147
1148Upgraded from version 0.21 to 0.24.
1149
1150=item C<Math::Complex>
1151
1152Upgraded from version 1.37 to 1.56.
1153
1154=item C<Memoize>
1155
1156Upgraded from version 1.01_02 to 1.01_03.
1157
1158=item C<MIME::Base64>
1159
1160Upgraded from version 3.07_01 to 3.08.
1161
1162=item C<Module::Build>
1163
1164Upgraded from version 0.2808_01 to 0.3603.
1165
1166=item C<Module::CoreList>
1167
702b4ef6 1168Upgraded from version 2.12 to 2.29.
a56dbb5e
JV
1169
1170=item C<Module::Load>
1171
1172Upgraded from version 0.12 to 0.16.
1173
1174=item C<Module::Load::Conditional>
1175
1176Upgraded from version 0.22 to 0.34.
1177
1178=item C<Module::Loaded>
1179
1180Upgraded from version 0.01 to 0.06.
1181
1182=item C<Module::Pluggable>
1183
1184Upgraded from version 3.6 to 3.9.
1185
1186=item C<Net::Ping>
1187
1188Upgraded from version 2.33 to 2.36.
1189
1190=item C<NEXT>
1191
1192Upgraded from version 0.60_01 to 0.64.
1193
1194=item C<Object::Accessor>
1195
1196Upgraded from version 0.32 to 0.36.
1197
1198=item C<Package::Constants>
1199
1200Upgraded from version 0.01 to 0.02.
1201
1202=item C<PerlIO>
1203
1204Upgraded from version 1.04 to 1.06.
1205
1206=item C<Pod::Parser>
1207
1208Upgraded from version 1.35 to 1.37.
1209
1210=item C<Pod::Perldoc>
1211
1212Upgraded from version 3.14_02 to 3.15_02.
1213
1214=item C<Pod::Plainer>
1215
1216Upgraded from version 0.01 to 1.02.
1217
702b4ef6
JV
1218NOTE: C<Pod::Plainer> is deprecated and may be removed from a future
1219version of Perl.
a56dbb5e
JV
1220
1221=item C<Pod::Simple>
1222
1223Upgraded from version 3.05 to 3.13.
1224
1225=item C<Safe>
1226
1227Upgraded from version 2.12 to 2.22.
1228
1229=item C<SelfLoader>
1230
1231Upgraded from version 1.11 to 1.17.
1232
1233=item C<Storable>
1234
1235Upgraded from version 2.18 to 2.22.
1236
1237=item C<Switch>
1238
1239Upgraded from version 2.13 to 2.16.
1240
702b4ef6
JV
1241NOTE: C<Switch> is deprecated and may be removed from a future version
1242of Perl.
a56dbb5e
JV
1243
1244=item C<Sys::Syslog>
1245
1246Upgraded from version 0.22 to 0.27.
1247
1248=item C<Term::ANSIColor>
1249
1250Upgraded from version 1.12 to 2.02.
1251
1252=item C<Term::UI>
1253
1254Upgraded from version 0.18 to 0.20.
1255
1256=item C<Test>
1257
1258Upgraded from version 1.25 to 1.25_02.
1259
1260=item C<Test::Harness>
1261
1262Upgraded from version 2.64 to 3.17.
1263
1264=item C<Test::Simple>
1265
1266Upgraded from version 0.72 to 0.94.
1267
1268=item C<Text::Balanced>
1269
1270Upgraded from version 2.0.0 to 2.02.
1271
1272=item C<Text::ParseWords>
1273
1274Upgraded from version 3.26 to 3.27.
1275
1276=item C<Text::Soundex>
1277
1278Upgraded from version 3.03 to 3.03_01.
1279
1280=item C<Thread::Queue>
1281
1282Upgraded from version 2.00 to 2.11.
1283
1284=item C<Thread::Semaphore>
1285
1286Upgraded from version 2.01 to 2.09.
1287
1288=item C<Tie::RefHash>
1289
1290Upgraded from version 1.37 to 1.38.
1291
1292=item C<Time::HiRes>
1293
1294Upgraded from version 1.9711 to 1.9719.
1295
1296=item C<Time::Local>
1297
1298Upgraded from version 1.18 to 1.1901_01.
1299
1300=item C<Time::Piece>
1301
1302Upgraded from version 1.12 to 1.15.
1303
1304=item C<Unicode::Collate>
1305
1306Upgraded from version 0.52 to 0.52_01.
1307
1308=item C<Unicode::Normalize>
1309
1310Upgraded from version 1.02 to 1.03.
1311
1312=item C<Win32>
1313
1314Upgraded from version 0.34 to 0.39.
1315
1316=item C<Win32API::File>
1317
1318Upgraded from version 0.1001_01 to 0.1101.
1319
1320=item C<XSLoader>
1321
1322Upgraded from version 0.08 to 0.10.
1323
1324=back
3ab3a109 1325
b6381718 1326=head2 Removed Modules and Pragmata
3ab3a109
JV
1327
1328=over 4
1329
a56dbb5e 1330=item C<attrs>
3ab3a109 1331
a56dbb5e 1332Removed from the Perl core. Prior version was 1.02.
3ab3a109 1333
a56dbb5e 1334=item C<CPAN::API::HOWTO>
3ab3a109 1335
a56dbb5e
JV
1336Removed from the Perl core. Prior version was 'undef'.
1337
1338=item C<CPAN::DeferedCode>
1339
1340Removed from the Perl core. Prior version was 5.50.
1341
1342=item C<CPANPLUS::inc>
1343
1344Removed from the Perl core. Prior version was 'undef'.
1345
1346=item C<DCLsym>
1347
1348Removed from the Perl core. Prior version was 1.03.
1349
1350=item C<ExtUtils::MakeMaker::bytes>
1351
1352Removed from the Perl core. Prior version was 6.42.
1353
1354=item C<ExtUtils::MakeMaker::vmsish>
1355
1356Removed from the Perl core. Prior version was 6.42.
3ab3a109 1357
a56dbb5e
JV
1358=item C<Stdio>
1359
1360Removed from the Perl core. Prior version was 2.3.
1361
1362=item C<Test::Harness::Assert>
1363
1364Removed from the Perl core. Prior version was 0.02.
1365
1366=item C<Test::Harness::Iterator>
1367
1368Removed from the Perl core. Prior version was 0.02.
1369
1370=item C<Test::Harness::Point>
1371
1372Removed from the Perl core. Prior version was 0.01.
1373
1374=item C<Test::Harness::Results>
1375
1376Removed from the Perl core. Prior version was 0.01.
1377
1378=item C<Test::Harness::Straps>
1379
1380Removed from the Perl core. Prior version was 0.26_01.
1381
1382=item C<Test::Harness::Util>
1383
1384Removed from the Perl core. Prior version was 0.01.
1385
1386=item C<XSSymSet>
1387
1388Removed from the Perl core. Prior version was 1.1.
3ab3a109
JV
1389
1390=back
1391
b6381718
JV
1392=head2 Deprecated Modules and Pragmata
1393
1394See L</Deprecated Modules> above.
1395
a56dbb5e 1396
3ab3a109
JV
1397=head1 Documentation
1398
1399=head2 New Documentation
1400
1401=over 4
1402
1403=item *
1404
702b4ef6
JV
1405L<perlhaiku> contains instructions on how to build perl for the Haiku
1406platform.
3ab3a109
JV
1407
1408=item *
1409
702b4ef6
JV
1410L<perlmroapi> describes the new interface for pluggable Method Resolution
1411Orders.
3ab3a109
JV
1412
1413=item *
1414
b6381718 1415L<perlperf>, by Richard Foley, provides an introduction to the use of
3ab3a109
JV
1416performance and optimization techniques which can be used with particular
1417reference to perl programs.
1418
1419=item *
1420
702b4ef6
JV
1421L<perlrepository> describes how to access the perl source using the I<git>
1422version control system.
3ab3a109
JV
1423
1424=item *
1425
1426L<perlpolicy> extends the "Social contract about contributed modules" into
1427the beginnings of a document on Perl porting policies.
1428
1429=back
1430
1431=head2 Changes to Existing Documentation
1432
b6381718 1433
72d4e865
JV
1434=over
1435
1436
1437=item *
1438
702b4ef6
JV
1439The various large F<Changes*> files (which listed every change made
1440to perl over the last 18 years) have been removed, and replaced by a
1441small file, also called F<Changes>, which just explains how that same
1442information may be extracted from the git version control system.
3ab3a109 1443
72d4e865
JV
1444=item *
1445
b6381718 1446F<Porting/patching.pod> has been deleted, as it mainly described
3ab3a109
JV
1447interacting with the old Perforce-based repository, which is now obsolete.
1448Information still relevant has been moved to L<perlrepository>.
1449
3ab3a109 1450
72d4e865
JV
1451=item *
1452
702b4ef6
JV
1453The syntax C<unless (EXPR) BLOCK else BLOCK> is now documented as valid,
1454as is the syntax C<unless (EXPR) BLOCK elsif (EXPR) BLOCK ... else
1455BLOCK>, although actually using the latter may not be the best idea for
1456the readability of your source code.
72d4e865 1457
3ab3a109
JV
1458
1459=item *
1460
1461Documented -X overloading.
1462
1463=item *
1464
1465Documented that C<when()> treats specially most of the filetest operators
1466
1467=item *
1468
b6381718 1469Documented C<when> as a syntax modifier.
3ab3a109
JV
1470
1471=item *
1472
c66407fa 1473Eliminated "Old Perl threads tutorial", which described 5005 threads.
3ab3a109
JV
1474
1475F<pod/perlthrtut.pod> is the same material reworked for ithreads.
1476
1477=item *
1478
1479Correct previous documentation: v-strings are not deprecated
1480
72d4e865 1481With version objects, we need them to use MODULE VERSION syntax. This
c66407fa 1482patch removes the deprecation notice.
3ab3a109
JV
1483
1484=item *
1485
b6381718
JV
1486Security contact information is now part of L<perlsec>.
1487
1488=item *
3ab3a109 1489
702b4ef6
JV
1490A significant fraction of the core documentation has been updated to
1491clarify the behavior of Perl's Unicode handling.
3ab3a109
JV
1492
1493Much of the remaining core documentation has been reviewed and edited
1494for clarity, consistent use of language, and to fix the spelling of Tom
1495Christiansen's name.
1496
b6381718
JV
1497=item *
1498
3ab3a109 1499The Pod specification (L<perlpodspec>) has been updated to bring the
c66407fa 1500specification in line with modern usage already supported by most Pod
72d4e865
JV
1501systems. A parameter string may now follow the format name in a
1502"begin/end" region. Links to URIs with a text description are now
1503allowed. The usage of C<LE<lt>"section"E<gt>> has been marked as
c66407fa 1504deprecated.
3ab3a109 1505
b6381718
JV
1506=item *
1507
3ab3a109 1508L<if.pm|if> has been documented in L<perlfunc/use> as a means to get
c66407fa
RS
1509conditional loading of modules despite the implicit BEGIN block around
1510C<use>.
3ab3a109
JV
1511
1512=item *
1513
c66407fa 1514The documentation for C<$1> in perlvar.pod has been clarified.
3ab3a109 1515
a620a577
KW
1516=item *
1517
1518C<\N{U+I<wide hex char>}> is now documented.
1519
3ab3a109
JV
1520=back
1521
b6381718 1522=head1 Selected Performance Enhancements
3ab3a109
JV
1523
1524=over 4
1525
1526=item *
1527
1528A new internal cache means that C<isa()> will often be faster.
1529
1530=item *
1531
702b4ef6
JV
1532The implementation of C<C3> Method Resolution Order has been
1533optimised - linearisation for classes with single inheritance is 40%
1534faster. Performance for multiple inheritance is unchanged.
3ab3a109
JV
1535
1536=item *
1537
1538Under C<use locale>, the locale-relevant information is now cached on
1539read-only values, such as the list returned by C<keys %hash>. This makes
702b4ef6
JV
1540operations such as C<sort keys %hash> in the scope of C<use locale>
1541much faster.
3ab3a109
JV
1542
1543=item *
1544
1545Empty C<DESTROY> methods are no longer called.
1546
1547=item *
1548
b6381718 1549C<Perl_sv_utf8_upgrade()> is now faster.
3ab3a109
JV
1550
1551=item *
1552
b6381718 1553C<keys> on empty hash is now faster.
3ab3a109
JV
1554
1555=item *
1556
b6381718 1557C<if (%foo)> has been optimized to be faster than C<if (keys %foo)>.
3ab3a109
JV
1558
1559=item *
1560
702b4ef6
JV
1561The string repetition operator (C<$str x $num>) is now several times
1562faster when C<$str> has length one or C<$num> is large.
8a4f3f14
VP
1563
1564=item *
1565
3ab3a109 1566Reversing an array to itself (as in C<@a = reverse @a>) in void context
702b4ef6
JV
1567now happens in-place and is several orders of magnitude faster than
1568it used to be. It will also preserve non-existent elements whenever
1569possible, i.e. for non magical arrays or tied arrays with C<EXISTS>
1570and C<DELETE> methods.
3ab3a109
JV
1571
1572=back
1573
1574=head1 Installation and Configuration Improvements
1575
72d4e865
JV
1576=over 4
1577
1578=item *
1579
1580L<perlapi>, L<perlintern>, L<perlmodlib> and L<perltoc> are now all
1581generated at build time, rather than being shipped as part of the release.
1582
1583=item *
3ab3a109 1584
702b4ef6
JV
1585If C<vendorlib> and C<vendorarch> are the same, then they are only added
1586to C<@INC> once.
3ab3a109 1587
72d4e865
JV
1588=item *
1589
3ab3a109
JV
1590C<$Config{usedevel}> and the C-level C<PERL_USE_DEVEL> are now defined if
1591perl is built with C<-Dusedevel>.
1592
72d4e865
JV
1593=item *
1594
3ab3a109
JV
1595F<Configure> will enable use of C<-fstack-protector>, to provide protection
1596against stack-smashing attacks, if the compiler supports it.
1597
72d4e865
JV
1598=item *
1599
3ab3a109 1600F<Configure> will now determine the correct prototypes for re-entrant
c66407fa 1601functions and for C<gconvert> if you are using a C++ compiler rather
3ab3a109
JV
1602than a C compiler.
1603
72d4e865
JV
1604=item *
1605
3ab3a109
JV
1606On Unix, if you build from a tree containing a git repository, the
1607configuration process will note the commit hash you have checked out, for
1608display in the output of C<perl -v> and C<perl -V>. Unpushed local commits
1609are automatically added to the list of local patches displayed by
1610C<perl -V>.
1611
72d4e865
JV
1612=item *
1613
b6381718 1614Perl now supports SystemTap's C<dtrace> compatibility layer and an
72d4e865
JV
1615issue with linking C<miniperl> has been fixed in the process.
1616
1617=item *
1618
b6381718
JV
1619perldoc now uses C<less -R> instead of C<less> for improved behaviour
1620in the face of C<groff>'s new usage of ANSI escape codes.
72d4e865
JV
1621
1622=item *
1623
72d4e865 1624
b6381718
JV
1625C<perl -V> now reports use of the compile-time options C<USE_PERL_ATOF> and
1626C<USE_ATTRIBUTES_FOR_PERLIO>.
72d4e865 1627
b6381718 1628=item *
3ab3a109
JV
1629
1630As part of the flattening of F<ext>, all extensions on all platforms are
1631built by F<make_ext.pl>. This replaces the Unix-specific
1632F<ext/util/make_ext>, VMS-specific F<make_ext.com> and Win32-specific
1633F<win32/buildext.pl>.
1634
b6381718 1635=back
3ab3a109 1636
b6381718
JV
1637=head1 Internal Changes
1638
1639Each release of Perl sees numerous internal changes which shouldn't
1640affect day to day usage but may still be notable for developers working
1641with Perl's source code.
1642
1643=over
3ab3a109
JV
1644
1645=item *
1646
702b4ef6
JV
1647The J.R.R. Tolkien quotes at the head of C source file have been checked
1648and proper citations added, thanks to a patch from Tom Christiansen.
3ab3a109
JV
1649
1650=item *
1651
b6381718 1652The internal structure of the dual-life modules traditionally found in
e706c0cd 1653the F<lib/> and F<ext/> directories in the perl source has changed
b6381718
JV
1654significantly. Where possible, dual-lifed modules have been extracted
1655from F<lib/> and F<ext/>.
1656
1657Dual-lifed modules maintained by Perl's developers as part of the Perl
1658core now live in F<dist/>. Dual-lifed modules maintained primarily on
1659CPAN now live in F<cpan/>. When reporting a bug in a module located
1660under F<cpan/>, please send your bug report directly to the module's
1661bug tracker or author, rather than Perl's bug tracker.
3ab3a109
JV
1662
1663=item *
1664
b6381718
JV
1665C<\N{...}> now compiles better, always forces UTF-8 internal representation
1666
702b4ef6
JV
1667Perl's developers have fixed several problems with the recognition of
1668C<\N{...}> constructs. As part of this, perl will store any scalar
1669or regex containing C<\N{I<name>}> or C<\N{U+I<wide hex char>}> in its
c69ca1d4 1670definition in UTF-8 format. (This was true previously for all occurrences
702b4ef6
JV
1671of C<\N{I<name>}> that did not use a custom translator, but now it's
1672always true.)
3ab3a109
JV
1673
1674=item *
1675
b6381718 1676Perl_magic_setmglob now knows about globs, fixing RT #71254.
3ab3a109
JV
1677
1678=item *
1679
b6381718 1680C<SVt_RV> no longer exists. RVs are now stored in IVs.
3ab3a109
JV
1681
1682=item *
1683
702b4ef6
JV
1684C<Perl_vcroak()> now accepts a null first argument. In addition, a full
1685audit was made of the "not NULL" compiler annotations, and those for
1686several other internal functions were corrected.
3ab3a109
JV
1687
1688=item *
1689
1690New macros C<dSAVEDERRNO>, C<dSAVE_ERRNO>, C<SAVE_ERRNO>, C<RESTORE_ERRNO>
1691have been added to formalise the temporary saving of the C<errno>
1692variable.
1693
1694=item *
1695
1696The function C<Perl_sv_insert_flags> has been added to augment
1697C<Perl_sv_insert>.
1698
1699=item *
1700
1701The function C<Perl_newSV_type(type)> has been added, equivalent to
1702C<Perl_newSV()> followed by C<Perl_sv_upgrade(type)>.
1703
1704=item *
1705
1706The function C<Perl_newSVpvn_flags()> has been added, equivalent to
1707C<Perl_newSVpvn()> and then performing the action relevant to the flag.
1708
1709Two flag bits are currently supported.
1710
1711=over 4
1712
1713=item *
1714
702b4ef6
JV
1715C<SVf_UTF8> will call C<SvUTF8_on()> for you. (Note that this does
1716not convert an sequence of ISO 8859-1 characters to UTF-8). A wrapper,
1717C<newSVpvn_utf8()> is available for this.
3ab3a109
JV
1718
1719=item *
1720
b6381718 1721C<SVs_TEMP> now calls C<Perl_sv_2mortal()> on the new SV.
3ab3a109
JV
1722
1723=back
1724
1725There is also a wrapper that takes constant strings, C<newSVpvs_flags()>.
1726
1727=item *
1728
1729The function C<Perl_croak_xs_usage> has been added as a wrapper to
1730C<Perl_croak>.
1731
1732=item *
1733
b6381718 1734Perl now exports the functions C<PerlIO_find_layer> and C<PerlIO_list_alloc>.
3ab3a109
JV
1735
1736=item *
1737
702b4ef6
JV
1738C<PL_na> has been exterminated from the core code, replaced by local
1739STRLEN temporaries, or C<*_nolen()> calls. Either approach is faster than
1740C<PL_na>, which is a pointer dereference into the interpreter structure
1741under ithreads, and a global variable otherwise.
3ab3a109
JV
1742
1743=item *
1744
702b4ef6
JV
1745C<Perl_mg_free()> used to leave freed memory accessible via C<SvMAGIC()>
1746on the scalar. It now updates the linked list to remove each piece of
1747magic as it is freed.
3ab3a109
JV
1748
1749=item *
1750
702b4ef6
JV
1751Under ithreads, the regex in C<PL_reg_curpm> is now reference
1752counted. This eliminates a lot of hackish workarounds to cope with it
1753not being reference counted.
3ab3a109
JV
1754
1755=item *
1756
1757C<Perl_mg_magical()> would sometimes incorrectly turn on C<SvRMAGICAL()>.
1758This has been fixed.
1759
1760=item *
1761
1762The I<public> IV and NV flags are now not set if the string value has
1763trailing "garbage". This behaviour is consistent with not setting the
1764public IV or NV flags if the value is out of range for the type.
1765
1766=item *
1767
702b4ef6
JV
1768Uses of C<Nullav>, C<Nullcv>, C<Nullhv>, C<Nullop>, C<Nullsv> etc have
1769been replaced by C<NULL> in the core code, and non-dual-life modules,
1770as C<NULL> is clearer to those unfamiliar with the core code.
3ab3a109
JV
1771
1772=item *
1773
1774A macro C<MUTABLE_PTR(p)> has been added, which on (non-pedantic) gcc will
1775not cast away C<const>, returning a C<void *>. Macros C<MUTABLE_SV(av)>,
1776C<MUTABLE_SV(cv)> etc build on this, casting to C<AV *> etc without
1777casting away C<const>. This allows proper compile-time auditing of
702b4ef6
JV
1778C<const> correctness in the core, and helped picked up some errors
1779(now fixed).
3ab3a109
JV
1780
1781=item *
1782
1783Macros C<mPUSHs()> and C<mXPUSHs()> have been added, for pushing SVs on the
1784stack and mortalizing them.
1785
1786=item *
1787
1788Use of the private structure C<mro_meta> has changed slightly. Nothing
1789outside the core should be accessing this directly anyway.
1790
b6381718
JV
1791=item *
1792
1793A new tool, F<Porting/expand-macro.pl> has been added, that allows you
1794to view how a C preprocessor macro would be expanded when compiled.
1795This is handy when trying to decode the macro hell that is the perl
1796guts.
1797
1798=back
1799
1800=head1 Testing
1801
1802=head2 Testing improvements
1803
1804=over 4
1805
1806=item Parallel tests
1807
1808The core distribution can now run its regression tests in parallel on
1809Unix-like platforms. Instead of running C<make test>, set C<TEST_JOBS> in
1810your environment to the number of tests to run in parallel, and run
1811C<make test_harness>. On a Bourne-like shell, this can be done as
1812
1813 TEST_JOBS=3 make test_harness # Run 3 tests in parallel
3ab3a109 1814
b6381718
JV
1815An environment variable is used, rather than parallel make itself, because
1816L<TAP::Harness> needs to be able to schedule individual non-conflicting test
1817scripts itself, and there is no standard interface to C<make> utilities to
1818interact with their job schedulers.
3ab3a109 1819
b6381718
JV
1820Note that currently some test scripts may fail when run in parallel (most
1821notably C<ext/IO/t/io_dir.t>). If necessary run just the failing scripts
1822again sequentially and see if the failures go away.
3ab3a109 1823
b6381718 1824=item Test harness flexibility
3ab3a109 1825
b6381718
JV
1826It's now possible to override C<PERL5OPT> and friends in F<t/TEST>
1827
1828=item Test watchdog
3ab3a109 1829
3ab3a109
JV
1830Several tests that have the potential to hang forever if they fail now
1831incorporate a "watchdog" functionality that will kill them after a timeout,
1832which helps ensure that C<make test> and C<make test_harness> run to
79849ba8 1833completion automatically.
3ab3a109 1834
b6381718
JV
1835
1836=back
1837
1838=head2 New Tests
1839
1840Perl's developers have added a number of new tests to the core.
1841In addition to the items listed below, many modules updated from CPAN
1842incorporate new tests.
3ab3a109
JV
1843
1844=over 4
1845
1846=item *
1847
1848Significant cleanups to core tests to ensure that language and
1849interpreter features are not used before they're tested.
1850
1851=item *
1852
c66407fa
RS
1853C<make test_porting> now runs a number of important pre-commit checks
1854which might be of use to anyone working on the Perl core.
3ab3a109
JV
1855
1856=item *
1857
1858F<t/porting/podcheck.t> automatically checks the well-formedness of
1859POD found in all .pl, .pm and .pod files in the F<MANIFEST>, other than in
1860dual-lifed modules which are primarily maintained outside the Perl core.
1861
1862=item *
1863
702b4ef6
JV
1864F<t/porting/manifest.t> now tests that all files listed in MANIFEST
1865are present.
3ab3a109
JV
1866
1867=item *
1868
b6381718 1869F<t/op/while_readdir.t> tests that a bare readdir in while loop sets $_.
3ab3a109
JV
1870
1871=item *
1872
702b4ef6
JV
1873F<t/comp/retainedlines.t> checks that the debugger can retain source
1874lines from C<eval>.
3ab3a109
JV
1875
1876=item *
1877
b6381718 1878F<t/io/perlio_fail.t> checks that bad layers fail.
3ab3a109
JV
1879
1880=item *
1881
b6381718 1882F<t/io/perlio_leaks.t> checks that PerlIO layers are not leaking.
3ab3a109
JV
1883
1884=item *
1885
b6381718 1886F<t/io/perlio_open.t> checks that certain special forms of open work.
3ab3a109
JV
1887
1888=item *
1889
b6381718 1890F<t/io/perlio.t> includes general PerlIO tests.
3ab3a109
JV
1891
1892=item *
1893
702b4ef6
JV
1894F<t/io/pvbm.t> checks that there is no unexpected interaction between
1895the internal types C<PVBM> and C<PVGV>.
3ab3a109
JV
1896
1897=item *
1898
702b4ef6
JV
1899F<t/mro/package_aliases.t> checks that mro works properly in the presence
1900of aliased packages.
3ab3a109
JV
1901
1902=item *
1903
b6381718 1904F<t/op/dbm.t> tests C<dbmopen> and C<dbmclose>.
3ab3a109
JV
1905
1906=item *
1907
b6381718 1908F<t/op/index_thr.t> tests the interaction of C<index> and threads.
3ab3a109
JV
1909
1910=item *
1911
b6381718 1912F<t/op/pat_thr.t> tests the interaction of esoteric patterns and threads.
3ab3a109
JV
1913
1914=item *
1915
b6381718 1916F<t/op/qr_gc.t> tests that C<qr> doesn't leak.
3ab3a109
JV
1917
1918=item *
1919
b6381718 1920F<t/op/reg_email_thr.t> tests the interaction of regex recursion and threads.
3ab3a109
JV
1921
1922=item *
1923
702b4ef6
JV
1924F<t/op/regexp_qr_embed_thr.t> tests the interaction of patterns with
1925embedded C<qr//> and threads.
3ab3a109
JV
1926
1927=item *
1928
702b4ef6
JV
1929F<t/op/regexp_unicode_prop.t> tests Unicode properties in regular
1930expressions.
3ab3a109
JV
1931
1932=item *
1933
702b4ef6
JV
1934F<t/op/regexp_unicode_prop_thr.t> tests the interaction of Unicode
1935properties and threads.
3ab3a109
JV
1936
1937=item *
1938
b6381718 1939F<t/op/reg_nc_tie.t> tests the tied methods of C<Tie::Hash::NamedCapture>.
3ab3a109
JV
1940
1941=item *
1942
702b4ef6
JV
1943F<t/op/reg_posixcc.t> checks that POSIX character classes behave
1944consistently.
3ab3a109
JV
1945
1946=item *
1947
0c359e6f 1948F<t/op/re.t> checks that exportable C<re> functions in F<universal.c> work.
3ab3a109
JV
1949
1950=item *
1951
b6381718 1952F<t/op/setpgrpstack.t> checks that C<setpgrp> works.
3ab3a109
JV
1953
1954=item *
1955
b6381718 1956F<t/op/substr_thr.t> tests the interaction of C<substr> and threads.
3ab3a109
JV
1957
1958=item *
1959
b6381718 1960F<t/op/upgrade.t> checks that upgrading and assigning scalars works.
3ab3a109
JV
1961
1962=item *
1963
b6381718 1964F<t/uni/lex_utf8.t> checks that Unicode in the lexer works.
3ab3a109
JV
1965
1966=item *
1967
b6381718 1968F<t/uni/tie.t> checks that Unicode and C<tie> work.
3ab3a109
JV
1969
1970=item *
1971
b6381718 1972F<t/comp/final_line_num.t> tests whether line numbers are correct at EOF
3ab3a109
JV
1973
1974=item *
1975
b6381718 1976F<t/comp/form_scope.t> tests format scoping.
3ab3a109
JV
1977
1978=item *
1979
b6381718 1980F<t/comp/line_debug.t> tests whether C<< @{"_<$file"} >> works.
3ab3a109
JV
1981
1982=item *
1983
b6381718 1984F<t/op/filetest_t.t> tests if -t file test works.
3ab3a109
JV
1985
1986=item *
1987
b6381718 1988F<t/op/qr.t> tests C<qr>.
3ab3a109
JV
1989
1990=item *
1991
b6381718 1992F<t/op/utf8cache.t> tests malfunctions of the utf8 cache.
3ab3a109
JV
1993
1994=item *
1995
b6381718 1996F<t/re/uniprops.t> test unicodes C<\p{}> regex constructs.
3ab3a109 1997
b16f1257
JV
1998=item *
1999
b6381718
JV
2000F<t/op/filehandle.t> tests some suitably portable filetest operators
2001to check that they work as expected, particularly in the light of some
2002internal changes made in how filehandles are blessed.
72d4e865 2003
b16f1257
JV
2004=item *
2005
b6381718
JV
2006F<t/op/time_loop.t> tests that unix times greater than C<2**63>, which
2007can now be handed to C<gmtime> and C<localtime>, do not cause an internal
2008overflow or an excessively long loop.
72d4e865 2009
3ab3a109
JV
2010=back
2011
3ab3a109 2012
b6381718 2013=head1 New or Changed Diagnostics
72d4e865 2014
b6381718 2015=head2 New Diagnostics
72d4e865 2016
b6381718 2017=over
72d4e865 2018
b6381718 2019=item *
72d4e865 2020
b6381718
JV
2021SV allocation tracing has been added to the diagnostics enabled by C<-Dm>.
2022The tracing can alternatively output via the C<PERL_MEM_LOG> mechanism, if
2023that was enabled when the F<perl> binary was compiled.
72d4e865 2024
b6381718 2025=item *
3ab3a109 2026
702b4ef6
JV
2027Smartmatch resolution tracing has been added as a new diagnostic. Use
2028C<-DM> to enable it.
3ab3a109 2029
b6381718 2030=item *
3ab3a109 2031
b6381718
JV
2032A new debugging flag C<-DB> now dumps subroutine definitions, leaving
2033C<-Dx> for its original purpose of dumping syntax trees.
3ab3a109 2034
b6381718 2035=item *
3ab3a109 2036
b6381718
JV
2037Perl 5.12 provides a number of new diagnostic messages to help you write
2038better code. See L<perldiag> for details of these new messages.
3ab3a109
JV
2039
2040=over 4
2041
2042=item *
2043
2044C<Bad plugin affecting keyword '%s'>
2045
2046=item *
2047
2048C<gmtime(%.0f) too large>
2049
2050=item *
2051
2052C<Lexing code attempted to stuff non-Latin-1 character into Latin-1 input>
2053
2054=item *
2055
2056C<Lexing code internal error (%s)>
2057
2058=item *
2059
2060C<localtime(%.0f) too large>
2061
2062=item *
2063
2064C<Overloaded dereference did not return a reference>
2065
2066=item *
2067
2068C<Overloaded qr did not return a REGEXP>
2069
2070=item *
2071
2072C<Perl_pmflag() is deprecated, and will be removed from the XS API>
2073
2074=item *
2075
b6381718 2076C<lvalue attribute ignored after the subroutine has been defined>
3ab3a109
JV
2077
2078This new warning is issued when one attempts to mark a subroutine as
2079lvalue after it has been defined.
2080
2081=item *
2082
702b4ef6
JV
2083Perl now warns you if C<++> or C<--> are unable to change the value
2084because it's beyond the limit of representation.
3ab3a109
JV
2085
2086This uses a new warnings category: "imprecision".
2087
208f012a 2088=item *
c66407fa
RS
2089
2090C<lc>, C<uc>, C<lcfirst>, and C<ucfirst> warn when passed undef.
3ab3a109
JV
2091
2092=item *
2093
b6381718 2094C<Show constant in "Useless use of a constant in void context">
3ab3a109
JV
2095
2096=item *
2097
b6381718 2098C<Prototype after '%s'>
3ab3a109
JV
2099
2100=item *
2101
b6381718
JV
2102C<panic: sv_chop %s>
2103
2104This new fatal error occurs when the C routine C<Perl_sv_chop()> was
2105passed a position that is not within the scalar's string buffer. This
2106could be caused by buggy XS code, and at this point recovery is not
2107possible.
2108
3ab3a109
JV
2109
2110=item *
2111
b6381718
JV
2112The fatal error C<Malformed UTF-8 returned by \N> is now produced if the
2113C<charnames> handler returns malformed UTF-8.
3ab3a109
JV
2114
2115=item *
2116
702b4ef6
JV
2117If an unresolved named character or sequence was encountered when
2118compiling a regex pattern then the fatal error C<\N{NAME} must be resolved
2119by the lexer> is now produced. This can happen, for example, when using a
2120single-quotish context like C<$re = '\N{SPACE}'; /$re/;>. See L<perldiag>
2121for more examples of how the lexer can get bypassed.
3ab3a109
JV
2122
2123=item *
2124
702b4ef6
JV
2125C<Invalid hexadecimal number in \N{U+...}> is a new fatal error
2126triggered when the character constant represented by C<...> is not a
2127valid hexadecimal number.
3ab3a109
JV
2128
2129=item *
2130
b6381718 2131The new meaning of C<\N> as C<[^\n]> is not valid in a bracketed character
702b4ef6
JV
2132class, just like C<.> in a character class loses its special meaning,
2133and will cause the fatal error C<\N in a character class must be a named
2134character: \N{...}>.
b6381718
JV
2135
2136=item *
3ab3a109 2137
702b4ef6
JV
2138The rules on what is legal for the C<...> in C<\N{...}> have been
2139tightened up so that unless the C<...> begins with an alphabetic
2140character and continues with a combination of alphanumerics, dashes,
2141spaces, parentheses or colons then the warning C<Deprecated character(s)
2142in \N{...} starting at '%s'> is now issued.
3ab3a109
JV
2143
2144=item *
2145
702b4ef6
JV
2146The warning C<Using just the first characters returned by \N{}> will
2147be issued if the C<charnames> handler returns a sequence of characters
2148which exceeds the limit of the number of characters that can be used. The
2149message will indicate which characters were used and which were discarded.
3ab3a109 2150
b6381718 2151=back
3ab3a109 2152
b6381718 2153=back
3ab3a109 2154
b6381718 2155=head2 Changed Diagnostics
3ab3a109 2156
b6381718 2157A number of existing diagnostic messages have been improved or corrected:
3ab3a109 2158
b6381718 2159=over
3ab3a109
JV
2160
2161=item *
2162
b6381718
JV
2163A new warning category C<illegalproto> allows finer-grained control of
2164warnings around function prototypes.
3ab3a109 2165
b6381718 2166The two warnings:
3ab3a109 2167
b6381718 2168=over
3ab3a109 2169
b6381718
JV
2170=item C<Illegal character in prototype for %s : %s>
2171
2172=item C<Prototype after '%c' for %s : %s>
2173
2174=back
2175
2176have been moved from the C<syntax> top-level warnings category into a new
702b4ef6
JV
2177first-level category, C<illegalproto>. These two warnings are currently
2178the only ones emitted during parsing of an invalid/illegal prototype,
2179so one can now use
b6381718
JV
2180
2181 no warnings 'illegalproto';
2182
702b4ef6
JV
2183to suppress only those, but not other syntax-related warnings. Warnings
2184where prototypes are changed, ignored, or not met are still in the
2185C<prototype> category as before.
3ab3a109
JV
2186
2187=item *
2188
3ab3a109
JV
2189C<Deep recursion on subroutine "%s">
2190
2191It is now possible to change the depth threshold for this warning from the
2192default of 100, by recompiling the F<perl> binary, setting the C
2193pre-processor macro C<PERL_SUB_DEPTH_WARN> to the desired value.
2194
2195=item *
2196
b6381718
JV
2197C<Illegal character in prototype> warning is now more precise
2198when reporting illegal characters after _
3ab3a109
JV
2199
2200=item *
2201
702b4ef6
JV
2202mro merging error messages are now very similar to those produced by
2203L<Algorithm::C3>.
3ab3a109
JV
2204
2205=item *
2206
b6381718
JV
2207Amelioration of the error message "Unrecognized character %s in column %d"
2208
2209Changes the error message to "Unrecognized character %s; marked by E<lt>--
2210HERE after %sE<lt>-- HERE near column %d". This should make it a little
2211simpler to spot and correct the suspicious character.
3ab3a109
JV
2212
2213=item *
2214
702b4ef6
JV
2215Perl now explicitly points to C<$.> when it causes an uninitialized
2216warning for ranges in scalar context.
3ab3a109
JV
2217
2218=item *
2219
b6381718 2220C<split> now warns when called in void context.
3ab3a109
JV
2221
2222=item *
2223
b6381718
JV
2224C<printf>-style functions called with too few arguments will now issue the
2225warning C<"Missing argument in %s"> [perl #71000]
3ab3a109
JV
2226
2227=item *
2228
b6381718
JV
2229Perl now properly returns a syntax error instead of segfaulting
2230if C<each>, C<keys>, or C<values> is used without an argument.
3ab3a109
JV
2231
2232=item *
2233
b6381718
JV
2234C<tell()> now fails properly if called without an argument and when no
2235previous file was read.
3ab3a109 2236
b6381718
JV
2237C<tell()> now returns C<-1>, and sets errno to C<EBADF>, thus restoring
2238the 5.8.x behaviour.
3ab3a109
JV
2239
2240=item *
2241
b6381718
JV
2242C<overload> no longer implicitly unsets fallback on repeated 'use
2243overload' lines.
3ab3a109 2244
72d4e865
JV
2245=item *
2246
b6381718 2247POSIX::strftime() can now handle Unicode characters in the format string.
72d4e865
JV
2248
2249=item *
2250
b6381718
JV
2251The C<syntax> category was removed from 5 warnings that should only be in
2252C<deprecated>.
72d4e865
JV
2253
2254=item *
2255
b6381718
JV
2256Three fatal C<pack>/C<unpack> error messages have been normalized to
2257C<panic: %s>
72d4e865
JV
2258
2259=item *
2260
b6381718
JV
2261C<Unicode character is illegal> has been rephrased to be more accurate
2262
2263It now reads C<Unicode non-character is illegal in interchange> and the
2264perldiag documentation has been expanded a bit.
72d4e865
JV
2265
2266=item *
2267
702b4ef6
JV
2268Currently, all but the first of the several characters that the
2269C<charnames> handler may return are discarded when used in a regular
2270expression pattern bracketed character class. If this happens then the
2271warning C<Using just the first character returned by \N{} in character
2272class> will be issued.
72d4e865
JV
2273
2274=item *
2275
702b4ef6
JV
2276The warning C<Missing right brace on \N{} or unescaped left brace after
2277\N. Assuming the latter> will be issued if Perl encounters a C<\N{>
2278but doesn't find a matching C<}>. In this case Perl doesn't know if it
2279was mistakenly omitted, or if "match non-newline" followed by "match
2280a C<{>" was desired. It assumes the latter because that is actually a
2281valid interpretation as written, unlike the other case. If you meant
2282the former, you need to add the matching right brace. If you did mean
2283the latter, you can silence this warning by writing instead C<\N\{>.
72d4e865
JV
2284
2285=item *
2286
702b4ef6
JV
2287C<gmtime> and C<localtime> called with numbers smaller than they can
2288reliably handle will now issue the warnings C<gmtime(%.0f) too small>
2289and C<localtime(%.0f) too small>.
72d4e865
JV
2290
2291=back
3ab3a109 2292
b6381718 2293The following diagnostic messages have been removed:
c66407fa
RS
2294
2295=over 4
2296
2297=item *
2298
2299C<Runaway format>
2300
2301=item *
2302
2303C<Can't locate package %s for the parents of %s>
2304
b6381718 2305In general this warning it only got produced in
c66407fa
RS
2306conjunction with other warnings, and removing it allowed an ISA lookup
2307optimisation to be added.
2308
2309=item *
2310
2311C<v-string in use/require is non-portable>
2312
2313=back
2314
3ab3a109
JV
2315=head1 Utility Changes
2316
2317=over 4
2318
2319=item *
2320
702b4ef6
JV
2321F<h2ph> now looks in C<include-fixed> too, which is a recent addition
2322to gcc's search path.
3ab3a109
JV
2323
2324=item *
2325
79849ba8 2326F<h2xs> no longer incorrectly treats enum values like macros.
208f012a 2327It also now handles C++ style comments (C<//>) properly in enums.
3ab3a109
JV
2328
2329=item *
2330
d13f8571
JD
2331F<perl5db.pl> now supports C<LVALUE> subroutines. Additionally, the
2332debugger now correctly handles proxy constant subroutines, and
2333subroutine stubs.
3ab3a109
JV
2334
2335=item *
2336
b6381718
JV
2337F<perlbug> now uses C<%Module::CoreList::bug_tracker> to print out
2338upstream bug tracker URLs. If a user identifies a particular module
4655b0a1 2339as the topic of their bug report and we're able to divine the URL for
b6381718
JV
2340its upstream bug tracker, perlbug now provide a message to the user
2341explaining that the core copies the CPAN version directly, and provide
2342the URL for reporting the bug directly to the upstream author.
3ab3a109 2343
702b4ef6
JV
2344F<perlbug> no longer reports "Message sent" when it hasn't actually sent
2345the message
3ab3a109
JV
2346
2347=item *
2348
b6381718
JV
2349F<perlthanks> is a new utility for sending non-bug-reports to the
2350authors and maintainers of Perl. Getting nothing but bug reports can
2351become a bit demoralising. If Perl 5.12 works well for you, please try
2352out F<perlthanks>. It will make the developers smile.
3ab3a109
JV
2353
2354=item *
2355
b6381718 2356Perl's developers have fixed bugs in F<a2p> having to do with the
e014eb68
JV
2357C<match()> operator in list context. Additionally, F<a2p> no longer
2358generates code that uses the C<$[> variable.
3ab3a109
JV
2359
2360=back
2361
2362=head1 Selected Bug Fixes
2363
2364=over 4
2365
2366=item *
2367
b6381718
JV
2368U+0FFFF is now a legal character in regular expressions.
2369
2370=item *
2371
2372pp_qr now always returns a new regexp SV. Resolves RT #69852.
3ab3a109 2373
702b4ef6
JV
2374Instead of returning a(nother) reference to the (pre-compiled) regexp
2375in the optree, use reg_temp_copy() to create a copy of it, and return a
2376reference to that. This resolves issues about Regexp::DESTROY not being
2377called in a timely fashion (the original bug tracked by RT #69852), as
2378well as bugs related to blessing regexps, and of assigning to regexps,
2379as described in correspondence added to the ticket.
3ab3a109
JV
2380
2381It transpires that we also need to undo the SvPVX() sharing when ithreads
702b4ef6
JV
2382cloning a Regexp SV, because mother_re is set to NULL, instead of a
2383cloned copy of the mother_re. This change might fix bugs with regexps
2384and threads in certain other situations, but as yet neither tests nor
2385bug reports have indicated any problems, so it might not actually be an
2386edge case that it's possible to reach.
3ab3a109
JV
2387
2388=item *
2389
702b4ef6
JV
2390Several compilation errors and segfaults when perl was built with C<-Dmad>
2391were fixed.
3ab3a109
JV
2392
2393=item *
2394
2395Fixes for lexer API changes in 5.11.2 which broke NYTProf's savesrc option.
2396
2397=item *
2398
c66407fa 2399C<-t> should only return TRUE for file handles connected to a TTY
3ab3a109 2400
702b4ef6
JV
2401The Microsoft C version of C<isatty()> returns TRUE for all character mode
2402devices, including the F</dev/null>-style "nul" device and printers like
2403"lpt1".
3ab3a109
JV
2404
2405=item *
2406
2407Fixed a regression caused by commit fafafbaf which caused a panic during
2408parameter passing [perl #70171]
2409
2410=item *
2411
2412On systems which in-place edits without backup files, -i'*' now works as
2413the documentation says it does [perl #70802]
2414
2415=item *
2416
2417Saving and restoring magic flags no longer loses readonly flag.
2418
2419=item *
2420
2421The malformed syntax C<grep EXPR LIST> (note the missing comma) no longer
2422causes abrupt and total failure.
2423
2424=item *
2425
2426Regular expressions compiled with C<qr{}> literals properly set C<$'> when
2427matching again.
2428
2429=item *
2430
702b4ef6
JV
2431Using named subroutines with C<sort> should no longer lead to bus errors
2432[perl #71076]
3ab3a109
JV
2433
2434=item *
2435
2436Numerous bugfixes catch small issues caused by the recently-added Lexer API.
2437
2438=item *
2439
2440Smart match against C<@_> sometimes gave false negatives. [perl #71078]
2441
2442=item *
2443
c66407fa
RS
2444C<$@> may now be assigned a read-only value (without error or busting
2445the stack).
3ab3a109
JV
2446
2447=item *
2448
2449C<sort> called recursively from within an active comparison subroutine no
2450longer causes a bus error if run multiple times. [perl #71076]
2451
2452=item *
2453
c66407fa 2454Tie::Hash::NamedCapture::* will not abort if passed bad input (RT #71828)
3ab3a109
JV
2455
2456=item *
2457
2458@_ and $_ no longer leak under threads (RT #34342 and #41138, also
2459#70602, #70974)
2460
2461=item *
2462
2463C<-I> on shebang line now adds directories in front of @INC
2464as documented, and as does C<-I> when specified on the command-line.
2465
2466=item *
2467
2468C<kill> is now fatal when called on non-numeric process identifiers.
c66407fa
RS
2469Previously, an C<undef> process identifier would be interpreted as a
2470request to kill process 0, which would terminate the current process
72d4e865 2471group on POSIX systems. Since process identifiers are always integers,
c66407fa 2472killing a non-numeric process is now fatal.
3ab3a109
JV
2473
2474=item *
2475
24765.10.0 inadvertently disabled an optimisation, which caused a measurable
2477performance drop in list assignment, such as is often used to assign
2478function parameters from C<@_>. The optimisation has been re-instated, and
72d4e865 2479the performance regression fixed. (This fix is also present in 5.10.1)
3ab3a109
JV
2480
2481=item *
2482
2483Fixed memory leak on C<while (1) { map 1, 1 }> [RT #53038].
2484
2485=item *
2486
2487Some potential coredumps in PerlIO fixed [RT #57322,54828].
2488
2489=item *
2490
2491The debugger now works with lvalue subroutines.
2492
2493=item *
2494
2495The debugger's C<m> command was broken on modules that defined constants
2496[RT #61222].
2497
2498=item *
2499
2500C<crypt> and string complement could return tainted values for untainted
2501arguments [RT #59998].
2502
2503=item *
2504
2505The C<-i>I<.suffix> command-line switch now recreates the file using
2506restricted permissions, before changing its mode to match the original
2507file. This eliminates a potential race condition [RT #60904].
2508
2509=item *
2510
2511On some Unix systems, the value in C<$?> would not have the top bit set
2512(C<$? & 128>) even if the child core dumped.
2513
2514=item *
2515
2516Under some circumstances, C<$^R> could incorrectly become undefined
2517[RT #57042].
2518
2519=item *
2520
2521In the XS API, various hash functions, when passed a pre-computed hash where
2522the key is UTF-8, might result in an incorrect lookup.
2523
2524=item *
2525
2526XS code including F<XSUB.h> before F<perl.h> gave a compile-time error
2527[RT #57176].
2528
2529=item *
2530
702b4ef6
JV
2531C<< $object-E<gt>isa('Foo') >> would report false if the package C<Foo>
2532didn't exist, even if the object's C<@ISA> contained C<Foo>.
3ab3a109
JV
2533
2534=item *
2535
2536Various bugs in the new-to 5.10.0 mro code, triggered by manipulating
2537C<@ISA>, have been found and fixed.
2538
2539=item *
2540
2541Bitwise operations on references could crash the interpreter, e.g.
2542C<$x=\$y; $x |= "foo"> [RT #54956].
2543
2544=item *
2545
2546Patterns including alternation might be sensitive to the internal UTF-8
2547representation, e.g.
2548
2549 my $byte = chr(192);
2550 my $utf8 = chr(192); utf8::upgrade($utf8);
2551 $utf8 =~ /$byte|X}/i; # failed in 5.10.0
2552
2553=item *
2554
2555Within UTF8-encoded Perl source files (i.e. where C<use utf8> is in
2556effect), double-quoted literal strings could be corrupted where a C<\xNN>,
2557C<\0NNN> or C<\N{}> is followed by a literal character with ordinal value
2558greater than 255 [RT #59908].
2559
2560=item *
2561
2562C<B::Deparse> failed to correctly deparse various constructs:
2563C<readpipe STRING> [RT #62428], C<CORE::require(STRING)> [RT #62488],
2564C<sub foo(_)> [RT #62484].
2565
2566=item *
2567
2568Using C<setpgrp> with no arguments could corrupt the perl stack.
2569
2570=item *
2571
2572The block form of C<eval> is now specifically trappable by C<Safe> and
72d4e865 2573C<ops>. Previously it was erroneously treated like string C<eval>.
3ab3a109
JV
2574
2575=item *
2576
2577In 5.10.0, the two characters C<[~> were sometimes parsed as the smart
2578match operator (C<~~>) [RT #63854].
2579
2580=item *
2581
2582In 5.10.0, the C<*> quantifier in patterns was sometimes treated as
2583C<{0,32767}> [RT #60034, #60464]. For example, this match would fail:
2584
2585 ("ab" x 32768) =~ /^(ab)*$/
2586
2587=item *
2588
2589C<shmget> was limited to a 32 bit segment size on a 64 bit OS [RT #63924].
2590
2591=item *
2592
2593Using C<next> or C<last> to exit a C<given> block no longer produces a
2594spurious warning like the following:
2595
2596 Exiting given via last at foo.pl line 123
2597
2598=item *
2599
3ab3a109
JV
2600Assigning a format to a glob could corrupt the format; e.g.:
2601
2602 *bar=*foo{FORMAT}; # foo format now bad
2603
2604=item *
2605
2606Attempting to coerce a typeglob to a string or number could cause an
2607assertion failure. The correct error message is now generated,
2608C<Can't coerce GLOB to I<$type>>.
2609
2610=item *
2611
702b4ef6
JV
2612Under C<use filetest 'access'>, C<-x> was using the wrong access
2613mode. This has been fixed [RT #49003].
3ab3a109
JV
2614
2615=item *
2616
2617C<length> on a tied scalar that returned a Unicode value would not be
2618correct the first time. This has been fixed.
2619
2620=item *
2621
2622Using an array C<tie> inside in array C<tie> could SEGV. This has been
2623fixed. [RT #51636]
2624
2625=item *
2626
2627A race condition inside C<PerlIOStdio_close()> has been identified and
2628fixed. This used to cause various threading issues, including SEGVs.
2629
2630=item *
2631
2632In C<unpack>, the use of C<()> groups in scalar context was internally
2633placing a list on the interpreter's stack, which manifested in various
72d4e865 2634ways, including SEGVs. This is now fixed [RT #50256].
3ab3a109
JV
2635
2636=item *
2637
2638Magic was called twice in C<substr>, C<\&$x>, C<tie $x, $m> and C<chop>.
2639These have all been fixed.
2640
2641=item *
2642
2643A 5.10.0 optimisation to clear the temporary stack within the implicit
2644loop of C<s///ge> has been reverted, as it turned out to be the cause of
2645obscure bugs in seemingly unrelated parts of the interpreter [commit
2646ef0d4e17921ee3de].
2647
2648=item *
2649
2650The line numbers for warnings inside C<elsif> are now correct.
2651
2652=item *
2653
2654The C<..> operator now works correctly with ranges whose ends are at or
2655close to the values of the smallest and largest integers.
2656
2657=item *
2658
2659C<binmode STDIN, ':raw'> could lead to segmentation faults on some platforms.
2660This has been fixed [RT #54828].
2661
2662=item *
2663
2664An off-by-one error meant that C<index $str, ...> was effectively being
2665executed as C<index "$str\0", ...>. This has been fixed [RT #53746].
2666
2667=item *
2668
2669Various leaks associated with named captures in regexes have been fixed
2670[RT #57024].
2671
2672=item *
2673
2674A weak reference to a hash would leak. This was affecting C<DBI>
2675[RT #56908].
2676
2677=item *
2678
2679Using (?|) in a regex could cause a segfault [RT #59734].
2680
2681=item *
2682
2683Use of a UTF-8 C<tr//> within a closure could cause a segfault [RT #61520].
2684
2685=item *
2686
2687Calling C<Perl_sv_chop()> or otherwise upgrading an SV could result in an
2688unaligned 64-bit access on the SPARC architecture [RT #60574].
2689
2690=item *
2691
2692In the 5.10.0 release, C<inc_version_list> would incorrectly list
2693C<5.10.*> after C<5.8.*>; this affected the C<@INC> search order
2694[RT #67628].
2695
2696=item *
2697
2698In 5.10.0, C<pack "a*", $tainted_value> returned a non-tainted value
2699[RT #52552].
2700
2701=item *
2702
2703In 5.10.0, C<printf> and C<sprintf> could produce the fatal error
2704C<panic: utf8_mg_pos_cache_update> when printing UTF-8 strings
2705[RT #62666].
2706
2707=item *
2708
2709In the 5.10.0 release, a dynamically created C<AUTOLOAD> method might be
2710missed (method cache issue) [RT #60220,60232].
2711
2712=item *
2713
2714In the 5.10.0 release, a combination of C<use feature> and C<//ee> could
2715cause a memory leak [RT #63110].
2716
2717=item *
2718
2719C<-C> on the shebang (C<#!>) line is once more permitted if it is also
2720specified on the command line. C<-C> on the shebang line used to be a
2721silent no-op I<if> it was not also on the command line, so perl 5.10.0
2722disallowed it, which broke some scripts. Now perl checks whether it is
2723also on the command line and only dies if it is not [RT #67880].
2724
2725=item *
2726
2727In 5.10.0, certain types of re-entrant regular expression could crash,
2728or cause the following assertion failure [RT #60508]:
2729
2730 Assertion rx->sublen >= (s - rx->subbeg) + i failed
2731
2732=item *
2733
702b4ef6
JV
2734Perl now includes previously missing files from the Unicode Character
2735Database.
3ab3a109
JV
2736
2737=item *
2738
b6381718 2739Perl now honors C<TMPDIR> when opening an anonymous temporary file.
3ab3a109
JV
2740
2741=back
2742
b6381718 2743
3ab3a109
JV
2744=head1 Platform Specific Changes
2745
b6381718
JV
2746Perl is incredibly portable. In general, if a platform has a C compiler,
2747someone has ported Perl to it (or will soon). We're happy to announce
2748that Perl 5.12 includes support for several new platforms. At the same
2749time, it's time to bid farewell to some (very) old friends.
2750
3ab3a109
JV
2751=head2 New Platforms
2752
2753=over
2754
2755=item Haiku
2756
702b4ef6
JV
2757Perl's developers have merged patches from Haiku's maintainers. Perl
2758should now build on Haiku.
3ab3a109
JV
2759
2760=item MirOS BSD
2761
2762Perl should now build on MirOS BSD.
2763
3ab3a109
JV
2764=back
2765
2766=head2 Discontinued Platforms
2767
2768=over
2769
3b72faae 2770=item Domain/OS
3ab3a109 2771
3ab3a109
JV
2772=item MiNT
2773
8ead3603
JD
2774=item Tenon MachTen
2775
3ab3a109
JV
2776=back
2777
2778=head2 Updated Platforms
2779
2780=over 4
2781
8ead3603
JD
2782=item AIX
2783
2784=over 4
2785
2786=item *
2787
702b4ef6
JV
2788Removed F<libbsd> for AIX 5L and 6.1. Only C<flock()> was used from
2789F<libbsd>.
8ead3603
JD
2790
2791=item *
2792
702b4ef6
JV
2793Removed F<libgdbm> for AIX 5L and 6.1 if F<libgdbm> < 1.8.3-5 is
2794installed. The F<libgdbm> is delivered as an optional package with the
2795AIX Toolbox. Unfortunately the versions below 1.8.3-5 are broken.
8ead3603
JD
2796
2797=item *
2798
2799Hints changes mean that AIX 4.2 should work again.
2800
2801=back
2802
2803=item Cygwin
2804
2805=over 4
2806
2807=item *
2808
2809Perl now supports IPv6 on Cygwin 1.7 and newer.
2810
2811=item *
2812
2813On Cygwin we now strip the last number from the DLL. This has been the
2814behaviour in the cygwin.com build for years. The hints files have been
2815updated.
2816
2817=back
2818
3ab3a109
JV
2819=item Darwin (Mac OS X)
2820
2821=over 4
2822
2823=item *
2824
2825Skip testing the be_BY.CP1131 locale on Darwin 10 (Mac OS X 10.6),
2826as it's still buggy.
2827
2828=item *
2829
2830Correct infelicities in the regexp used to identify buggy locales
2831on Darwin 8 and 9 (Mac OS X 10.4 and 10.5, respectively).
2832
2833=back
2834
2835=item DragonFly BSD
2836
2837=over 4
2838
2839=item *
2840
2841Fix thread library selection [perl #69686]
2842
2843=back
2844
8ead3603 2845=item FreeBSD
3ab3a109
JV
2846
2847=over 4
2848
2849=item *
2850
8ead3603
JD
2851The hints files now identify the correct threading libraries on FreeBSD 7
2852and later.
3ab3a109 2853
8ead3603 2854=back
3ab3a109 2855
8ead3603 2856=item Irix
3ab3a109 2857
8ead3603 2858=over 4
3ab3a109
JV
2859
2860=item *
2861
8ead3603
JD
2862We now work around a bizarre preprocessor bug in the Irix 6.5 compiler:
2863C<cc -E -> unfortunately goes into K&R mode, but C<cc -E file.c> doesn't.
3ab3a109
JV
2864
2865=back
2866
8ead3603 2867=item NetBSD
3ab3a109
JV
2868
2869=over 4
2870
2871=item *
2872
8ead3603 2873Hints now supports versions 5.*.
3ab3a109
JV
2874
2875=back
2876
2877=item OpenVMS
2878
2879=over 4
2880
2881=item *
2882
b6381718 2883C<-UDEBUGGING> is now the default on VMS.
3ab3a109 2884
702b4ef6
JV
2885Like it has been everywhere else for ages and ages. Also make command-line
2886selection of -UDEBUGGING and -DDEBUGGING work in configure.com; before
2887the only way to turn it off was by saying no in answer to the interactive
2888question.
3ab3a109
JV
2889
2890=item *
2891
2892The default pipe buffer size on VMS has been updated to 8192 on 64-bit
2893systems.
2894
2895=item *
2896
2897Reads from the in-memory temporary files of C<PerlIO::scalar> used to fail
2898if C<$/> was set to a numeric reference (to indicate record-style reads).
2899This is now fixed.
2900
2901=item *
2902
2903VMS now supports C<getgrgid>.
2904
2905=item *
2906
2907Many improvements and cleanups have been made to the VMS file name handling
2908and conversion code.
2909
2910=item *
2911
2912Enabling the C<PERL_VMS_POSIX_EXIT> logical name now encodes a POSIX exit
2913status in a VMS condition value for better interaction with GNV's bash
72d4e865 2914shell and other utilities that depend on POSIX exit values. See
3ab3a109
JV
2915L<perlvms/"$?"> for details.
2916
2917=item *
2918
2919C<File::Copy> now detects Unix compatibility mode on VMS.
2920
2921=back
2922
8ead3603 2923=item Stratus VOS
3ab3a109 2924
8ead3603 2925=over 4
3ab3a109 2926
8ead3603 2927=item *
3ab3a109 2928
8ead3603 2929Various changes from Stratus have been merged in.
3ab3a109 2930
8ead3603 2931=back
3ab3a109 2932
8ead3603 2933=item Symbian
3ab3a109 2934
8ead3603 2935=over 4
3ab3a109 2936
8ead3603 2937=item *
3ab3a109 2938
8ead3603 2939There is now support for Symbian S60 3.2 SDK and S60 5.0 SDK.
3ab3a109 2940
8ead3603 2941=back
3ab3a109 2942
d13f8571 2943=item Windows
3ab3a109 2944
8ead3603 2945=over 4
3ab3a109 2946
8ead3603 2947=item *
3ab3a109 2948
d13f8571
JD
2949Perl 5.12 supports Windows 2000 and later. The supporting code for
2950legacy versions of Windows is still included, but will be removed
2951during the next development cycle.
3ab3a109 2952
8ead3603 2953=item *
3ab3a109 2954
d13f8571 2955Initial support for building Perl with MinGW-w64 is now available.
3ab3a109 2956
8ead3603
JD
2957=item *
2958
d13f8571 2959F<perl.exe> now includes a manifest resource to specify the C<trustInfo>
8ead3603 2960settings for Windows Vista and later. Without this setting Windows
d13f8571 2961would treat F<perl.exe> as a legacy application and apply various
8ead3603
JD
2962heuristics like redirecting access to protected file system areas
2963(like the "Program Files" folder) to the users "VirtualStore"
2964instead of generating a proper "permission denied" error.
2965
d13f8571
JD
2966The manifest resource also requests the Microsoft Common-Controls
2967version 6.0 (themed controls introduced in Windows XP). Check out the
2968Win32::VisualStyles module on CPAN to switch back to old style
2969unthemed controls for legacy applications.
2970
2971=item *
2972
2973The C<-t> filetest operator now only returns true if the filehandle
2974is connected to a console window. In previous versions of Perl it
2975would return true for all character mode devices, including F<NUL>
2976and F<LPT1>.
2977
2978=item *
2979
2980The C<-p> filetest operator now works correctly, and the
2981Fcntl::S_IFIFO constant is defined when Perl is compiled with
2982Microsoft Visual C. In previous Perl versions C<-p> always
2983returned a false value, and the Fcntl::S_IFIFO constant
2984was not defined.
2985
2986This bug is specific to Microsoft Visual C and never affected
2987Perl binaries built with MinGW.
2988
2989=item *
2990
2991The socket error codes are now more widely supported: The POSIX
2992module will define the symbolic names, like POSIX::EWOULDBLOCK,
2993and stringification of socket error codes in $! works as well
2994now;
2995
2996 C:\>perl -MPOSIX -E "$!=POSIX::EWOULDBLOCK; say $!"
2997 A non-blocking socket operation could not be completed immediately.
2998
2999=item *
3000
3001flock() will now set sensible error codes in $!. Previous Perl versions
3002copied the value of $^E into $!, which caused much confusion.
3003
3004=item *
3005
3006select() now supports all empty C<fd_set>s more correctly.
8ead3603 3007
d13f8571
JD
3008=item *
3009
3010C<'.\foo'> and C<'..\foo'> were treated differently than
3011C<'./foo'> and C<'../foo'> by C<do> and C<require> [RT #63492].
8ead3603
JD
3012
3013=item *
3014
3015Improved message window handling means that C<alarm> and C<kill> messages
3016will no longer be dropped under race conditions.
3017
d13f8571
JD
3018=item *
3019
3020Various bits of Perl's build infrastructure are no longer converted to
3021win32 line endings at release time. If this hurts you, please report the
3022problem with the L<perlbug> program included with perl.
3023
8ead3603 3024=back
3ab3a109
JV
3025
3026=back
3027
b6381718 3028
3ab3a109
JV
3029=head1 Known Problems
3030
3031This is a list of some significant unfixed bugs, which are regressions
72d4e865 3032from either 5.10.x or 5.8.x.
3ab3a109
JV
3033
3034=over 4
3035
3036=item *
3037
36914053
JJ
3038Some CPANPLUS tests may fail if there is a functioning file
3039F<../../cpanp-run-perl> outside your build directory. The failure
3040shouldn't imply there's a problem with the actual functional
3041software. The bug is already fixed in [RT #74188] and is scheduled for
3042inclusion in perl-v5.12.1.
3043
3044=item *
3045
3ab3a109
JV
3046C<List::Util::first> misbehaves in the presence of a lexical C<$_>
3047(typically introduced by C<my $_> or implicitly by C<given>). The variable
3048which gets set for each iteration is the package variable C<$_>, not the
3049lexical C<$_> [RT #67694].
3050
3051A similar issue may occur in other modules that provide functions which
3052take a block as their first argument, like
3053
3054 foo { ... $_ ...} list
3055
3056=item *
3057
3ab3a109
JV
3058Some regexes may run much more slowly when run in a child thread compared
3059with the thread the pattern was compiled into [RT #55600].
3060
3061=item *
3062
3d3a8206
KW
3063Things like C<"\N{LATIN SMALL LIGATURE FF}" =~ /\N{LATIN SMALL LETTER F}+/>
3064will appear to hang as they get into a very long running loop [RT #72998].
3065
3066=item *
3067
d13f8571
JD
3068Several porters have reported mysterious crashes when Perl's entire
3069test suite is run after a build on certain Windows 2000 systems. When
3070run by hand, the individual tests reportedly work fine.
3ab3a109 3071
b6381718
JV
3072=back
3073
3074=head1 Errata
3075
3076=over
3077
3ab3a109
JV
3078=item *
3079
b6381718
JV
3080This one is actually a change introduced in 5.10.0, but it was missed
3081from that release's perldelta, so it is mentioned here instead.
3082
3083A bugfix related to the handling of the C</m> modifier and C<qr> resulted
3084in a change of behaviour between 5.8.x and 5.10.0:
3ab3a109 3085
b6381718
JV
3086 # matches in 5.8.x, doesn't match in 5.10.0
3087 $re = qr/^bar/; "foo\nbar" =~ /$re/m;
3ab3a109 3088
3ab3a109
JV
3089=back
3090
3091=head1 Acknowledgements
3092
3093Perl 5.12.0 represents approximately two years of development since
aac88411 3094Perl 5.10.0 and contains over 750,000 lines of changes across over
ee75e258 30953,000 files from over 200 authors and committers.
aac88411 3096
d13f8571
JD
3097Perl continues to flourish into its third decade thanks to a vibrant
3098community of users and developers. The following people are known to
3099have contributed the improvements that became Perl 5.12.0:
aac88411
JV
3100
3101Aaron Crane, Abe Timmerman, Abhijit Menon-Sen, Abigail, Adam Russell,
3102Adriano Ferreira, Ævar Arnfjörð Bjarmason, Alan Grover, Alexandr
3103Ciornii, Alex Davies, Alex Vandiver, Andreas Koenig, Andrew Rodland,
3104andrew@sundale.net, Andy Armstrong, Andy Dougherty, Jose AUGUSTE-ETIENNE,
3105Benjamin Smith, Ben Morrow, bharanee rathna, Bo Borgerson, Bo Lindbergh,
3106Brad Gilbert, Bram, Brendan O'Dea, brian d foy, Charles Bailey,
3107Chip Salzenberg, Chris 'BinGOs' Williams, Christoph Lamprecht, Chris
3108Williams, chromatic, Claes Jakobsson, Craig A. Berry, Dan Dascalescu,
3109Daniel Frederick Crisman, Daniel M. Quinlan, Dan Jacobson, Dan Kogai,
3110Dave Mitchell, Dave Rolsky, David Cantrell, David Dick, David Golden,
3111David Mitchell, David M. Syzdek, David Nicol, David Wheeler, Dennis
3112Kaarsemaker, Dintelmann, Peter, Dominic Dunlop, Dr.Ruud, Duke Leto,
3113Enrico Sorcinelli, Eric Brine, Father Chrysostomos, Florian Ragwitz,
3114Frank Wiegand, Gabor Szabo, Gene Sullivan, Geoffrey T. Dairiki, George
3115Greer, Gerard Goossen, Gisle Aas, Goro Fuji, Graham Barr, Green, Paul,
3116Hans Dieter Pearcey, Harmen, H. Merijn Brand, Hugo van der Sanden,
3117Ian Goodacre, Igor Sutton, Ingo Weinhold, James Bence, James Mastros,
3118Jan Dubois, Jari Aalto, Jarkko Hietaniemi, Jay Hannah, Jerry Hedden,
3119Jesse Vincent, Jim Cromie, Jody Belka, John E. Malmberg, John Malmberg,
3120John Peacock, John Peacock via RT, John P. Linderman, John Wright,
3121Josh ben Jore, Jos I. Boumans, Karl Williamson, Kenichi Ishigaki, Ken
3122Williams, Kevin Brintnall, Kevin Ryde, Kurt Starsinic, Leon Brocard,
3123Lubomir Rintel, Luke Ross, Marcel Grünauer, Marcus Holland-Moritz, Mark
3124Jason Dominus, Marko Asplund, Martin Hasch, Mashrab Kuvatov, Matt Kraai,
3125Matt S Trout, Max Maischein, Michael Breen, Michael Cartmell, Michael
3126G Schwern, Michael Witten, Mike Giroux, Milosz Tanski, Moritz Lenz,
3127Nicholas Clark, Nick Cleaton, Niko Tyni, Offer Kaye, Osvaldo Villalon,
3128Paul Fenwick, Paul Gaborit, Paul Green, Paul Johnson, Paul Marquess,
3129Philip Hazel, Philippe Bruhat, Rafael Garcia-Suarez, Rainer Tammer,
3130Rajesh Mandalemula, Reini Urban, Renée Bäcker, Ricardo Signes,
3131Ricardo SIGNES, Richard Foley, Rich Rauenzahn, Rick Delaney, Risto
3132Kankkunen, Robert May, Roberto C. Sanchez, Robin Barker, SADAHIRO
3133Tomoyuki, Salvador Ortiz Garcia, Sam Vilain, Scott Lanning, Sébastien
3134Aperghis-Tramoni, Sérgio Durigan Júnior, Shlomi Fish, Simon 'corecode'
3135Schubert, Sisyphus, Slaven Rezic, Smylers, Steffen Müller, Steffen
3136Ullrich, Stepan Kasal, Steve Hay, Steven Schubiger, Steve Peters, Tels,
3137The Doctor, Tim Bunce, Tim Jenness, Todd Rinaldo, Tom Christiansen,
3138Tom Hukins, Tom Wyant, Tony Cook, Torsten Schoenfeld, Tye McQueen,
3139Vadim Konovalov, Vincent Pit, Hio YAMASHINA, Yasuhiro Matsumoto,
3140Yitzchak Scott-Thoennes, Yuval Kogman, Yves Orton, Zefram, Zsban Ambrus
3141
3142This is woefully incomplete as it's automatically generated from version
3143control history. In particular, it doesn't include the names of the
3144(very much appreciated) contributors who reported issues in previous
3145versions of Perl that helped make Perl 5.12.0 better. For a more complete
3146list of all of Perl's historical contributors, please see the C<AUTHORS>
3147file in the Perl 5.12.0 distribution.
3ab3a109 3148
c8937c7e
CB
3149Our "retired" pumpkings Nicholas Clark and Rafael Garcia-Suarez
3150deserve special thanks for their brilliant and substantive ongoing
3151contributions. Nicholas personally authored over 30% of the patches
3152since 5.10.0. Rafael comes in second in patch authorship with 11%,
3153but is first by a long shot in committing patches authored by others,
3154pushing 44% of the commits since 5.10.0 in this category, often after
3155providing considerable coaching to the patch authors. These statistics
3156in no way comprise all of their contributions, but express in shorthand
3157that we couldn't have done it without them.
3158
3ab3a109
JV
3159Many of the changes included in this version originated in the CPAN
3160modules included in Perl's core. We're grateful to the entire CPAN
3161community for helping Perl to flourish.
3162
3163=head1 Reporting Bugs
3164
3165If you find what you think is a bug, you might check the articles
3166recently posted to the comp.lang.perl.misc newsgroup and the perl
72d4e865 3167bug database at L<http://rt.perl.org/perlbug/>. There may also be
3ab3a109
JV
3168information at L<http://www.perl.org/>, the Perl Home Page.
3169
3170If you believe you have an unreported bug, please run the B<perlbug>
72d4e865
JV
3171program included with your release. Be sure to trim your bug down
3172to a tiny but sufficient test case. Your bug report, along with the
3ab3a109
JV
3173output of C<perl -V>, will be sent off to perlbug@perl.org to be
3174analyzed by the Perl porting team.
3175
3176If the bug you are reporting has security implications, which make it
3177inappropriate to send to a publicly archived mailing list, then please send
3178it to perl5-security-report@perl.org. This points to a closed subscription
3179unarchived mailing list, which includes all the core committers, who be able
3180to help assess the impact of issues, figure out a resolution, and help
3181co-ordinate the release of patches to mitigate or fix the problem across all
3182platforms on which Perl is supported. Please only use this address for
3183security issues in the Perl core, not for modules independently
3184distributed on CPAN.
3185
3186=head1 SEE ALSO
3187
3188The F<Changes> file for an explanation of how to view exhaustive details
3189on what changed.
3190
3191The F<INSTALL> file for how to build Perl.
3192
3193The F<README> file for general stuff.
3194
3195The F<Artistic> and F<Copying> files for copyright information.
3196
861ff9eb
JV
3197L<http://dev.perl.org/perl5/errata.html> for a list of issues
3198found after this release, as well as a list of CPAN modules known
3199to be incompatible with this release.
3200
3ab3a109 3201=cut