This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update perldelta for push/keys changes
[perl5.git] / pod / perldelta.pod
CommitLineData
44691e6f
AB
1=encoding utf8
2
3=head1 NAME
4
5076a392 5perldelta - what is new for perl v5.14.0
c71a852f 6
5076a392
FC
7=head1 DESCRIPTION
8
9This document describes differences between the 5.12.0 release and
10the 5.14.0 release.
11
0980abf1
FC
12If you are upgrading from an earlier release such as 5.10.0, first read
13L<perl5120delta>, which describes differences between 5.10.0 and
145.12.0.
15
5076a392 16Some of the bug fixes in this release have been backported to subsequent
40bd7639 17releases of 5.12.x. Those are indicated with the 5.12.x version in
5076a392
FC
18parentheses.
19
5076a392
FC
20=head1 Notice
21
1c7f7822
JV
22As described in L<perlpolicy>, the release of Perl 5.14.0 marks the
23official end of support for Perl 5.10. Users of Perl 5.10 or earlier
24should consider upgrading to a more recent release of Perl.
5076a392
FC
25
26=head1 Core Enhancements
27
1f539a1a 28=head2 Unicode
5076a392 29
1f539a1a 30=head3 Unicode Version 6.0 is now supported (mostly)
5076a392 31
1f539a1a
FC
32Perl comes with the Unicode 6.0 data base updated with
33L<Corrigendum #8|http://www.unicode.org/versions/corrigendum8.html>,
34with one exception noted below.
c2b7148f 35See L<http://unicode.org/versions/Unicode6.0.0/> for details on the new
1f539a1a 36release. Perl does not support any Unicode provisional properties,
a3c24add 37including the new ones for this release.
5076a392 38
1f539a1a 39Unicode 6.0 has chosen to use the name C<BELL> for the character at U+1F514,
e1b1739f 40which is a symbol that looks like a bell, and is used in Japanese cell
1f539a1a
FC
41phones. This conflicts with the long-standing Perl usage of having
42C<BELL> mean the ASCII C<BEL> character, U+0007. In Perl 5.14,
f8992784 43C<\N{BELL}> continues to mean U+0007, but its use generates a
d15cad80 44deprecation warning message unless such warnings are turned off. The
12f3ad4e
FC
45new name for U+0007 in Perl is C<ALERT>, which corresponds nicely
46with the existing shorthand sequence for it, C<"\a">. C<\N{BEL}>
d15cad80 47means U+0007, with no warning given. The character at U+1F514 has no
f8992784 48name in 5.14, but can be referred to by C<\N{U+1F514}>.
1c7f7822
JV
49In Perl 5.16, C<\N{BELL}> will refer to U+1F514; all code
50that uses C<\N{BELL}> should be converted to use C<\N{ALERT}>,
51C<\N{BEL}>, or C<"\a"> before upgrading.
5076a392 52
d15cad80 53=head3 Full functionality for C<use feature "unicode_strings">
5076a392 54
1f539a1a 55This release provides full functionality for C<use feature
d15cad80 56"unicode_strings">. Under its scope, all string operations executed and
1f539a1a 57regular expressions compiled (even if executed outside its scope) have
52594064 58Unicode semantics. See L<feature/"the 'unicode_strings' feature">.
5076a392 59
c2b7148f 60This feature avoids most forms of the "Unicode Bug" (see
d15cad80 61L<perlunicode/The "Unicode Bug"> for details). If there is any
1f539a1a 62possibility that your code will process Unicode strings, you are
d15cad80 63I<strongly> encouraged to use this subpragma to avoid nasty surprises.
5076a392 64
d15cad80 65=head3 C<\N{I<NAME>}> and C<charnames> enhancements
5076a392 66
1f539a1a 67=over
5076a392 68
1f539a1a 69=item *
5076a392 70
d15cad80
TC
71C<\N{I<NAME>}> and C<charnames::vianame> now know about the abbreviated
72character names listed by Unicode, such as NBSP, SHY, LRO, ZWJ, etc.; all
e1b1739f 73the customary abbreviations for the C0 and C1 control characters (such as
d15cad80 74ACK, BEL, CAN, etc.); and a few new variants of some C1 full names that
e1b1739f 75are in common usage.
5076a392 76
1f539a1a
FC
77=item *
78
d15cad80
TC
79Unicode has several I<named character sequences>, in which particular sequences
80of code points are given names. C<\N{I<NAME>}> now recognizes these.
959ad7d5 81
1f539a1a
FC
82=item *
83
d15cad80
TC
84C<\N{I<NAME>}>, C<charnames::vianame>, and C<charnames::viacode>
85now know about every character in Unicode. In earlier releases of
86Perl, they didn't know about the Hangul syllables nor a number of
87CJK (Chinese/Japanese/Korean) characters.
959ad7d5 88
1f539a1a
FC
89=item *
90
1c7f7822 91It is now possible to override Perl's abbreviations with your own custom aliases.
5076a392 92
1f539a1a
FC
93=item *
94
1c7f7822 95You can now create a custom alias of the ordinal of a
f8992784 96character, known by C<\N{I<NAME>}>, C<charnames::vianame()>, and
1c7f7822
JV
97C<charnames::viacode()>. Previously, aliases had to be to official
98Unicode character names. This made it impossible to create an alias for
99unnamed code points, such as those reserved for private
e1b1739f 100use.
5076a392 101
1f539a1a
FC
102=item *
103
d15cad80 104The new function charnames::string_vianame() is a run-time version
f8992784 105of C<\N{I<NAME>}}>, returning the string of characters whose Unicode
d15cad80
TC
106name is its parameter. It can handle Unicode named character
107sequences, whereas the pre-existing charnames::vianame() cannot,
108as the latter returns a single code point.
959ad7d5 109
1f539a1a
FC
110=back
111
5076a392
FC
112See L<charnames> for details on all these changes.
113
22349846
KW
114=head3 New warnings categories for problematic (non-)Unicode code points.
115
116Three new warnings subcategories of "utf8" have been added. These
117allow you to turn off some "utf8" warnings, while allowing
c2b7148f 118other warnings to remain on. The three categories are:
22349846
KW
119C<surrogate> when UTF-16 surrogates are encountered;
120C<nonchar> when Unicode non-character code points are encountered;
d15cad80 121and C<non_unicode> when code points above the legal Unicode
22349846
KW
122maximum of 0x10FFFF are encountered.
123
1f539a1a 124=head3 Any unsigned value can be encoded as a character
5076a392 125
d15cad80
TC
126With this release, Perl is adopting a model that any unsigned value
127can be treated as a code point and encoded internally (as utf8)
128without warnings, not just the code points that are legal in Unicode.
22349846 129However, unless utf8 or the corresponding sub-category (see previous
d15cad80
TC
130item) lexical warnings have been explicitly turned off, outputting
131or performing a Unicode-defined operation (such as upper-casing)
132on such a code point generates a warning. Attempting to input these
133using strict rules (such as with the C<:encoding(UTF-8)> layer)
134will continue to fail. Prior to this release, handling was
135inconsistent and in places, incorrect.
1c7f7822
JV
136
137Unicode non-characters, some of which previously were erroneously
d15cad80
TC
138considered illegal in places by Perl, contrary to the Unicode Standard,
139are now always legal internally. Inputting or outputting them
140works the same as with the non-legal Unicode code points, because the Unicode
141standard says they are (only) illegal for "open interchange".
5076a392 142
daef9d5b
KW
143=head3 Unicode database files not installed
144
145The Unicode database files are no longer installed with Perl. This
146doesn't affect any functionality in Perl and saves significant disk
1c7f7822 147space. If you need these files, you can download them from
daef9d5b
KW
148L<http://www.unicode.org/Public/zipped/6.0.0/>.
149
1f539a1a 150=head2 Regular Expressions
5076a392 151
1c7f7822 152=head3 C<(?^...)> construct signifies default modifiers
5076a392 153
c2b7148f 154An ASCII caret C<"^"> immediately following a C<"(?"> in a regular
1c7f7822
JV
155expression now means that the subexpression does not inherit surrounding
156modifiers such as C</i>, but reverts to the Perl defaults. Any modifiers
157following the caret override the defaults.
5076a392 158
d15cad80
TC
159Stringification of regular expressions now uses this notation.
160For example, C<qr/hlagh/i> would previously be stringified as
161C<(?i-xsm:hlagh)>, but now it's stringified as C<(?^i:hlagh)>.
5076a392 162
d15cad80
TC
163The main purpose of this change is to allow tests that rely on the
164stringification I<not> to have to change whenever new modifiers are added.
5076a392
FC
165See L<perlre/Extended Patterns>.
166
1c7f7822
JV
167This change is likely to break code which compares stringified regular
168expressions with fixed strings containing C<?-xism>.
169
170
1f539a1a 171=head3 C</d>, C</l>, C</u>, C</a>, and C</aa> modifiers
5076a392 172
40bd7639 173Four new regular expression modifiers have been added. These are mutually
d15cad80
TC
174exclusive: one only can be turned on at a time.
175
176=over
177
178=item *
5076a392 179
959ad7d5 180The C</l> modifier says to compile the regular expression as if it were
5076a392
FC
181in the scope of C<use locale>, even if it is not.
182
d15cad80
TC
183=item *
184
959ad7d5 185The C</u> modifier says to compile the regular expression as if it were
5076a392
FC
186in the scope of a C<use feature "unicode_strings"> pragma.
187
d15cad80
TC
188=item *
189
e1b1739f 190The C</d> (default) modifier is used to override any C<use locale> and
d15cad80 191C<use feature "unicode_strings"> pragmas in effect at the time
5076a392
FC
192of compiling the regular expression.
193
d15cad80
TC
194=item *
195
959ad7d5 196The C</a> regular expression modifier restricts C<\s>, C<\d> and C<\w> and
122c7b7d 197the POSIX (C<[[:posix:]]>) character classes to the ASCII range. Their
959ad7d5
FC
198complements and C<\b> and C<\B> are correspondingly
199affected. Otherwise, C</a> behaves like the C</u> modifier, in that
e1b1739f 200case-insensitive matching uses Unicode semantics.
5076a392 201
d15cad80
TC
202=item *
203
1c7f7822 204The C</aa> modifier is like C</a>, except that, in case-insensitive
d15cad80 205matching, no ASCII character can match a non-ASCII character.
1c7f7822 206For example,
5076a392 207
d15cad80
TC
208 "k" =~ /\N{KELVIN SIGN}/ai
209 "\xDF" =~ /ss/ai
5076a392 210
d15cad80 211match but
1c7f7822 212
d15cad80
TC
213 "k" =~ /\N{KELVIN SIGN}/aai
214 "\xDF" =~ /ss/aai
1c7f7822 215
d15cad80
TC
216do not match.
217
218=back
5076a392 219
959ad7d5 220See L<perlre/Modifiers> for more detail.
5076a392 221
1f539a1a 222=head3 Non-destructive substitution
5076a392 223
1f539a1a
FC
224The substitution (C<s///>) and transliteration
225(C<y///>) operators now support an C</r> option that
226copies the input variable, carries out the substitution on
d15cad80 227the copy, and returns the result. The original remains unmodified.
5076a392 228
d15cad80 229 my $old = "cat";
1f539a1a 230 my $new = $old =~ s/cat/dog/r;
d15cad80 231 # $old is "cat" and $new is "dog"
5076a392 232
1f539a1a 233This is particularly useful with C<map>. See L<perlop> for more examples.
5076a392 234
d15cad80 235=head3 Re-entrant regular expression engine
5076a392 236
1f539a1a
FC
237It is now safe to use regular expressions within C<(?{...})> and
238C<(??{...})> code blocks inside regular expressions.
5076a392 239
c2b7148f 240These blocks are still experimental, however, and still have problems with
e1b1739f 241lexical (C<my>) variables and abnormal exiting.
5076a392 242
d15cad80 243=head3 C<use re "/flags">
5076a392
FC
244
245The C<re> pragma now has the ability to turn on regular expression flags
246till the end of the lexical scope:
247
d15cad80 248 use re "/x";
5076a392
FC
249 "foo" =~ / (.+) /; # /x implied
250
251See L<re/"'/flags' mode"> for details.
252
1f539a1a 253=head3 \o{...} for octals
5076a392 254
d15cad80 255There is a new octal escape sequence, C<"\o">, in doublequote-like
e1b1739f 256contexts. This construct allows large octal ordinals beyond the
1f539a1a
FC
257current max of 0777 to be represented. It also allows you to specify a
258character in octal which can safely be concatenated with other regex
259snippets and which won't be confused with being a backreference to
260a regex capture group. See L<perlre/Capture groups>.
261
262=head3 Add C<\p{Titlecase}> as a synonym for C<\p{Title}>
263
264This synonym is added for symmetry with the Unicode property names
265C<\p{Uppercase}> and C<\p{Lowercase}>.
5076a392 266
1f539a1a
FC
267=head3 Regular expression debugging output improvement
268
d15cad80 269Regular expression debugging output (turned on by C<use re "debug">) now
1f539a1a
FC
270uses hexadecimal when escaping non-ASCII characters, instead of octal.
271
1e463951
FC
272=head3 Return value of C<delete $+{...}>
273
274Custom regular expression engines can now determine the return value of
275C<delete> on an entry of C<%+> or C<%->.
276
1f539a1a
FC
277=head2 Syntactical Enhancements
278
279=head3 Array and hash container functions accept references
5076a392 280
12ebd9a8
FC
281B<Warning:> This feature is considered experimental, as the exact behaviour
282may change in a future version of Perl.
283
d15cad80 284All builtin functions that operate directly on array or hash
1c7f7822
JV
285containers now also accept unblessed hard references to arrays
286or hashes:
5076a392
FC
287
288 |----------------------------+---------------------------|
289 | Traditional syntax | Terse syntax |
290 |----------------------------+---------------------------|
291 | push @$arrayref, @stuff | push $arrayref, @stuff |
292 | unshift @$arrayref, @stuff | unshift $arrayref, @stuff |
293 | pop @$arrayref | pop $arrayref |
294 | shift @$arrayref | shift $arrayref |
295 | splice @$arrayref, 0, 2 | splice $arrayref, 0, 2 |
296 | keys %$hashref | keys $hashref |
297 | keys @$arrayref | keys $arrayref |
298 | values %$hashref | values $hashref |
299 | values @$arrayref | values $arrayref |
300 | ($k,$v) = each %$hashref | ($k,$v) = each $hashref |
301 | ($k,$v) = each @$arrayref | ($k,$v) = each $arrayref |
302 |----------------------------+---------------------------|
303
d15cad80 304This allows these builtin functions to act on long dereferencing chains
5076a392
FC
305or on the return value of subroutines without needing to wrap them in
306C<@{}> or C<%{}>:
307
308 push @{$obj->tags}, $new_tag; # old way
309 push $obj->tags, $new_tag; # new way
310
311 for ( keys %{$hoh->{genres}{artists}} ) {...} # old way
312 for ( keys $hoh->{genres}{artists} ) {...} # new way
313
1f539a1a
FC
314=head3 Single term prototype
315
d15cad80 316The C<+> prototype is a special alternative to C<$> that acts like
1f539a1a 317C<\[@%]> when given a literal array or hash variable, but will otherwise
e1b1739f 318force scalar context on the argument. See L<perlsub/Prototypes>.
1f539a1a
FC
319
320=head3 C<package> block syntax
321
322A package declaration can now contain a code block, in which case the
d15cad80 323declaration is in scope inside that block only. So C<package Foo { ... }>
1f539a1a 324is precisely equivalent to C<{ package Foo; ... }>. It also works with
d15cad80
TC
325a version number in the declaration, as in C<package Foo 1.2 { ... }>,
326which is its most attractive feature. See L<perlfunc>.
1f539a1a
FC
327
328=head3 Statement labels can appear in more places
329
330Statement labels can now occur before any type of statement or declaration,
331such as C<package>.
332
333=head3 Stacked labels
334
335Multiple statement labels can now appear before a single statement.
336
337=head3 Uppercase X/B allowed in hexadecimal/binary literals
338
339Literals may now use either upper case C<0X...> or C<0B...> prefixes,
340in addition to the already supported C<0x...> and C<0b...>
e1b1739f 341syntax [perl #76296].
1f539a1a 342
d15cad80
TC
343C, Ruby, Python, and PHP already support this syntax, and it makes
344Perl more internally consistent: a round-trip with C<eval sprintf
345"%#X", 0x10> now returns C<16>, just like C<eval sprintf "%#x", 0x10>.
1f539a1a 346
1e463951
FC
347=head3 Overridable tie functions
348
349C<tie>, C<tied> and C<untie> can now be overridden [perl #75902].
350
1f539a1a
FC
351=head2 Exception Handling
352
d15cad80
TC
353To make them more reliable and consistent, several changes have been made
354to how C<die>, C<warn>, and C<$@> behave.
1f539a1a 355
1c7f7822
JV
356=over
357
358=item *
359
1f539a1a 360When an exception is thrown inside an C<eval>, the exception is no
d15cad80
TC
361longer at risk of being clobbered by destructor code running during unwinding.
362Previously, the exception was written into C<$@>
1f539a1a
FC
363early in the throwing process, and would be overwritten if C<eval> was
364used internally in the destructor for an object that had to be freed
365while exiting from the outer C<eval>. Now the exception is written
366into C<$@> last thing before exiting the outer C<eval>, so the code
367running immediately thereafter can rely on the value in C<$@> correctly
368corresponding to that C<eval>. (C<$@> is still also set before exiting the
369C<eval>, for the sake of destructors that rely on this.)
370
d15cad80 371Likewise, a C<local $@> inside an C<eval> no longer clobbers any
1f539a1a
FC
372exception thrown in its scope. Previously, the restoration of C<$@> upon
373unwinding would overwrite any exception being thrown. Now the exception
374gets to the C<eval> anyway. So C<local $@> is safe before a C<die>.
375
376Exceptions thrown from object destructors no longer modify the C<$@>
377of the surrounding context. (If the surrounding context was exception
378unwinding, this used to be another way to clobber the exception being
379thrown.) Previously such an exception was
380sometimes emitted as a warning, and then either was
381string-appended to the surrounding C<$@> or completely replaced the
382surrounding C<$@>, depending on whether that exception and the surrounding
383C<$@> were strings or objects. Now, an exception in this situation is
384always emitted as a warning, leaving the surrounding C<$@> untouched.
385In addition to object destructors, this also affects any function call
386performed by XS code using the C<G_KEEPERR> flag.
387
1c7f7822
JV
388=item *
389
d15cad80
TC
390Warnings for C<warn> can now be objects in the same way as exceptions
391for C<die>. If an object-based warning gets the default handling
392of writing to standard error, it is stringified as before with the
393filename and line number appended. But a C<$SIG{__WARN__}> handler now
394receives an object-based warning as an object, where previously it
395was passed the result of stringifying the object.
1f539a1a 396
1c7f7822
JV
397=back
398
1f539a1a
FC
399=head2 Other Enhancements
400
d15cad80 401=head3 Assignment to C<$0> sets the legacy process name with prctl() on Linux
1f539a1a 402
7d7b9667
JV
403On Linux the legacy process name is now set with L<prctl(2)>, in
404addition to altering the POSIX name via C<argv[0]>, as Perl has done
12f3ad4e 405since version 4.000. Now system utilities that read the legacy process
d15cad80
TC
406name such as I<ps>, I<top>, and I<killall> recognize the name you set when
407assigning to C<$0>. The string you supply is truncated at 16 bytes;
408this limitation is imposed by Linux.
1f539a1a 409
d15cad80 410=head3 srand() now returns the seed
1f539a1a 411
e1b1739f 412This allows programs that need to have repeatable results not to have to come
d15cad80
TC
413up with their own seed-generating mechanism. Instead, they can use srand()
414and stash the return value for future use. One example is a test program with
415too many combinations to test comprehensively in the time available for
e1b1739f 416each run. It can test a random subset each time and, should there be a failure,
d15cad80 417log the seed used for that run so this can later be used to produce the same results.
1f539a1a
FC
418
419=head3 printf-like functions understand post-1980 size modifiers
420
421Perl's printf and sprintf operators, and Perl's internal printf replacement
422function, now understand the C90 size modifiers "hh" (C<char>), "z"
423(C<size_t>), and "t" (C<ptrdiff_t>). Also, when compiled with a C99
d15cad80
TC
424compiler, Perl now understands the size modifier "j" (C<intmax_t>)
425(but this is not portable).
1f539a1a 426
d15cad80 427So, for example, on any modern machine, C<sprintf("%hhd", 257)> returns "1".
1f539a1a
FC
428
429=head3 New global variable C<${^GLOBAL_PHASE}>
5076a392
FC
430
431A new global variable, C<${^GLOBAL_PHASE}>, has been added to allow
d15cad80
TC
432introspection of the current phase of the Perl interpreter. It's explained in
433detail in L<perlvar/"${^GLOBAL_PHASE}"> and in
5076a392
FC
434L<perlmod/"BEGIN, UNITCHECK, CHECK, INIT and END">.
435
1f539a1a 436=head3 C<-d:-foo> calls C<Devel::foo::unimport>
5076a392
FC
437
438The syntax C<-dI<B<:>foo>> was extended in 5.6.1 to make C<-dI<:fooB<=bar>>>
439equivalent to C<-MDevel::foo=bar>, which expands
d15cad80 440internally to C<use Devel::foo "bar">.
c2b7148f 441Perl now allows prefixing the module name with C<->, with the same
d15cad80 442semantics as C<-M>, that is:
5076a392
FC
443
444=over 4
445
446=item C<-d:-foo>
447
448Equivalent to C<-M-Devel::foo>, expands to
d15cad80 449C<no Devel::foo>, calls C<< Devel::foo->unimport() >>
5076a392
FC
450if the method exists.
451
452=item C<-d:-foo=bar>
453
d15cad80
TC
454Equivalent to C<-M-Devel::foo=bar>, expands to C<no Devel::foo "bar">,
455calls C<< Devel::foo->unimport("bar") >> if the method exists.
5076a392
FC
456
457=back
458
e1b1739f 459This is particularly useful for suppressing the default actions of a
5076a392
FC
460C<Devel::*> module's C<import> method whilst still loading it for debugging.
461
1f539a1a 462=head3 Filehandle method calls load L<IO::File> on demand
5076a392
FC
463
464When a method call on a filehandle would die because the method cannot
d15cad80 465be resolved and L<IO::File> has not been loaded, Perl now loads L<IO::File>
5076a392
FC
466via C<require> and attempts method resolution again:
467
468 open my $fh, ">", $file;
469 $fh->binmode(":raw"); # loads IO::File and succeeds
470
d15cad80 471This also works for globs like STDOUT, STDERR, and STDIN:
5076a392
FC
472
473 STDOUT->autoflush(1);
474
d15cad80 475Because this on-demand load happens only if method resolution fails, the
5076a392
FC
476legacy approach of manually loading an L<IO::File> parent class for partial
477method support still works as expected:
478
479 use IO::Handle;
480 open my $fh, ">", $file;
481 $fh->autoflush(1); # IO::File not loaded
482
1c7f7822 483=head3 Improved IPv6 support
1984204c
FC
484
485The C<Socket> module provides new affordances for IPv6,
486including implementations of the C<Socket::getaddrinfo()> and
d15cad80 487C<Socket::getnameinfo()> functions, along with related constants and a
1984204c
FC
488handful of new functions. See L<Socket>.
489
1f539a1a 490=head3 DTrace probes now include package name
5076a392 491
d15cad80 492The DTrace probes now include an additional argument, C<arg3>, which contains
5076a392
FC
493the package the subroutine being entered or left was compiled in.
494
d15cad80 495For example, using the following DTrace script:
5076a392
FC
496
497 perl$target:::sub-entry
498 {
499 printf("%s::%s\n", copyinstr(arg0), copyinstr(arg3));
500 }
501
502and then running:
503
d15cad80 504 $ perl -e 'sub test { }; test'
5076a392
FC
505
506DTrace will print:
507
508 main::test
509
9378886b
FC
510=head2 New C APIs
511
1e463951 512See L</Internal Changes>.
9378886b 513
5076a392
FC
514=head1 Security
515
948b8455 516=head2 User-defined regular expression properties
5076a392 517
1c7f7822 518L<perlunicode/"User-Defined Character Properties"> documented that you can
5076a392 519create custom properties by defining subroutines whose names begin with
6369b34f 520"In" or "Is". However, Perl did not actually enforce that naming
1c7f7822
JV
521restriction, so \p{foo::bar} could call foo::bar() if it existed. The documented
522convention is now enforced.
5076a392 523
1c7f7822 524Also, Perl no longer allows tainted regular expressions to invoke a
6369b34f 525user-defined property. It simply dies instead [perl #82616].
5076a392
FC
526
527=head1 Incompatible Changes
528
61752d82
FC
529Perl 5.14.0 is not binary-compatible with any previous stable release.
530
1e463951
FC
531In addition to the sections that follow, see L</C API Changes>.
532
61752d82
FC
533=head2 Regular Expressions and String Escapes
534
54c7bb16 535=head3 \400-\777
5076a392 536
1c7f7822 537In certain circumstances, C<\400>-C<\777> in regexes have behaved
d15cad80 538differently than they behave in all other doublequote-like contexts.
1c7f7822 539Since 5.10.1, Perl has issued a deprecation warning when this happens.
d15cad80 540Now, these literals behave the same in all doublequote-like contexts,
1c7f7822
JV
541namely to be equivalent to C<\x{100}> - C<\x{1FF}>, with no deprecation
542warning.
543
d15cad80 544Use of C<\400>-C<\777> in the command-line option B<-0> retain their
1c7f7822 545conventional meaning. They slurp whole input files; previously, this
d15cad80 546was documented only for B<-0777>.
1c7f7822
JV
547
548Because of various ambiguities, you should use the new
549C<\o{...}> construct to represent characters in octal instead.
5076a392 550
61752d82 551=head3 Most C<\p{}> properties are now immune to case-insensitive matching
5076a392 552
61752d82 553For most Unicode properties, it doesn't make sense to have them match
1c7f7822
JV
554differently under C</i> case-insensitive matching. Doing so can lead
555to unexpected results and potential security holes. For example
5076a392 556
61752d82 557 m/\p{ASCII_Hex_Digit}+/i
5076a392 558
61752d82 559could previously match non-ASCII characters because of the Unicode
4cf6a51f
KW
560matching rules (although there were a number of bugs with this). Now
561matching under C</i> gives the same results as non-C</i> matching except
562for those few properties where people have come to expect differences,
563namely the ones where casing is an integral part of their meaning, such
564as C<m/\p{Uppercase}/i> and C<m/\p{Lowercase}/i>, both of which match
d15cad80 565the same code points as matched by C<m/\p{Cased}/i>.
4cf6a51f 566Details are in L<perlrecharclass/Unicode Properties>.
5076a392 567
1c7f7822 568User-defined property handlers that need to match differently under C</i>
d15cad80
TC
569must be changed to read the new boolean parameter passed to them, which
570is non-zero if case-insensitive matching is in effect and 0 otherwise.
1c7f7822 571See L<perluniprops/User-Defined Character Properties>.
5076a392 572
61752d82 573=head3 \p{} implies Unicode semantics
5076a392 574
d15cad80 575Specifying a Unicode property in the pattern indicates
61752d82 576that the pattern is meant for matching according to Unicode rules, the way
d15cad80 577C<\N{I<NAME>}> does.
5076a392 578
61752d82 579=head3 Regular expressions retain their localeness when interpolated
5076a392 580
61752d82
FC
581Regular expressions compiled under C<"use locale"> now retain this when
582interpolated into a new regular expression compiled outside a
583C<"use locale">, and vice-versa.
5076a392 584
d15cad80
TC
585Previously, one regular expression interpolated into another inherited
586the localeness of the surrounding regex, losing whatever state it
61752d82 587originally had. This is considered a bug fix, but may trip up code that
d15cad80 588has come to rely on the incorrect behaviour.
5076a392 589
61752d82 590=head3 Stringification of regexes has changed
5076a392 591
d15cad80
TC
592Default regular expression modifiers are now notated using
593C<(?^...)>. Code relying on the old stringification will fail.
594This is so that when new modifiers are added, such code won't
595have to keep changing each time this happens, because the stringification
596will automatically incorporate the new modifiers.
5076a392
FC
597
598Code that needs to work properly with both old- and new-style regexes
d15cad80 599can avoid the whole issue by using (for perls since 5.9.5; see L<re>):
5076a392
FC
600
601 use re qw(regexp_pattern);
602 my ($pat, $mods) = regexp_pattern($re_ref);
603
d15cad80 604If the actual stringification is important or older Perls need to be
5076a392
FC
605supported, you can use something like the following:
606
607 # Accept both old and new-style stringification
d15cad80 608 my $modifiers = (qr/foobar/ =~ /\Q(?^/) ? "^" : "-xism";
5076a392
FC
609
610And then use C<$modifiers> instead of C<-xism>.
611
61752d82 612=head3 Run-time code blocks in regular expressions inherit pragmata
5076a392 613
1c7f7822
JV
614Code blocks in regular expressions (C<(?{...})> and C<(??{...})>) previously
615did not inherit pragmata (strict, warnings, etc.) if the regular expression
61752d82 616was compiled at run time as happens in cases like these two:
5076a392 617
d15cad80 618 use re "eval";
61752d82
FC
619 $foo =~ $bar; # when $bar contains (?{...})
620 $foo =~ /$bar(?{ $finished = 1 })/;
621
d15cad80
TC
622This bug has now been fixed, but code which relied on the buggy behaviour
623may need to be fixed to account for the correct behaviour.
5076a392 624
61752d82 625=head2 Stashes and Package Variables
5076a392 626
61752d82 627=head3 Localised tied hashes and arrays are no longed tied
5076a392 628
61752d82 629In the following:
5076a392 630
61752d82
FC
631 tie @a, ...;
632 {
1c7f7822
JV
633 local @a;
634 # here, @a is a now a new, untied array
61752d82
FC
635 }
636 # here, @a refers again to the old, tied array
5076a392 637
d15cad80 638Earlier versions of Perl incorrectly tied the new local array. This has
1c7f7822
JV
639now been fixed. This fix could however potentially cause a change in
640behaviour of some code.
5076a392 641
61752d82 642=head3 Stashes are now always defined
5076a392 643
61752d82
FC
644C<defined %Foo::> now always returns true, even when no symbols have yet been
645defined in that package.
5076a392 646
d15cad80
TC
647This is a side-effect of removing a special-case kludge in the tokeniser,
648added for 5.10.0, to hide side-effects of changes to the internal storage of
1c7f7822 649hashes. The fix drastically reduces hashes' memory overhead.
61752d82
FC
650
651Calling defined on a stash has been deprecated since 5.6.0, warned on
d15cad80
TC
652lexicals since 5.6.0, and warned for stashes and other package
653variables since 5.12.0. C<defined %hash> has always exposed an
654implementation detail: emptying a hash by deleting all entries from it does
655not make C<defined %hash> false. Hence C<defined %hash> is not valid code to
6369b34f 656determine whether an arbitrary hash is empty. Instead, use the behaviour
d15cad80 657of an empty C<%hash> always returning false in scalar context.
61752d82 658
48b31689
FC
659=head3 Clearing stashes
660
d15cad80
TC
661Stash list assignment C<%foo:: = ()> used to make the stash temporarily
662anonymous while it was being emptied. Consequently, any of its
663subroutines referenced elsewhere would become anonymous, showing up as
664"(unknown)" in C<caller>. They now retain their package names such that
665C<caller> returns the original sub name if there is still a reference
666to its typeglob and "foo::__ANON__" otherwise [perl #79208].
48b31689 667
61752d82 668=head3 Dereferencing typeglobs
5076a392
FC
669
670If you assign a typeglob to a scalar variable:
671
672 $glob = *foo;
673
674the glob that is copied to C<$glob> is marked with a special flag
1c7f7822
JV
675indicating that the glob is just a copy. This allows subsequent
676assignments to C<$glob> to overwrite the glob. The original glob,
677however, is immutable.
5076a392 678
370ff23e 679Some Perl operators did not distinguish between these two types of globs.
5076a392 680This would result in strange behaviour in edge cases: C<untie $scalar>
370ff23e 681would not untie the scalar if the last thing assigned to it was a glob
5076a392 682(because it treated it as C<untie *$scalar>, which unties a handle).
d15cad80 683Assignment to a glob slot (such as C<*$glob = \@some_array>) would simply
5076a392
FC
684assign C<\@some_array> to C<$glob>.
685
d15cad80 686To fix this, the C<*{}> operator (including its C<*foo> and C<*$foo> forms)
5076a392 687has been modified to make a new immutable glob if its operand is a glob
e262cb24
FC
688copy. This allows operators that make a distinction between globs and
689scalars to be modified to treat only immutable globs as globs. (C<tie>,
690C<tied> and C<untie> have been left as they are for compatibility's sake,
6369b34f 691but will warn. See L</Deprecations>.)
5076a392
FC
692
693This causes an incompatible change in code that assigns a glob to the
6369b34f 694return value of C<*{}> when that operator was passed a glob copy. Take the
5076a392
FC
695following code, for instance:
696
697 $glob = *foo;
698 *$glob = *bar;
699
40bd7639
R
700The C<*$glob> on the second line returns a new immutable glob. That new
701glob is made an alias to C<*bar>. Then it is discarded. So the second
5076a392
FC
702assignment has no effect.
703
1c7f7822 704See L<http://rt.perl.org/rt3/Public/Bug/Display.html?id=77810> for
5076a392
FC
705more detail.
706
61752d82
FC
707=head3 Magic variables outside the main package
708
709In previous versions of Perl, magic variables like C<$!>, C<%SIG>, etc. would
d15cad80 710"leak" into other packages. So C<%foo::SIG> could be used to access signals,
61752d82
FC
711C<${"foo::!"}> (with strict mode off) to access C's C<errno>, etc.
712
d15cad80 713This was a bug, or an "unintentional" feature, which caused various ill effects,
61752d82
FC
714such as signal handlers being wiped when modules were loaded, etc.
715
716This has been fixed (or the feature has been removed, depending on how you see
717it).
718
f8992784 719=head3 local($_) strips all magic from $_
a8bd2968 720
f8992784 721local() on scalar variables gives them a new value but keeps all
d15cad80 722their magic intact. This has proven problematic for the default
a8bd2968 723scalar variable $_, where L<perlsub> recommends that any subroutine
d15cad80
TC
724that assigns to $_ should first localize it. This would throw an
725exception if $_ is aliased to a read-only variable, and could in general have
726various unintentional side-effects.
a8bd2968
FC
727
728Therefore, as an exception to the general rule, local($_) will not
729only assign a new value to $_, but also remove all existing magic from
730it as well.
731
6e925ecb
FC
732=head3 Parsing of package and variable names
733
d15cad80
TC
734Parsing the names of packages and package variables has changed:
735multiple adjacent pairs of colons, as in C<foo::::bar>, are now all
736treated as package separators.
6e925ecb
FC
737
738Regardless of this change, the exact parsing of package separators has
739never been guaranteed and is subject to change in future Perl versions.
740
61752d82
FC
741=head2 Changes to Syntax or to Perl Operators
742
743=head3 C<given> return values
744
745C<given> blocks now return the last evaluated
40bd7639 746expression, or an empty list if the block was exited by C<break>. Thus you
61752d82
FC
747can now write:
748
749 my $type = do {
750 given ($num) {
751 break when undef;
d15cad80
TC
752 "integer" when /^[+-]?[0-9]+$/;
753 "float" when /^[+-]?[0-9]+(?:\.[0-9]+)?$/;
754 "unknown";
61752d82
FC
755 }
756 };
757
758See L<perlsyn/Return value> for details.
759
d15cad80 760=head3 Change in parsing of certain prototypes
61752d82
FC
761
762Functions declared with the following prototypes now behave correctly as unary
763functions:
764
765 *
766 \$ \% \@ \* \&
767 \[...]
768 ;$ ;*
769 ;\$ ;\% etc.
770 ;\[...]
771
772Due to this bug fix [perl #75904], functions
773using the C<(*)>, C<(;$)> and C<(;*)> prototypes
179813a8
FC
774are parsed with higher precedence than before. So
775in the following example:
61752d82
FC
776
777 sub foo($);
778 foo $a < $b;
779
780the second line is now parsed correctly as C<< foo($a) < $b >>, rather than
179813a8 781C<< foo($a < $b) >>. This happens when one of these operators is used in
61752d82
FC
782an unparenthesised argument:
783
784 < > <= >= lt gt le ge
785 == != <=> eq ne cmp ~~
786 &
787 | ^
788 &&
789 || //
790 .. ...
791 ?:
792 = += -= *= etc.
793
794=head3 Smart-matching against array slices
795
796Previously, the following code resulted in a successful match:
797
798 my @a = qw(a y0 z);
799 my @b = qw(a x0 z);
800 @a[0 .. $#b] ~~ @b;
801
802This odd behaviour has now been fixed [perl #77468].
803
804=head3 Negation treats strings differently from before
805
d15cad80 806The unary negation operator, C<->, now treats strings that look like numbers
61752d82
FC
807as numbers [perl #57706].
808
809=head3 Negative zero
810
811Negative zero (-0.0), when converted to a string, now becomes "0" on all
179813a8 812platforms. It used to become "-0" on some, but "0" on others.
61752d82
FC
813
814If you still need to determine whether a zero is negative, use
815C<sprintf("%g", $zero) =~ /^-/> or the L<Data::Float> module on CPAN.
816
817=head3 C<:=> is now a syntax error
5076a392 818
d15cad80 819Previously C<my $pi := 4> was exactly equivalent to C<my $pi : = 4>,
5076a392 820with the C<:> being treated as the start of an attribute list, ending before
179813a8 821the C<=>. The use of C<:=> to mean C<: => was deprecated in 5.12.0, and is
d15cad80 822now a syntax error. This allows future use of C<:=> as a new token.
5076a392 823
d15cad80
TC
824Outside the core's tests for it, we find no Perl 5 code on CPAN
825using this construction, so we believe that this change will have
826very little impact on real-world codebases.
5076a392
FC
827
828If it is absolutely necessary to have empty attribute lists (for example,
d15cad80 829because of a code generator), simply avoid the error by adding a space before
5076a392
FC
830the C<=>.
831
d1ef1aa8
FC
832=head3 Change in the parsing of identifiers
833
834Characters outside the Unicode "XIDStart" set are no longer allowed at the
ac245c6a
KW
835beginning of an identifier. This means that certain accents and marks
836that normally follow an alphabetic character may no longer be the first
837character of an identifier.
d1ef1aa8 838
61752d82 839=head2 Threads and Processes
5076a392 840
61752d82 841=head3 Directory handles not copied to threads
5076a392 842
61752d82
FC
843On systems other than Windows that do not have
844a C<fchdir> function, newly-created threads no
179813a8 845longer inherit directory handles from their parent threads. Such programs
61752d82 846would usually have crashed anyway [perl #75154].
5076a392 847
61752d82 848=head3 C<close> on shared pipes
5076a392 849
d15cad80
TC
850To avoid deadlocks, the C<close> function no longer waits for the
851child process to exit if the underlying file descriptor is still
852in use by another thread. It returns true in such cases.
5076a392 853
144b6ea2
FC
854=head3 fork() emulation will not wait for signalled children
855
856On Windows parent processes would not terminate until all forked
7d7b9667 857children had terminated first. However, C<kill("KILL", ...)> is
d15cad80 858inherently unstable on pseudo-processes, and C<kill("TERM", ...)>
179813a8 859might not get delivered if the child is blocked in a system call.
144b6ea2
FC
860
861To avoid the deadlock and still provide a safe mechanism to terminate
d15cad80 862the hosting process, Perl now no longer waits for children that
144b6ea2 863have been sent a SIGTERM signal. It is up to the parent process to
d15cad80
TC
864waitpid() for these children if child-cleanup processing must be
865allowed to finish. However, it is also then the responsibility of the
866parent to avoid the deadlock by making sure the child process
867can't be blocked on I/O.
144b6ea2
FC
868
869See L<perlfork> for more information about the fork() emulation on
870Windows.
871
61752d82 872=head2 Configuration
5076a392 873
61752d82 874=head3 Naming fixes in Policy_sh.SH may invalidate Policy.sh
5076a392 875
d15cad80
TC
876Several long-standing typos and naming confusions in F<Policy_sh.SH> have
877been fixed, standardizing on the variable names used in F<config.sh>.
5076a392 878
d15cad80
TC
879This will change the behaviour of F<Policy.sh> if you happen to have been
880accidentally relying on its incorrect behaviour.
f318e2e6 881
5a1f7719
FC
882=head3 Perl source code is read in text mode on Windows
883
884Perl scripts used to be read in binary mode on Windows for the benefit
f8992784 885of the L<ByteLoader> module (which is no longer part of core Perl). This
d15cad80
TC
886had the side-effect of breaking various operations on the C<DATA> filehandle,
887including seek()/tell(), and even simply reading from C<DATA> after filehandles
5a1f7719
FC
888have been flushed by a call to system(), backticks, fork() etc.
889
890The default build options for Windows have been changed to read Perl source
f8992784 891code on Windows in text mode now. L<ByteLoader> will (hopefully) be updated on
5a1f7719
FC
892CPAN to automatically handle this situation [perl #28106].
893
5076a392
FC
894=head1 Deprecations
895
1e463951
FC
896See also L</Deprecated C APIs>.
897
5076a392
FC
898=head2 Omitting a space between a regular expression and subsequent word
899
d15cad80 900Omitting the space between a regular expression operator or
18139a1b 901its modifiers and the following word is deprecated. For
d15cad80
TC
902example, C<< m/foo/sand $bar >> is for now still parsed
903as C<< m/foo/s and $bar >>, but will now issue a warning.
5076a392 904
e683df94
KW
905=head2 C<\cI<X>>
906
907The backslash-c construct was designed as a way of specifying
908non-printable characters, but there were no restrictions (on ASCII
909platforms) on what the character following the C<c> could be. Now,
910a deprecation warning is raised if that character isn't an ASCII character.
911Also, a deprecation warning is raised for C<"\c{"> (which is the same
912as simply saying C<";">).
913
4528361d
KW
914=head2 C<"\b{"> and C<"\B{">
915
916In regular expressions, a literal C<"{"> immediately following a C<"\b">
917(not in a bracketed character class) or a C<"\B{"> is now deprecated
918to allow for its future use by Perl itself.
919
1c7f7822 920=head2 Deprecation warning added for deprecated-in-core Perl 4-era .pl libraries
5076a392
FC
921
922This is a mandatory warning, not obeying -X or lexical warning bits.
923The warning is modelled on that supplied by deprecate.pm for
924deprecated-in-core .pm libraries. It points to the specific CPAN
1c7f7822
JV
925distribution that contains the .pl libraries. The CPAN versions, of
926course, do not generate the warning.
5076a392
FC
927
928=head2 List assignment to C<$[>
929
823d0e46 930Assignment to C<$[> was deprecated and started to give warnings in
d15cad80
TC
931Perl version 5.12.0. This version of Perl (5.14) now also emits a warning
932when assigning to C<$[> in list context. This fixes an oversight in 5.12.0.
5076a392
FC
933
934=head2 Use of qw(...) as parentheses
935
936Historically the parser fooled itself into thinking that C<qw(...)> literals
937were always enclosed in parentheses, and as a result you could sometimes omit
938parentheses around them:
939
940 for $x qw(a b c) { ... }
941
942The parser no longer lies to itself in this way. Wrap the list literal in
d15cad80 943parentheses like this:
5076a392
FC
944
945 for $x (qw(a b c)) { ... }
946
038c245e 947This is being deprecated because C<qw(a b c)> is supposed to mean
d15cad80 948C<"a", "b", "c"> not C<("a", "b", "c")>. In other words, this doesn't compile:
038c245e
AB
949
950 for my $i "a", "b", "c" { }
951
952So neither should this:
953
954 for my $i qw(a b c) {}
955
956But these both work:
957
958 for my $i ("a", "b", "c") { }
959 for my $i (qw(a b c)) {}
960
d15cad80 961Note that this does not change the behaviour of cases like:
038c245e
AB
962
963 use POSIX qw(setlocale localeconv)
964 our @EXPORT = qw(foo bar baz);
965
b6cc6faa 966Where a list with or without parentheses could have been provided.
038c245e 967
1c7f7822 968=head2 C<\N{BELL}>
5076a392
FC
969
970This is because Unicode is using that name for a different character.
971See L</Unicode Version 6.0 is now supported (mostly)> for more
972explanation.
973
1c7f7822 974=head2 C<?PATTERN?>
5076a392
FC
975
976C<?PATTERN?> (without the initial m) has been deprecated and now produces
977a warning. This is to allow future use of C<?> in new operators.
978The match-once functionality is still available in the form of C<m?PATTERN?>.
979
5076a392
FC
980=head2 Tie functions on scalars holding typeglobs
981
982Calling a tie function (C<tie>, C<tied>, C<untie>) with a scalar argument
f8992784 983acts on a filehandle if the scalar happens to hold a typeglob.
5076a392
FC
984
985This is a long-standing bug that will be removed in Perl 5.16, as
986there is currently no way to tie the scalar itself when it holds
987a typeglob, and no way to untie a scalar that has had a typeglob
988assigned to it.
989
823d0e46 990Now there is a deprecation warning whenever a tie
5076a392
FC
991function is used on a handle without an explicit C<*>.
992
18139a1b 993=head2 User-defined case-mapping
5076a392 994
18139a1b
FC
995This feature is being deprecated due to its many issues, as documented in
996L<perlunicode/User-Defined Case Mappings (for serious hackers only)>.
1c7f7822 997This feature will be removed in Perl 5.16. Instead use the CPAN module
e48f36f0 998L<Unicode::Casing>, which provides improved functionality.
823d0e46 999
18139a1b 1000=head2 Deprecated modules
5076a392
FC
1001
1002The following modules will be removed from the core distribution in a
40bd7639 1003future release, and should be installed from CPAN instead. Distributions
a60ea503 1004on CPAN which require these should add them to their prerequisites. The
d15cad80 1005core versions of these modules now issue a deprecation warning.
5076a392
FC
1006
1007If you ship a packaged version of Perl, either alone or as part of a
1008larger system, then you should carefully consider the repercussions of
823d0e46 1009core module deprecations. You may want to consider shipping your default
5076a392 1010build of Perl with packages for some or all deprecated modules which
d15cad80 1011install into C<vendor> or C<site> Perl library directories. This will
5076a392
FC
1012inhibit the deprecation warnings.
1013
1014Alternatively, you may want to consider patching F<lib/deprecate.pm>
1015to provide deprecation warnings specific to your packaging system
1016or distribution of Perl, consistent with how your packaging system
1017or distribution manages a staged transition from a release where the
1018installation of a single package provides the given functionality, to
1019a later release where the system administrator needs to know to install
1020multiple packages to get that same functionality.
1021
1022You can silence these deprecation warnings by installing the modules
1023in question from CPAN. To install the latest version of all of them,
1024just install C<Task::Deprecations::5_14>.
1025
1026=over
1027
1028=item L<Devel::DProf>
1029
d15cad80
TC
1030We strongly recommend that you install and use L<Devel::NYTProf> instead
1031of L<Devel::Dprof>, as L<Devel::NYTProf> offers significantly
1032improved profiling and reporting.
5076a392
FC
1033
1034=back
1035
5076a392
FC
1036=head1 Performance Enhancements
1037
54c7bb16 1038=head2 "Safe signals" optimisation
df91d470 1039
d15cad80
TC
1040Signal dispatch has been moved from the runloop into control ops.
1041This should give a few percent speed increase, and eliminates nearly
1042all the speed penalty caused by the introduction of "safe signals"
1043in 5.8.0. Signals should still be dispatched within the same
1044statement as they were previously. If this does I<not> happen, or
1045if you find it possible to create uninterruptible loops, this is a
1046bug, and reports are encouraged of how to recreate such issues.
df91d470 1047
d15cad80 1048=head2 Optimisation of shift() and pop() calls without arguments
df91d470 1049
d15cad80
TC
1050Two fewer OPs are used for shift() and pop() calls with no argument (with
1051implicit C<@_>). This change makes shift() 5% faster than C<shift @_>
1052on non-threaded perls, and 25% faster on threaded ones.
df91d470 1053
fa232254 1054=head2 Optimisation of regexp engine string comparison work
df91d470 1055
d15cad80 1056The C<foldEQ_utf8> API function for case-insensitive comparison of strings (which
fa232254 1057is used heavily by the regexp engine) was substantially refactored and
d15cad80 1058optimised -- and its documentation much improved as a free bonus.
df91d470 1059
fa232254 1060=head2 Regular expression compilation speed-up
df91d470 1061
d15cad80
TC
1062Compiling regular expressions has been made faster when upgrading
1063the regex to utf8 is necessary but this isn't known when the compilation begins.
df91d470 1064
fa232254 1065=head2 String appending is 100 times faster
df91d470 1066
1c7f7822
JV
1067When doing a lot of string appending, perls built to use the system's
1068C<malloc> could end up allocating a lot more memory than needed in a
1069very inefficient way.
fa232254 1070
1c7f7822 1071C<sv_grow>, the function used to allocate more memory if necessary
d15cad80 1072when appending to a string, has been taught to round up the memory
fa232254
FC
1073it requests to a certain geometric progression, making it much faster on
1074certain platforms and configurations. On Win32, it's now about 100 times
1075faster.
1076
1077=head2 Eliminate C<PL_*> accessor functions under ithreads
1078
1079When C<MULTIPLICITY> was first developed, and interpreter state moved into
d15cad80
TC
1080an interpreter struct, thread- and interpreter-local C<PL_*> variables
1081were defined as macros that called accessor functions (returning the
1082address of the value) outside the Perl core. The intent was to allow
1c7f7822
JV
1083members within the interpreter struct to change size without breaking
1084binary compatibility, so that bug fixes could be merged to a maintenance
1085branch that necessitated such a size change. This mechanism was redundant
40bd7639 1086and penalised well-behaved code. It has been removed.
fa232254
FC
1087
1088=head2 Freeing weak references
1089
1c7f7822 1090When there are many weak references to an object, freeing that object
d15cad80
TC
1091can under some some circumstances take O(I<NE<0xB2>>) time to free, where
1092I<N> is the number of references. The circumstances in which this can happen
1093have been reduced [perl #75254]
fa232254
FC
1094
1095=head2 Lexical array and hash assignments
1096
1097An earlier optimisation to speed up C<my @array = ...> and
1098C<my %hash = ...> assignments caused a bug and was disabled in Perl 5.12.0.
1099
1100Now we have found another way to speed up these assignments [perl #82110].
df91d470 1101
111b6aa7 1102=head2 C<@_> uses less memory
df91d470 1103
111b6aa7
FC
1104Previously, C<@_> was allocated for every subroutine at compile time with
1105enough space for four entries. Now this allocation is done on demand when
1106the subroutine is called [perl #72416].
5076a392 1107
5076a392
FC
1108=head2 Size optimisations to SV and HV structures
1109
d15cad80
TC
1110C<xhv_fill> has been eliminated from C<struct xpvhv>, saving 1 IV per hash and
1111on some systems will cause C<struct xpvhv> to become cache-aligned. To avoid
1112this memory saving causing a slowdown elsewhere, boolean use of C<HvFILL>
1113now calls C<HvTOTALKEYS> instead (which is equivalent), so while the fill
111b6aa7 1114data when actually required are now calculated on demand, the cases when
d15cad80 1115this needs to be done should be rare.
5076a392 1116
111b6aa7
FC
1117The order of structure elements in SV bodies has changed. Effectively,
1118the NV slot has swapped location with STASH and MAGIC. As all access to
1119SV members is via macros, this should be completely transparent. This
5076a392
FC
1120change allows the space saving for PVHVs documented above, and may reduce
1121the memory allocation needed for PVIVs on some architectures.
1122
d15cad80 1123C<XPV>, C<XPVIV>, and C<XPVNV> now allocate only the parts of the C<SV> body
fa232254 1124they actually use, saving some space.
5076a392 1125
d15cad80 1126Scalars containing regular expressions now allocate only the part of the C<SV>
fa232254 1127body they actually use, saving some space.
5076a392
FC
1128
1129=head2 Memory consumption improvements to Exporter
1130
1131The @EXPORT_FAIL AV is no longer created unless required, hence neither is
111b6aa7
FC
1132the typeglob backing it. This saves about 200 bytes for every package that
1133uses Exporter but doesn't use this functionality.
5076a392 1134
111b6aa7 1135=head2 Memory savings for weak references
5076a392 1136
1c7f7822
JV
1137For weak references, the common case of just a single weak reference
1138per referent has been optimised to reduce the storage required. In this
1139case it saves the equivalent of one small Perl array per referent.
5076a392 1140
111b6aa7 1141=head2 C<%+> and C<%-> use less memory
5076a392 1142
d15cad80
TC
1143The bulk of the C<Tie::Hash::NamedCapture> module used to be in the Perl
1144core. It has now been moved to an XS module to reduce overhead for
5076a392
FC
1145programs that do not use C<%+> or C<%->.
1146
fa232254 1147=head2 Multiple small improvements to threads
5076a392 1148
fa232254
FC
1149The internal structures of threading now make fewer API calls and fewer
1150allocations, resulting in noticeably smaller object code. Additionally,
d15cad80 1151many thread context checks have been deferred so they're done only
fa232254 1152when required (although this is only possible for non-debugging builds).
5076a392 1153
fa232254 1154=head2 Adjacent pairs of nextstate opcodes are now optimized away
5076a392 1155
fa232254 1156Previously, in code such as
5076a392 1157
fa232254 1158 use constant DEBUG => 0;
5076a392 1159
fa232254
FC
1160 sub GAK {
1161 warn if DEBUG;
1162 print "stuff\n";
1163 }
5076a392 1164
d15cad80 1165the ops for C<warn if DEBUG> would be folded to a C<null> op (C<ex-const>), but
fa232254 1166the C<nextstate> op would remain, resulting in a runtime op dispatch of
d15cad80 1167C<nextstate>, C<nextstate>, etc.
5076a392 1168
fa232254
FC
1169The execution of a sequence of C<nextstate> ops is indistinguishable from just
1170the last C<nextstate> op so the peephole optimizer now eliminates the first of
d15cad80
TC
1171a pair of C<nextstate> ops except when the first carries a label, since labels
1172must not be eliminated by the optimizer, and label usage isn't conclusively known
fa232254 1173at compile time.
5076a392
FC
1174
1175=head1 Modules and Pragmata
1176
1177=head2 New Modules and Pragmata
1178
1179=over 4
1180
1181=item *
1182
d15cad80
TC
1183L<CPAN::Meta::YAML> 0.003 has been added as a dual-life module. It supports a
1184subset of YAML sufficient for reading and writing F<META.yml> and F<MYMETA.yml> files
5076a392 1185included with CPAN distributions or generated by the module installation
a60ea503 1186toolchain. It should not be used for any other general YAML parsing or
5076a392
FC
1187generation task.
1188
1189=item *
1190
d15cad80 1191L<CPAN::Meta> version 2.110440 has been added as a dual-life module. It
5076a392 1192provides a standard library to read, interpret and write CPAN distribution
d15cad80 1193metadata files (like F<META.json> and F<META.yml)> which describes a
5076a392 1194distribution, its contents, and the requirements for building it and
a60ea503 1195installing it. The latest CPAN distribution metadata specification is
d15cad80
TC
1196included as L<CPAN::Meta::Spec> and notes on changes in the specification
1197over time are given in L<CPAN::Meta::History>.
5076a392
FC
1198
1199=item *
1200
d15cad80 1201L<HTTP::Tiny> 0.012 has been added as a dual-life module. It is a very
5076a392 1202small, simple HTTP/1.1 client designed for simple GET requests and file
d15cad80 1203mirroring. It has has been added to enable F<CPAN.pm> and L<CPANPLUS> to
5076a392 1204"bootstrap" HTTP access to CPAN using pure Perl without relying on external
d15cad80 1205binaries like L<curl(1)> or L<wget(1)>.
5076a392
FC
1206
1207=item *
1208
d15cad80 1209L<JSON::PP> 2.27105 has been added as a dual-life module to allow CPAN
1c7f7822 1210clients to read F<META.json> files in CPAN distributions.
5076a392
FC
1211
1212=item *
1213
d15cad80 1214L<Module::Metadata> 1.000004 has been added as a dual-life module. It gathers
5076a392 1215package and POD information from Perl module files. It is a standalone module
d15cad80
TC
1216based on L<Module::Build::ModuleInfo> for use by other module installation
1217toolchain components. L<Module::Build::ModuleInfo> has been deprecated in
5076a392
FC
1218favor of this module instead.
1219
1220=item *
1221
d15cad80
TC
1222L<Perl::OSType> 1.002 has been added as a dual-life module. It maps Perl
1223operating system names (like "dragonfly" or "MSWin32") to more generic types
1224with standardized names (like "Unix" or "Windows"). It has been refactored
1225out of L<Module::Build> and L<ExtUtils::CBuilder> and consolidates such mappings into
5076a392
FC
1226a single location for easier maintenance.
1227
1228=item *
1229
d15cad80 1230The following modules were added by the L<Unicode::Collate>
a60ea503 1231upgrade. See below for details.
5076a392 1232
d15cad80 1233L<Unicode::Collate::CJK::Big5>
5076a392 1234
d15cad80 1235L<Unicode::Collate::CJK::GB2312>
5076a392 1236
d15cad80 1237L<Unicode::Collate::CJK::JISX0208>
5076a392 1238
d15cad80 1239L<Unicode::Collate::CJK::Korean>
5076a392 1240
d15cad80 1241L<Unicode::Collate::CJK::Pinyin>
5076a392 1242
d15cad80 1243L<Unicode::Collate::CJK::Stroke>
5076a392
FC
1244
1245=item *
1246
d15cad80 1247L<Version::Requirements> version 0.101020 has been added as a dual-life
5076a392 1248module. It provides a standard library to model and manipulates module
d15cad80 1249prerequisites and version constraints defined in L<CPAN::Meta::Spec>.
5076a392
FC
1250
1251=back
1252
a5794e94 1253=head2 Updated Modules and Pragma
5076a392
FC
1254
1255=over 4
1256
1257=item *
1258
d15cad80 1259L<attributes> has been upgraded from version 0.12 to 0.14.
81a53be2
FR
1260
1261=item *
1262
d15cad80 1263L<Archive::Extract> has been upgraded from version 0.38 to 0.48.
5076a392
FC
1264
1265Updates since 0.38 include: a safe print method that guards
d15cad80
TC
1266L<Archive::Extract> from changes to C<$\>; a fix to the tests when run in core
1267Perl; support for TZ files; a modification for the lzma
1268logic to favour L<IO::Uncompress::Unlzma>; and a fix
1269for an issue with NetBSD-current and its new L<unzip(1)>
5076a392
FC
1270executable.
1271
1272=item *
1273
d15cad80 1274L<Archive::Tar> has been upgraded from version 1.54 to 1.76.
5076a392 1275
1984204c
FC
1276Important changes since 1.54 include the following:
1277
1278=over
1279
1280=item *
1281
d15cad80 1282Compatibility with busybox implementations of L<tar(1)>.
1984204c
FC
1283
1284=item *
1285
d15cad80
TC
1286A fix so that write() and create_archive()
1287close only filehandles they themselves opened.
1984204c
FC
1288
1289=item *
1290
1291A bug was fixed regarding the exit code of extract_archive.
5076a392 1292
1984204c
FC
1293=item *
1294
d15cad80
TC
1295The L<ptar(1)> utility has a new option to allow safe creation of
1296tarballs without world-writable files on Windows, allowing those
5076a392
FC
1297archives to be uploaded to CPAN.
1298
1984204c
FC
1299=item *
1300
d15cad80 1301A new L<ptargrep(1)> utility for using regular expressions against
5076a392
FC
1302the contents of files in a tar archive.
1303
1984204c
FC
1304=item *
1305
d15cad80 1306L<pax> extended headers are now skipped.
1984204c
FC
1307
1308=back
5076a392
FC
1309
1310=item *
1311
d15cad80 1312L<Attribute::Handlers> has been upgraded from version 0.87 to 0.89.
fcd5df6d
FR
1313
1314=item *
1315
d15cad80 1316L<autodie> has been upgraded from version 2.06_01 to 2.1001.
3f5a47e4
FR
1317
1318=item *
1319
d15cad80 1320L<AutoLoader> has been upgraded from version 5.70 to 5.71.
578e7c9d
FR
1321
1322=item *
1323
d15cad80 1324The L<B> module has been upgraded from version 1.23 to 1.29.
5076a392
FC
1325
1326It no longer crashes when taking apart a C<y///> containing characters
1327outside the octet range or compiled in a C<use utf8> scope.
1328
1329The size of the shared object has been reduced by about 40%, with no
1330reduction in functionality.
1331
1332=item *
1333
d15cad80 1334L<B::Concise> has been upgraded from version 0.78 to 0.83.
5076a392 1335
d15cad80
TC
1336L<B::Concise> marks rv2sv(), rv2av(), and rv2hv() ops with the new
1337C<OPpDEREF> flag as "DREFed".
5076a392 1338
d15cad80 1339It no longer produces mangled output with the B<-tree> option
5076a392
FC
1340[perl #80632].
1341
1342=item *
1343
d15cad80 1344L<B::Debug> has been upgraded from version 1.12 to 1.16.
6bb8c1e3
FR
1345
1346=item *
1347
d15cad80 1348L<B::Deparse> has been upgraded from version 0.96 to 1.03.
5076a392 1349
d15cad80
TC
1350The deparsing of a C<nextstate> op has changed when it has both a
1351change of package relative to the previous nextstate, or a change of
1352C<%^H> or other state and a label. The label was previously emitted
1353first, but is now emitted last (5.12.1).
5076a392 1354
d15cad80 1355The C<no 5.13.2> or similar form is now correctly handled by L<B::Deparse>
5a553547 1356(5.12.3).
5076a392 1357
d15cad80 1358L<B::Deparse> now properly handles the code that applies a conditional
5076a392
FC
1359pattern match against implicit C<$_> as it was fixed in [perl #20444].
1360
1984204c 1361Deparsing of C<our> followed by a variable with funny characters
d15cad80 1362(as permitted under the C<use utf8> pragma) has also been fixed [perl #33752].
5076a392
FC
1363
1364=item *
1365
d15cad80 1366L<B::Lint> has been upgraded from version 1.11_01 to 1.13.
d97c5d3b
FR
1367
1368=item *
1369
d15cad80 1370L<base> has been upgraded from version 2.15 to 2.16.
5aef2c44
FR
1371
1372=item *
1373
d15cad80 1374L<Benchmark> has been upgraded from version 1.11 to 1.12.
876607aa
FR
1375
1376=item *
1377
d15cad80 1378L<bignum> has been upgraded from version 0.23 to 0.27.
e539ae69
FR
1379
1380=item *
1381
d15cad80 1382L<Carp> has been upgraded from version 1.15 to 1.20.
5076a392 1383
d15cad80
TC
1384L<Carp> now detects incomplete L<caller()|perlfunc/"caller EXPR">
1385overrides and avoids using bogus C<@DB::args>. To provide backtraces,
1386Carp relies on particular behaviour of the caller() builtin.
1387L<Carp> now detects if other code has overridden this with an
1388incomplete implementation, and modifies its backtrace accordingly.
1389Previously incomplete overrides would cause incorrect values in
1390backtraces (best case), or obscure fatal errors (worst case).
5076a392 1391
d15cad80
TC
1392This fixes certain cases of "Bizarre copy of ARRAY" caused by modules
1393overriding caller() incorrectly (5.12.2).
5076a392 1394
d15cad80
TC
1395It now also avoids using regular expressions that cause Perl to
1396load its Unicode tables, in order to avoid the "BEGIN not safe after
1397errors" error that will ensue if there has been a syntax error
5076a392
FC
1398[perl #82854].
1399
1400=item *
1401
d15cad80 1402L<CGI> has been upgraded from version 3.48 to 3.52.
5076a392
FC
1403
1404This provides the following security fixes: the MIME boundary in
d15cad80 1405multipart_init() is now random and the handling of
1984204c 1406newlines embedded in header values has been improved.
5076a392
FC
1407
1408=item *
1409
d15cad80 1410L<Compress::Raw::Bzip2> has been upgraded from version 2.024 to 2.033.
5076a392 1411
f8992784 1412It has been updated to use L<bzip2(1)> 1.0.6.
5076a392
FC
1413
1414=item *
1415
d15cad80 1416L<Compress::Raw::Zlib> has been upgraded from version 2.024 to 2.033.
51090521
FR
1417
1418=item *
1419
d15cad80 1420L<constant> has been upgraded from version 1.20 to 1.21.
87c7b53d 1421
d15cad80 1422Unicode constants work once more. They have been broken since Perl 5.10.0
87c7b53d
FC
1423[CPAN RT #67525].
1424
1425=item *
1426
d15cad80 1427L<CPAN> has been upgraded from version 1.94_56 to 1.9600.
1984204c
FC
1428
1429Major highlights:
5076a392
FC
1430
1431=over 4
1432
1984204c 1433=item * much less configuration dialog hassle
5076a392 1434
d15cad80 1435=item * support for F<META/MYMETA.json>
5076a392 1436
d15cad80 1437=item * support for L<local::lib>
5076a392 1438
d15cad80 1439=item * support for L<HTTP::Tiny> to reduce the dependency on FTP sites
5076a392 1440
1984204c 1441=item * automatic mirror selection
5076a392 1442
1984204c 1443=item * iron out all known bugs in configure_requires
5076a392 1444
f8992784 1445=item * support for distributions compressed with L<bzip2(1)>
1984204c 1446
d15cad80 1447=item * allow F<Foo/Bar.pm> on the command line to mean C<Foo::Bar>
1984204c
FC
1448
1449=back
5076a392
FC
1450
1451=item *
1452
d15cad80 1453L<CPANPLUS> has been upgraded from version 0.90 to 0.9103.
d430b8e7
FC
1454
1455A change to F<cpanp-run-perl>
1456resolves L<RT #55964|http://rt.cpan.org/Public/Bug/Display.html?id=55964>
1457and L<RT #57106|http://rt.cpan.org/Public/Bug/Display.html?id=57106>, both
1458of which related to failures to install distributions that use
1459C<Module::Install::DSL> (5.12.2).
5076a392 1460
d15cad80 1461A dependency on L<Config> was not recognised as a
1984204c 1462core module dependency. This has been fixed.
5076a392 1463
d15cad80 1464L<CPANPLUS> now includes support for F<META.json> and F<MYMETA.json>.
5076a392
FC
1465
1466=item *
1467
d15cad80 1468L<CPANPLUS::Dist::Build> has been upgraded from version 0.46 to 0.54.
4467e8f7
FR
1469
1470=item *
1471
d15cad80 1472L<Data::Dumper> has been upgraded from version 2.125 to 2.130_02.
5076a392 1473
40bd7639 1474The indentation used to be off when C<$Data::Dumper::Terse> was set. This
4ed2cea4
FC
1475has been fixed [perl #73604].
1476
1984204c
FC
1477This upgrade also fixes a crash when using custom sort functions that might
1478cause the stack to change [perl #74170].
5076a392 1479
d15cad80 1480L<Dumpxs> no longer crashes with globs returned by C<*$io_ref>
5076a392
FC
1481[perl #72332].
1482
1483=item *
1484
d15cad80 1485L<DB_File> has been upgraded from version 1.820 to 1.821.
549d34f5
FR
1486
1487=item *
1488
d15cad80 1489L<DBM_Filter> has been upgraded from version 0.03 to 0.04.
851dbda2
FR
1490
1491=item *
1492
d15cad80 1493L<Devel::DProf> has been upgraded from version 20080331.00 to 20110228.00.
5076a392 1494
d15cad80
TC
1495Merely loading L<Devel::DProf> now no longer triggers profiling to start.
1496Both C<use Devel::DProf> and C<perl -d:DProf ...> behave as before and start
5076a392
FC
1497the profiler.
1498
d15cad80 1499B<NOTE>: L<Devel::DProf> is deprecated and will be removed from a future
1984204c 1500version of Perl. We strongly recommend that you install and use
5076a392
FC
1501L<Devel::NYTProf> instead, as it offers significantly improved
1502profiling and reporting.
1503
1504=item *
1505
d15cad80 1506L<Devel::Peek> has been upgraded from version 1.04 to 1.07.
868625d2
FR
1507
1508=item *
1509
d15cad80 1510L<Devel::SelfStubber> has been upgraded from version 1.03 to 1.05.
66899ca3
FR
1511
1512=item *
1513
d15cad80 1514L<diagnostics> has been upgraded from version 1.19 to 1.22.
5076a392
FC
1515
1516It now renders pod links slightly better, and has been taught to find
1517descriptions for messages that share their descriptions with other
1518messages.
1519
1520=item *
1521
d15cad80 1522L<Digest::MD5> has been upgraded from version 2.39 to 2.51.
5076a392
FC
1523
1524It is now safe to use this module in combination with threads.
1525
1526=item *
1527
d15cad80 1528L<Digest::SHA> has been upgraded from version 5.47 to 5.61.
5076a392 1529
f8992784 1530L<shasum> now more closely mimics L<sha1sum(1)>/L<md5sum(1)>.
5076a392 1531
d15cad80 1532L<Addfile> accepts all POSIX filenames.
5076a392 1533
1984204c
FC
1534New SHA-512/224 and SHA-512/256 transforms (ref. NIST Draft FIPS 180-4
1535[February 2011])
5076a392
FC
1536
1537=item *
1538
d15cad80 1539L<DirHandle> has been upgraded from version 1.03 to 1.04.
88410521
FR
1540
1541=item *
1542
d15cad80 1543L<Dumpvalue> has been upgraded from version 1.13 to 1.16.
e53cbaa3
FR
1544
1545=item *
1546
d15cad80 1547L<DynaLoader> has been upgraded from version 1.10 to 1.13.
5076a392
FC
1548
1549It fixes a buffer overflow when passed a very long file name.
1550
d15cad80 1551It no longer inherits from L<AutoLoader>; hence it no longer
5076a392 1552produces weird error messages for unsuccessful method calls on classes that
d15cad80 1553inherit from L<DynaLoader> [perl #84358].
5076a392
FC
1554
1555=item *
1556
d15cad80 1557L<Encode> has been upgraded from version 2.39 to 2.42.
5076a392
FC
1558
1559Now, all 66 Unicode non-characters are treated the same way U+FFFF has
d15cad80
TC
1560always been treated: in cases when it was disallowed, all 66 are
1561disallowed, and in cases where it warned, all 66 warn.
5076a392
FC
1562
1563=item *
1564
d15cad80 1565L<Env> has been upgraded from version 1.01 to 1.02.
68f90ac3
FR
1566
1567=item *
1568
d15cad80 1569L<Errno> has been upgraded from version 1.11 to 1.13.
5076a392 1570
d15cad80 1571The implementation of L<Errno> has been refactored to use about 55% less memory.
5076a392 1572
f8992784 1573On some platforms with unusual header files, like Win32 L<gcc(1)> using C<mingw64>
5076a392 1574headers, some constants which weren't actually error numbers have been exposed
d15cad80 1575by L<Errno>. This has been fixed [perl #77416].
5076a392
FC
1576
1577=item *
1578
d15cad80 1579L<Exporter> has been upgraded from version 5.64_01 to 5.64_03.
5076a392
FC
1580
1581Exporter no longer overrides C<$SIG{__WARN__}> [perl #74472]
1582
1583=item *
1584
d15cad80 1585L<ExtUtils::CBuilder> has been upgraded from version 0.27 to 0.280203.
25fe7f8f
FR
1586
1587=item *
1588
d15cad80 1589L<ExtUtils::Command> has been upgraded from version 1.16 to 1.17.
2292e71e
FR
1590
1591=item *
1592
d15cad80 1593L<ExtUtils::Constant> has been upgraded from 0.22 to 0.23.
5076a392 1594
d15cad80
TC
1595The L<AUTOLOAD> helper code generated by C<ExtUtils::Constant::ProxySubs>
1596can now croak() for missing constants, or generate a complete C<AUTOLOAD>
1984204c 1597subroutine in XS, allowing simplification of many modules that use it
d15cad80
TC
1598(L<Fcntl>, L<File::Glob>, L<GDBM_File>, L<I18N::Langinfo>, L<POSIX>,
1599L<Socket>).
5076a392 1600
d15cad80 1601L<ExtUtils::Constant::ProxySubs> can now optionally push the names of all
1984204c 1602constants onto the package's C<@EXPORT_OK>.
5076a392
FC
1603
1604=item *
1605
d15cad80 1606L<ExtUtils::Install> has been upgraded from version 1.55 to 1.56.
588c5853
FR
1607
1608=item *
1609
d15cad80 1610L<ExtUtils::MakeMaker> has been upgraded from version 6.56 to 6.57_05.
5418ffb3
FR
1611
1612=item *
1613
d15cad80 1614L<ExtUtils::Manifest> has been upgraded from version 1.57 to 1.58.
f40ab45f
FR
1615
1616=item *
1617
d15cad80 1618L<ExtUtils::ParseXS> has been upgraded from version 2.21 to 2.2210.
b7064dd7
FR
1619
1620=item *
1621
d15cad80 1622L<Fcntl> has been upgraded from version 1.06 to 1.11.
26f7fa64
FR
1623
1624=item *
1625
d15cad80 1626L<File::Basename> has been upgraded from version 2.78 to 2.82.
8b87be80
FR
1627
1628=item *
1629
d15cad80 1630L<File::CheckTree> has been upgraded from version 4.4 to 4.41.
05102622
FR
1631
1632=item *
1633
d15cad80 1634L<File::Copy> has been upgraded from version 2.17 to 2.21.
65d78858
FR
1635
1636=item *
1637
d15cad80 1638L<File::DosGlob> has been upgraded from version 1.01 to 1.04.
5076a392 1639
d15cad80
TC
1640It allows patterns containing literal parentheses: they no longer need to
1641be escaped. On Windows, it no longer
1642adds an extra F<./> to file names
5076a392 1643returned when the pattern is a relative glob with a drive specification,
d15cad80 1644like F<C:*.pl> [perl #71712].
5076a392
FC
1645
1646=item *
1647
d15cad80 1648L<File::Fetch> has been upgraded from version 0.24 to 0.32.
5076a392 1649
d15cad80 1650L<HTTP::Lite> is now supported for the "http" scheme.
5076a392 1651
d15cad80 1652The L<fetch(1)> utility is supported on FreeBSD, NetBSD, and
5076a392
FC
1653Dragonfly BSD for the C<http> and C<ftp> schemes.
1654
1655=item *
1656
d15cad80 1657L<File::Find> has been upgraded from version 1.15 to 1.19.
5076a392 1658
1984204c 1659It improves handling of backslashes on Windows, so that paths like
d15cad80 1660F<C:\dir\/file> are no longer generated [perl #71710].
5076a392
FC
1661
1662=item *
1663
d15cad80 1664L<File::Glob> has been upgraded from version 1.07 to 1.12.
0ae9f678
FR
1665
1666=item *
1667
d15cad80 1668L<File::Spec> has been upgraded from version 3.31 to 3.33.
d430b8e7 1669
d15cad80 1670Several portability fixes were made in L<File::Spec::VMS>: a colon is now
d430b8e7 1671recognized as a delimiter in native filespecs; caret-escaped delimiters are
d15cad80 1672recognized for better handling of extended filespecs; catpath() returns
d430b8e7 1673an empty directory rather than the current directory if the input directory
d15cad80 1674name is empty; and abs2rel() properly handles Unix-style input (5.12.2).
d430b8e7
FC
1675
1676=item *
1677
d15cad80 1678L<File::stat> has been upgraded from 1.02 to 1.05.
5076a392 1679
d15cad80
TC
1680The C<-x> and C<-X> file test operators now work correctly when run
1681by the superuser.
5076a392
FC
1682
1683=item *
1684
d15cad80 1685L<Filter::Simple> has been upgraded from version 0.84 to 0.86.
b7edcc3c
FR
1686
1687=item *
1688
d15cad80 1689L<GDBM_File> has been upgraded from 1.10 to 1.14.
5076a392
FC
1690
1691This fixes a memory leak when DBM filters are used.
1692
1693=item *
1694
d15cad80 1695L<Hash::Util> has been upgraded from 0.07 to 0.11.
5076a392 1696
d15cad80 1697L<Hash::Util> no longer emits spurious "uninitialized" warnings when
1984204c 1698recursively locking hashes that have undefined values [perl #74280].
5076a392
FC
1699
1700=item *
1701
d15cad80 1702L<Hash::Util::FieldHash> has been upgraded from version 1.04 to 1.09.
89ce9b34
FR
1703
1704=item *
1705
d15cad80 1706L<I18N::Collate> has been upgraded from version 1.01 to 1.02.
eec33fe6
FR
1707
1708=item *
1709
d15cad80 1710L<I18N::Langinfo> has been upgraded from version 0.03 to 0.08.
5076a392 1711
d15cad80 1712langinfo() now defaults to using C<$_> if there is no argument given, just
5334145a 1713as the documentation has always claimed.
5076a392
FC
1714
1715=item *
1716
d15cad80 1717L<I18N::LangTags> has been upgraded from version 0.35 to 0.35_01.
c41635f7
FR
1718
1719=item *
1720
d15cad80 1721L<if> has been upgraded from version 0.05 to 0.0601.
98a6a4ff
FR
1722
1723=item *
1724
d15cad80 1725L<IO> has been upgraded from version 1.25_02 to 1.25_04.
f6ff7fb6 1726
d15cad80
TC
1727This version of L<IO> includes a new L<IO::Select>, which now allows L<IO::Handle>
1728objects (and objects in derived classes) to be removed from an L<IO::Select> set
582bf58c 1729even if the underlying file descriptor is closed or invalid.
5076a392
FC
1730
1731=item *
1732
d15cad80 1733L<IPC::Cmd> has been upgraded from version 0.54 to 0.70.
5076a392 1734
1984204c
FC
1735Resolves an issue with splitting Win32 command lines. An argument
1736consisting of the single character "0" used to be omitted (CPAN RT #62961).
5076a392
FC
1737
1738=item *
1739
d15cad80 1740L<IPC::Open3> has been upgraded from 1.05 to 1.09.
5076a392 1741
d15cad80 1742open3() now produces an error if the C<exec> call fails, allowing this
4ed2cea4
FC
1743condition to be distinguished from a child process that exited with a
1744non-zero status [perl #72016].
1745
d15cad80
TC
1746The internal xclose() routine now knows how to handle file descriptors as
1747documented, so duplicating C<STDIN> in a child process using its file
5076a392
FC
1748descriptor now works [perl #76474].
1749
1750=item *
1751
d15cad80 1752L<IPC::SysV> has been upgraded from version 2.01 to 2.03.
c8b41807
FR
1753
1754=item *
1755
d15cad80 1756L<lib> has been upgraded from version 0.62 to 0.63.
ef79f038
FR
1757
1758=item *
1759
d15cad80 1760L<Locale::Maketext> has been upgraded from version 1.14 to 1.19.
5076a392 1761
d15cad80 1762L<Locale::Maketext> now supports external caches.
5076a392 1763
1984204c
FC
1764This upgrade also fixes an infinite loop in
1765C<Locale::Maketext::Guts::_compile()> when
5076a392
FC
1766working with tainted values (CPAN RT #40727).
1767
d15cad80 1768C<< ->maketext >> calls now back up and restore C<$@> so error
5076a392
FC
1769messages are not suppressed (CPAN RT #34182).
1770
1771=item *
1772
d15cad80 1773L<Log::Message> has been upgraded from version 0.02 to 0.04.
3811bd2b
FR
1774
1775=item *
1776
d15cad80 1777L<Log::Message::Simple> has been upgraded from version 0.06 to 0.08.
8eb65377
FR
1778
1779=item *
1780
d15cad80 1781L<Math::BigInt> has been upgraded from version 1.89_01 to 1.994.
5076a392
FC
1782
1783This fixes, among other things, incorrect results when computing binomial
1784coefficients [perl #77640].
1785
d15cad80 1786It also prevents C<sqrt($int)> from crashing under C<use bigrat>.
5076a392
FC
1787[perl #73534].
1788
1789=item *
1790
d15cad80 1791L<Math::BigInt::FastCalc> has been upgraded from version 0.19 to 0.28.
846c1cec
FR
1792
1793=item *
1794
d15cad80 1795L<Math::BigRat> has been upgraded from version 0.24 to 0.26_02.
fce4aef3
FR
1796
1797=item *
1798
d15cad80 1799L<Memoize> has been upgraded from version 1.01_03 to 1.02.
12e26027
FR
1800
1801=item *
1802
d15cad80 1803L<MIME::Base64> has been upgraded from 3.08 to 3.13.
5076a392
FC
1804
1805Includes new functions to calculate the length of encoded and decoded
1806base64 strings.
1807
d15cad80 1808Now provides encode_base64url() and decode_base64url() functions to process
5076a392
FC
1809the base64 scheme for "URL applications".
1810
1811=item *
1812
d15cad80 1813L<Module::Build> has been upgraded from version 0.3603 to 0.3800.
5076a392
FC
1814
1815A notable change is the deprecation of several modules.
d15cad80
TC
1816L<Module::Build::Version> has been deprecated and L<Module::Build> now relies
1817directly upon L<version>. L<Module::Build::ModuleInfo> has been deprecated in
5076a392 1818favor of a standalone copy of it called L<Module::Metadata>.
d15cad80 1819L<Module::Build::YAML> has been deprecated in favor of L<CPAN::Meta::YAML>.
5076a392 1820
7d7b9667 1821L<Module::Build> now also generates F<META.json> and F<MYMETA.json> files
5076a392 1822in accordance with version 2 of the CPAN distribution metadata specification,
d15cad80
TC
1823L<CPAN::Meta::Spec>. The older format F<META.yml> and F<MYMETA.yml> files are
1824still generated.
5076a392
FC
1825
1826=item *
1827
d15cad80 1828L<Module::CoreList> has been upgraded from version 2.29 to 2.47.
5076a392
FC
1829
1830Besides listing the updated core modules of this release, it also stops listing
f8992784 1831the C<Filespec> module. That module never existed in core. The scripts
d15cad80
TC
1832generating L<Module::CoreList> confused it with L<VMS::Filespec>, which actually
1833is a core module as of Perl 5.8.7.
5076a392
FC
1834
1835=item *
1836
d15cad80 1837L<Module::Load> has been upgraded from version 0.16 to 0.18.
193af05b
FR
1838
1839=item *
1840
d15cad80 1841L<Module::Load::Conditional> has been upgraded from version 0.34 to 0.44.
5b3a054f
FR
1842
1843=item *
1844
d15cad80
TC
1845The L<mro> pragma has been upgraded from version 1.02 to 1.07.
1846
01835e3a
FR
1847
1848=item *
1849
d15cad80 1850L<NDBM_File> has been upgraded from version 1.08 to 1.12.
4f978a3b
FR
1851
1852This fixes a memory leak when DBM filters are used.
1853
1854=item *
1855
d15cad80 1856L<Net::Ping> has been upgraded from version 2.36 to 2.38.
d0aa5c91
FR
1857
1858=item *
1859
d15cad80 1860L<NEXT> has been upgraded from version 0.64 to 0.65.
d44b8a8c
FR
1861
1862=item *
1863
d15cad80 1864L<Object::Accessor> has been upgraded from version 0.36 to 0.38.
678d4fd4
FR
1865
1866=item *
1867
f8992784 1868L<ODBM_File> has been upgraded from version 1.07 to 1.10.
5076a392
FC
1869
1870This fixes a memory leak when DBM filters are used.
1871
1872=item *
1873
d15cad80 1874L<Opcode> has been upgraded from version 1.15 to 1.18.
4c69840c
FR
1875
1876=item *
1877
d15cad80 1878The L<overload> pragma has been upgraded from 1.10 to 1.13.
5076a392
FC
1879
1880C<overload::Method> can now handle subroutines that are themselves blessed
1881into overloaded classes [perl #71998].
1882
40bd7639 1883The documentation has greatly improved. See L</Documentation> below.
5076a392
FC
1884
1885=item *
1886
d15cad80 1887L<Params::Check> has been upgraded from version 0.26 to 0.28.
f84c796e
FR
1888
1889=item *
1890
d15cad80 1891The L<parent> pragma has been upgraded from version 0.223 to 0.225.
550ee92b
FR
1892
1893=item *
1894
d15cad80 1895L<Parse::CPAN::Meta> has been upgraded from version 1.40 to 1.4401.
5076a392 1896
1984204c 1897The latest Parse::CPAN::Meta can now read YAML and JSON files using
5076a392
FC
1898L<CPAN::Meta::YAML> and L<JSON::PP>, which are now part of the Perl core.
1899
1900=item *
1901
d15cad80 1902L<PerlIO::encoding> has been upgraded from version 0.12 to 0.14.
e981cf86
FR
1903
1904=item *
1905
d15cad80 1906L<PerlIO::scalar> has been upgraded from 0.07 to 0.11.
5076a392 1907
d15cad80 1908A read() after a seek() beyond the end of the string no longer thinks it
5076a392
FC
1909has data to read [perl #78716].
1910
1911=item *
1912
d15cad80 1913L<PerlIO::via> has been upgraded from version 0.09 to 0.11.
776f733b
FR
1914
1915=item *
1916
d15cad80 1917L<Pod::Html> has been upgraded from version 1.09 to 1.11.
ae9456cc
FR
1918
1919=item *
1920
d15cad80 1921L<Pod::LaTeX> has been upgraded from version 0.58 to 0.59.
be3c8498
FR
1922
1923=item *
1924
d15cad80 1925L<Pod::Perldoc> has been upgraded from version 3.15_02 to 3.15_03.
fd8a2e89
FR
1926
1927=item *
1928
d15cad80 1929L<Pod::Simple> has been upgraded from version 3.13 to 3.16.
5bcb6583
FR
1930
1931=item *
1932
d15cad80 1933L<POSIX> has been upgraded from 1.19 to 1.24.
5076a392
FC
1934
1935It now includes constants for POSIX signal constants.
1936
1937=item *
1938
d15cad80 1939The L<re> pragma has been upgraded from version 0.11 to 0.18.
5076a392 1940
d15cad80 1941The C<use re "/flags"> subpragma is new.
5076a392 1942
d15cad80 1943The regmust() function used to crash when called on a regular expression
1984204c 1944belonging to a pluggable engine. Now it croaks instead.
5076a392 1945
d15cad80 1946regmust() no longer leaks memory.
5076a392
FC
1947
1948=item *
1949
d15cad80 1950L<Safe> has been upgraded from version 2.25 to 2.29.
5076a392 1951
d15cad80
TC
1952Coderefs returned by reval() and rdo() are now wrapped via
1953wrap_code_refs() (5.12.1).
cdc10f43 1954
5076a392
FC
1955This fixes a possible infinite loop when looking for coderefs.
1956
d15cad80 1957It adds several C<version::vxs::*> routines to the default share.
5076a392
FC
1958
1959=item *
1960
d15cad80 1961L<SDBM_File> has been upgraded from version 1.06 to 1.09.
2c19fa42
FR
1962
1963=item *
1964
d15cad80 1965L<SelfLoader> has been upgraded from 1.17 to 1.18.
5076a392
FC
1966
1967It now works in taint mode [perl #72062].
1968
1969=item *
1970
d15cad80 1971The L<sigtrap> pragma has been upgraded from version 1.04 to 1.05.
5076a392
FC
1972
1973It no longer tries to modify read-only arguments when generating a
1974backtrace [perl #72340].
1975
1976=item *
1977
d15cad80 1978L<Socket> has been upgraded from version 1.87 to 1.94.
5076a392 1979
d15cad80 1980See L</Improved IPv6 support> above.
5076a392
FC
1981
1982=item *
1983
d15cad80 1984L<Storable> has been upgraded from version 2.22 to 2.27.
5076a392
FC
1985
1986Includes performance improvement for overloaded classes.
1987
5076a392 1988This adds support for serialising code references that contain UTF-8 strings
d15cad80 1989correctly. The L<Storable> minor version
1984204c 1990number changed as a result, meaning that
d15cad80 1991L<Storable> users who set C<$Storable::accept_future_minor> to a C<FALSE> value
5076a392
FC
1992will see errors (see L<Storable/FORWARD COMPATIBILITY> for more details).
1993
1994Freezing no longer gets confused if the Perl stack gets reallocated
1995during freezing [perl #80074].
1996
1997=item *
1998
d15cad80 1999L<Sys::Hostname> has been upgraded from version 1.11 to 1.16.
648c3d7d
FR
2000
2001=item *
2002
d15cad80 2003L<Term::ANSIColor> has been upgraded from version 2.02 to 3.00.
90c6e78f
FR
2004
2005=item *
2006
d15cad80 2007L<Term::UI> has been upgraded from version 0.20 to 0.26.
d9f2f059
FR
2008
2009=item *
2010
d15cad80 2011L<Test::Harness> has been upgraded from version 3.17 to 3.23.
80ebb519
FR
2012
2013=item *
2014
d15cad80 2015L<Test::Simple> has been upgraded from version 0.94 to 0.98.
5076a392
FC
2016
2017Among many other things, subtests without a C<plan> or C<no_plan> now have an
d15cad80 2018implicit done_testing() added to them.
5076a392
FC
2019
2020=item *
2021
d15cad80 2022L<Thread::Semaphore> has been upgraded from version 2.09 to 2.12.
5076a392 2023
1984204c
FC
2024It provides two new methods that give more control over the decrementing of
2025semaphores: C<down_nb> and C<down_force>.
5076a392
FC
2026
2027=item *
2028
d15cad80 2029L<Thread::Queue> has been upgraded from version 2.11 to 2.12.
f0d895e1
FR
2030
2031=item *
2032
d15cad80 2033The L<threads> pragma has been upgraded from version 1.75 to 1.83.
1a6b954e
FR
2034
2035=item *
2036
8cc10af2 2037The L<threads::shared> pragma has been upgraded from version 1.32 to 1.37.
55816daa
FR
2038
2039=item *
2040
d15cad80 2041L<Tie::Hash> has been upgraded from version 1.03 to 1.04.
5076a392 2042
d15cad80 2043Calling C<< Tie::Hash->TIEHASH() >> used to loop forever. Now it C<croak>s.
5076a392
FC
2044
2045=item *
2046
d15cad80 2047L<Tie::Hash::NamedCapture> has been upgraded from version 0.06 to 0.08.
f2adc546
FR
2048
2049=item *
2050
d15cad80 2051L<Tie::RefHash> has been upgraded from version 1.38 to 1.39.
ed68b07e
FR
2052
2053=item *
2054
d15cad80 2055L<Time::HiRes> has been upgraded from version 1.9719 to 1.9721_01.
bb3c221a
FR
2056
2057=item *
2058
d15cad80 2059L<Time::Local> has been upgraded from version 1.1901_01 to 1.2000.
97fa568b
FR
2060
2061=item *
2062
d15cad80 2063L<Time::Piece> has been upgraded from version 1.15_01 to 1.20_01.
a83cb732
FR
2064
2065=item *
2066
d15cad80 2067L<Unicode::Collate> has been upgraded from version 0.52_01 to 0.73.
5076a392 2068
d15cad80 2069L<Unicode::Collate> has been updated to use Unicode 6.0.0.
5076a392 2070
d15cad80 2071L<Unicode::Collate::Locale> now supports a plethora of new locales: I<ar, be,
1984204c 2072bg, de__phonebook, hu, hy, kk, mk, nso, om, tn, vi, hr, ig, ja, ko, ru, sq,
d15cad80 2073se, sr, to, uk, zh, zh__big5han, zh__gb2312han, zh__pinyin>, and I<zh__stroke>.
5076a392
FC
2074
2075The following modules have been added:
2076
d15cad80 2077L<Unicode::Collate::CJK::Big5> for C<zh__big5han> which makes
5076a392
FC
2078tailoring of CJK Unified Ideographs in the order of CLDR's big5han ordering.
2079
d15cad80 2080L<Unicode::Collate::CJK::GB2312> for C<zh__gb2312han> which makes
5076a392
FC
2081tailoring of CJK Unified Ideographs in the order of CLDR's gb2312han ordering.
2082
d15cad80 2083L<Unicode::Collate::CJK::JISX0208> which makes tailoring of 6355 kanji
5076a392
FC
2084(CJK Unified Ideographs) in the JIS X 0208 order.
2085
d15cad80 2086L<Unicode::Collate::CJK::Korean> which makes tailoring of CJK Unified Ideographs
5076a392
FC
2087in the order of CLDR's Korean ordering.
2088
d15cad80 2089L<Unicode::Collate::CJK::Pinyin> for C<zh__pinyin> which makes
5076a392
FC
2090tailoring of CJK Unified Ideographs in the order of CLDR's pinyin ordering.
2091
d15cad80 2092L<Unicode::Collate::CJK::Stroke> for C<zh__stroke> which makes
5076a392
FC
2093tailoring of CJK Unified Ideographs in the order of CLDR's stroke ordering.
2094
d15cad80 2095This also sees the switch from using the pure-Perl version of this
5076a392
FC
2096module to the XS version.
2097
2098=item *
2099
d15cad80 2100L<Unicode::Normalize> has been upgraded from version 1.03 to 1.10.
ec52b54b
FR
2101
2102=item *
2103
d15cad80 2104L<Unicode::UCD> has been upgraded from version 0.27 to 0.32.
5076a392 2105
d15cad80 2106A new function, Unicode::UCD::num(), has been added. This function
1984204c
FC
2107returns the numeric value of the string passed it or C<undef> if the string
2108in its entirety has no "safe" numeric value. (For more detail, and for the
2109definition of "safe", see L<Unicode::UCD/num>.)
5076a392 2110
1984204c 2111This upgrade also includes a number of bug fixes:
5076a392
FC
2112
2113=over 4
2114
2115=item charinfo()
2116
2117=over 4
2118
2119=item *
2120
d15cad80
TC
2121It is now updated to Unicode Version 6.0.0 with I<Corrigendum #8>,
2122excepting that, just as with Perl 5.14, the code point at U+1F514 has no name.
5076a392
FC
2123
2124=item *
2125
d15cad80 2126Hangul syllable code points have the correct names, and their
5076a392
FC
2127decompositions are always output without requiring L<Lingua::KO::Hangul::Util>
2128to be installed.
2129
2130=item *
2131
d15cad80 2132CJK (Chinese-Japanese-Korean) code points U+2A700 to U+2B734
54c7bb16 2133and U+2B740 to U+2B81D are now properly handled.
5076a392
FC
2134
2135=item *
2136
d15cad80 2137Numeric values are now output for those CJK code points that have them.
5076a392
FC
2138
2139=item *
2140
d15cad80 2141Names output for code points with multiple aliases are now the
5076a392
FC
2142corrected ones.
2143
2144=back
2145
2146=item charscript()
2147
2148This now correctly returns "Unknown" instead of C<undef> for the script
2149of a code point that hasn't been assigned another one.
2150
2151=item charblock()
2152
2153This now correctly returns "No_Block" instead of C<undef> for the block
2154of a code point that hasn't been assigned to another one.
2155
2156=back
2157
5076a392
FC
2158=item *
2159
d15cad80 2160The L<version> pragma has been upgraded from 0.82 to 0.88.
5076a392 2161
f8992784 2162Due to a bug, now fixed, the C<is_strict()> and C<is_lax()> functions did not
cdc10f43 2163work when exported (5.12.1).
5076a392
FC
2164
2165=item *
2166
d15cad80 2167The L<warnings> pragma has been upgraded from version 1.09 to 1.12.
5076a392
FC
2168
2169Calling C<use warnings> without arguments is now significantly more efficient.
2170
4f978a3b
FR
2171=item *
2172
d15cad80 2173The L<warnings::register> pragma has been upgraded from version 1.01 to 1.02.
4f978a3b 2174
5076a392 2175It is now possible to register warning categories other than the names of
d15cad80 2176packages using L<warnings::register>. See L<perllexwarn(1)> for more information.
5076a392
FC
2177
2178=item *
2179
d15cad80 2180L<XSLoader> has been upgraded from version 0.10 to 0.13.
62e270c2
FR
2181
2182=item *
2183
d15cad80 2184L<VMS::DCLsym> has been upgraded from version 1.03 to 1.05.
5076a392
FC
2185
2186Two bugs have been fixed [perl #84086]:
2187
2188The symbol table name was lost when tying a hash, due to a thinko in
40bd7639 2189C<TIEHASH>. The result was that all tied hashes interacted with the
5076a392
FC
2190local symbol table.
2191
2192Unless a symbol table name had been explicitly specified in the call
d15cad80 2193to the constructor, querying the special key C<:LOCAL> failed to
5076a392
FC
2194identify objects connected to the local symbol table.
2195
2196=item *
2197
d15cad80 2198The L<Win32> module has been upgraded from version 0.39 to 0.44.
5076a392 2199
f8992784 2200This release has several new functions: Win32::GetSystemMetrics(),
d15cad80 2201Win32::GetProductInfo(), Win32::GetOSDisplayName().
5076a392 2202
d15cad80 2203The names returned by Win32::GetOSName() and Win32::GetOSDisplayName()
1984204c 2204have been corrected.
5076a392 2205
3bbe5383
FR
2206=item *
2207
d15cad80 2208L<XS::Typemap> has been upgraded from version 0.03 to 0.05.
3bbe5383 2209
5076a392
FC
2210=back
2211
5076a392
FC
2212=head2 Removed Modules and Pragmata
2213
1c7f7822
JV
2214As promised in Perl 5.12.0's release notes, the following modules have
2215been removed from the core distribution, and if needed should be installed
2216from CPAN instead.
5076a392
FC
2217
2218=over
2219
4f978a3b
FR
2220=item *
2221
d15cad80 2222L<Class::ISA> has been removed from the Perl core. Prior version was 0.36.
5076a392 2223
4f978a3b
FR
2224=item *
2225
d15cad80 2226L<Pod::Plainer> has been removed from the Perl core. Prior version was 1.02.
4f978a3b
FR
2227
2228=item *
5076a392 2229
d15cad80 2230L<Switch> has been removed from the Perl core. Prior version was 2.16.
5076a392
FC
2231
2232=back
2233
d15cad80
TC
2234The removal of L<Shell> has been deferred until after 5.14, as the
2235implementation of L<Shell> shipped with 5.12.0 did not correctly issue the
5076a392
FC
2236warning that it was to be removed from core.
2237
2238=head1 Documentation
2239
5076a392
FC
2240=head2 New Documentation
2241
41e29def 2242=head3 L<perlgpl>
5076a392
FC
2243
2244L<perlgpl> has been updated to contain GPL version 1, as is included in the
d15cad80 2245F<README> distributed with Perl (5.12.1).
5076a392 2246
41e29def 2247=head3 Perl 5.12.x delta files
5076a392 2248
41e29def
FC
2249The perldelta files for Perl 5.12.1 to 5.12.3 have been added from the
2250maintenance branch: L<perl5121delta>, L<perl5122delta>, L<perl5123delta>.
5076a392
FC
2251
2252=head3 L<perlpodstyle>
2253
2254New style guide for POD documentation,
d15cad80 2255split mostly from the NOTES section of the L<pod2man(1)> manpage.
5076a392 2256
41e29def
FC
2257=head3 L<perlsource>, L<perlinterp>, L<perlhacktut>, and L<perlhacktips>
2258
cc13eef1 2259See L</perlhack and perlrepository revamp>, below.
5076a392
FC
2260
2261=head2 Changes to Existing Documentation
2262
41e29def 2263=head3 L<perlmodlib> is now complete
4ed2cea4 2264
d15cad80 2265The L<perlmodlib> manpage that came with Perl 5.12.0 was missing a number of
a60ea503 2266modules, due to a bug in the script that generates the list. This has been
cdc10f43 2267fixed [perl #74332] (5.12.1).
4ed2cea4 2268
1c7f7822 2269=head3 Replace incorrect tr/// table in L<perlebcdic>
5076a392 2270
d15cad80 2271L<perlebcdic> contains a helpful table to use in C<tr///> to convert
1c7f7822
JV
2272between EBCDIC and Latin1/ASCII. The table was the inverse of the one
2273it describes, though the code that used the table worked correctly for
2274the specific example given.
5076a392 2275
d15cad80 2276The table has been corrected and the sample code changed to correspond.
5076a392 2277
d15cad80
TC
2278The table has also been changed to hex from octal, and the recipes in the
2279pod have been altered to print out leading zeros to make all values
1c7f7822 2280the same length.
5076a392 2281
41e29def 2282=head3 Tricks for user-defined casing
5076a392 2283
41e29def 2284L<perlunicode> now contains an explanation of how to override, mangle
d15cad80 2285and otherwise tweak the way Perl handles upper-, lower- and other-case
41e29def 2286conversions on Unicode data, and how to provide scoped changes to alter
d15cad80 2287one's own code's behaviour without stomping on anybody else's.
5076a392 2288
1c7f7822 2289=head3 INSTALL explicitly states that Perl requires a C89 compiler
5076a392 2290
d15cad80 2291This was already true, but it's now Officially Stated For The Record
d430b8e7 2292(5.12.2).
5076a392 2293
41e29def 2294=head3 Explanation of C<\xI<HH>> and C<\oI<OOO>> escapes
5076a392 2295
41e29def
FC
2296L<perlop> has been updated with more detailed explanation of these two
2297character escapes.
5076a392 2298
d15cad80 2299=head3 B<-0I<NNN>> switch
5076a392 2300
d15cad80 2301In L<perlrun>, the behaviour of the B<-0NNN> switch for B<-0400> or higher
d430b8e7 2302has been clarified (5.12.2).
5076a392 2303
cdc10f43
FC
2304=head3 Maintenance policy
2305
2306L<perlpolicy> now contains the policy on what patches are acceptable for
2307maintenance branches (5.12.1).
2308
41e29def 2309=head3 Deprecation policy
5076a392 2310
41e29def 2311L<perlpolicy> now contains the policy on compatibility and deprecation
d430b8e7 2312along with definitions of terms like "deprecation" (5.12.2).
5076a392 2313
41e29def 2314=head3 New descriptions in L<perldiag>
5076a392
FC
2315
2316The following existing diagnostics are now documented:
2317
2318=over 4
2319
2320=item *
2321
2322L<Ambiguous use of %c resolved as operator %c|perldiag/"Ambiguous use of %c resolved as operator %c">
2323
2324=item *
2325
2326L<Ambiguous use of %c{%s} resolved to %c%s|perldiag/"Ambiguous use of %c{%s} resolved to %c%s">
2327
2328=item *
2329
2330L<Ambiguous use of %c{%s%s} resolved to %c%s%s|perldiag/"Ambiguous use of %c{%s%s} resolved to %c%s%s">
2331
2332=item *
2333
2334L<Ambiguous use of -%s resolved as -&%s()|perldiag/"Ambiguous use of -%s resolved as -&%s()">
2335
2336=item *
2337
2338L<Invalid strict version format (%s)|perldiag/"Invalid strict version format (%s)">
2339
2340=item *
2341
2342L<Invalid version format (%s)|perldiag/"Invalid version format (%s)">
2343
2344=item *
2345
2346L<Invalid version object|perldiag/"Invalid version object">
2347
2348=back
2349
5076a392
FC
2350=head3 L<perlbook>
2351
41e29def 2352L<perlbook> has been expanded to cover many more popular books.
5076a392 2353
41e29def 2354=head3 C<SvTRUE> macro
5076a392 2355
41e29def
FC
2356The documentation for the C<SvTRUE> macro in
2357L<perlapi> was simply wrong in stating that
a60ea503 2358get-magic is not processed. It has been corrected.
5076a392 2359
41e29def 2360=head3 L<perlvar> revamp
5076a392 2361
41e29def 2362L<perlvar> reorders the variables and groups them by topic. Each variable
5076a392 2363introduced after Perl 5.000 notes the first version in which it is
41e29def 2364available. L<perlvar> also has a new section for deprecated variables to
5076a392
FC
2365note when they were removed.
2366
41e29def 2367=head3 Array and hash slices in scalar context
5076a392 2368
41e29def 2369These are now documented in L<perldata>.
5076a392 2370
41e29def 2371=head3 C<use locale> and formats
5076a392
FC
2372
2373L<perlform> and L<perllocale> have been corrected to state that
2374C<use locale> affects formats.
2375
5076a392
FC
2376=head3 L<overload>
2377
a60ea503 2378L<overload>'s documentation has practically undergone a rewrite. It
5076a392
FC
2379is now much more straightforward and clear.
2380
cc13eef1 2381=head3 perlhack and perlrepository revamp
5076a392 2382
5076a392 2383The L<perlhack> document is now much shorter, and focuses on the Perl 5
1c7f7822
JV
2384development process and submitting patches to Perl. The technical content
2385has been moved to several new documents, L<perlsource>, L<perlinterp>,
d15cad80
TC
2386L<perlhacktut>, and L<perlhacktips>. This technical content has
2387been only lightly edited.
5076a392 2388
1c7f7822
JV
2389The perlrepository document has been renamed to L<perlgit>. This new
2390document is just a how-to on using git with the Perl source code.
2391Any other content that used to be in perlrepository has been moved
2392to L<perlhack>.
5076a392 2393
41e29def 2394=head3 Time::Piece examples
5076a392
FC
2395
2396Examples in L<perlfaq4> have been updated to show the use of
41e29def 2397L<Time::Piece>.
5076a392
FC
2398
2399=head1 Diagnostics
2400
2401The following additions or changes have been made to diagnostic output,
2402including warnings and fatal error messages. For the complete list of
2403diagnostic messages, see L<perldiag>.
2404
2405=head2 New Diagnostics
2406
a593b319
FC
2407=head3 New Errors
2408
5076a392
FC
2409=over
2410
a593b319 2411=item Closure prototype called
5076a392 2412
a593b319
FC
2413This error occurs when a subroutine reference passed to an attribute
2414handler is called, if the subroutine is a closure [perl #68560].
5076a392 2415
a593b319 2416=item Insecure user-defined property %s
5076a392 2417
a593b319
FC
2418Perl detected tainted data when trying to compile a regular
2419expression that contains a call to a user-defined character property
d15cad80 2420function, meaning C<\p{IsFoo}> or C<\p{InFoo}>.
a593b319 2421See L<perlunicode/User-Defined Character Properties> and L<perlsec>.
5076a392 2422
a593b319 2423=item panic: gp_free failed to free glob pointer - something is repeatedly re-creating entries
5076a392 2424
a593b319
FC
2425This new error is triggered if a destructor called on an object in a
2426typeglob that is being freed creates a new typeglob entry containing an
d15cad80 2427object with a destructor that creates a new entry containing an object etc.
5076a392 2428
a593b319 2429=item Parsing code internal error (%s)
5076a392 2430
a593b319
FC
2431This new fatal error is produced when parsing
2432code supplied by an extension violates the
2433parser's API in a detectable way.
5076a392 2434
a593b319 2435=item refcnt: fd %d%s
5076a392 2436
a593b319
FC
2437This new error only occurs if a internal consistency check fails when a
2438pipe is about to be closed.
5076a392 2439
a593b319 2440=item Regexp modifier "/%c" may not appear twice
5076a392 2441
a593b319
FC
2442The regular expression pattern has one of the
2443mutually exclusive modifiers repeated.
5076a392 2444
a593b319 2445=item Regexp modifiers "/%c" and "/%c" are mutually exclusive
5076a392 2446
a593b319
FC
2447The regular expression pattern has more than one of the mutually
2448exclusive modifiers.
5076a392 2449
a593b319 2450=item Using !~ with %s doesn't make sense
5076a392 2451
a593b319 2452This error occurs when C<!~> is used with C<s///r> or C<y///r>.
5076a392 2453
a593b319 2454=back
5076a392 2455
a593b319 2456=head3 New Warnings
5076a392 2457
a593b319 2458=over
5076a392 2459
a593b319 2460=item "\b{" is deprecated; use "\b\{" instead
5076a392 2461
a593b319 2462=item "\B{" is deprecated; use "\B\{" instead
5076a392 2463
a593b319
FC
2464Use of an unescaped "{" immediately following a C<\b> or C<\B> is now
2465deprecated so as to reserve its use for Perl itself in a future release.
5076a392 2466
a593b319 2467=item Operation "%s" returns its argument for ...
5076a392 2468
a593b319 2469Performing an operation requiring Unicode semantics (such as case-folding)
a60ea503
FC
2470on a Unicode surrogate or a non-Unicode character now triggers this
2471warning.
5076a392 2472
a593b319
FC
2473=item Use of qw(...) as parentheses is deprecated
2474
2475See L</"Use of qw(...) as parentheses">, above, for details.
5076a392
FC
2476
2477=back
2478
2479=head2 Changes to Existing Diagnostics
2480
2481=over 4
2482
2483=item *
2484
4ed2cea4 2485The "Variable $foo is not imported" warning that precedes a
d15cad80 2486C<strict "vars"> error has now been assigned the "misc" category, so that
4ed2cea4
FC
2487C<no warnings> will suppress it [perl #73712].
2488
2489=item *
2490
d15cad80
TC
2491warn() and die() now produce "Wide character" warnings when fed a
2492character outside the byte range if C<STDERR> is a byte-sized handle.
5076a392
FC
2493
2494=item *
2495
d15cad80 2496The "Layer does not match this perl" error message has been replaced with
a593b319 2497these more helpful messages [perl #73754]:
5076a392
FC
2498
2499=over 4
2500
2501=item *
2502
2503PerlIO layer function table size (%d) does not match size expected by this
2504perl (%d)
2505
2506=item *
2507
2508PerlIO layer instance size (%d) does not match size expected by this perl
2509(%d)
2510
2511=back
2512
5076a392
FC
2513=item *
2514
2515The "Found = in conditional" warning that is emitted when a constant is
2516assigned to a variable in a condition is now withheld if the constant is
2517actually a subroutine or one generated by C<use constant>, since the value
2518of the constant may not be known at the time the program is written
2519[perl #77762].
2520
2521=item *
2522
d15cad80
TC
2523Previously, if none of the gethostbyaddr(), gethostbyname() and
2524gethostent() functions were implemented on a given platform, they would
2525all die with the message "Unsupported socket function 'gethostent' called",
2526with analogous messages for getnet*() and getserv*(). This has been
5076a392
FC
2527corrected.
2528
2529=item *
2530
a593b319 2531The warning message about unrecognized regular expression escapes passed
d15cad80
TC
2532through has been changed to include any literal "{" following the
2533two-character escape. For example, "\q{" is now emitted instead of "\q".
5076a392
FC
2534
2535=back
2536
2537=head1 Utility Changes
2538
f8992784 2539=head3 L<perlbug(1)>
5076a392
FC
2540
2541=over 4
2542
2543=item *
2544
0b88cc74
FC
2545L<perlbug> now looks in the EMAIL environment variable for a return address
2546if the REPLY-TO and REPLYTO variables are empty.
5076a392
FC
2547
2548=item *
2549
d15cad80
TC
2550L<perlbug> did not previously generate a "From:" header, potentially
2551resulting in dropped mail; it now includes that header.
5076a392
FC
2552
2553=item *
2554
d15cad80 2555The user's address is now used as the Return-Path.
4ed2cea4 2556
d15cad80 2557Many systems these days don't have a valid Internet domain name, and
0b88cc74
FC
2558perlbug@perl.org does not accept email with a return-path that does
2559not resolve. So the user's address is now passed to sendmail so it's
2560less likely to get stuck in a mail queue somewhere [perl #82996].
5076a392 2561
2c389f6c
FC
2562=item *
2563
d430b8e7
FC
2564L<perlbug> now always gives the reporter a chance to change the email
2565address it guesses for them (5.12.2).
2566
2567=item *
2568
d15cad80
TC
2569L<perlbug> should no longer warn about uninitialized values when using the B<-d>
2570and B<-v> options (5.12.2).
2c389f6c 2571
5076a392
FC
2572=back
2573
0b88cc74 2574=head3 L<perl5db.pl>
5076a392 2575
0b88cc74 2576=over
5076a392
FC
2577
2578=item *
2579
d15cad80
TC
2580The remote terminal works after forking and spawns new sessions, one
2581per forked process.
5076a392
FC
2582
2583=back
2584
0b88cc74 2585=head3 L<ptargrep>
5076a392
FC
2586
2587=over 4
2588
2589=item *
2590
0b88cc74
FC
2591L<ptargrep> is a new utility to apply pattern matching to the contents of
2592files in a tar archive. It comes with C<Archive::Tar>.
5076a392
FC
2593
2594=back
2595
2596=head1 Configuration and Compilation
2597
61752d82
FC
2598See also L</"Naming fixes in Policy_sh.SH may invalidate Policy.sh">,
2599above.
2600
5076a392
FC
2601=over 4
2602
2603=item *
2604
1c7f7822 2605CCINCDIR and CCLIBDIR for the mingw64 cross-compiler are now correctly
d15cad80
TC
2606under F<$(CCHOME)\mingw\include> and F<\lib> rather than immediately below
2607F<$(CCHOME)>.
5076a392 2608
d15cad80
TC
2609This means the "incpath", "libpth", "ldflags", "lddlflags" and
2610"ldflags_nolargefiles" values in F<Config.pm> and F<Config_heavy.pl> are now
87595b22 2611set correctly.
5076a392
FC
2612
2613=item *
2614
d15cad80 2615C<make test.valgrind> has been adjusted to account for cpan/dist/ext
87595b22 2616separation.
5076a392
FC
2617
2618=item *
2619
d15cad80 2620On compilers that support it, B<-Wwrite-strings> is now added to cflags by
5076a392
FC
2621default.
2622
2623=item *
2624
d15cad80 2625The L<Encode> module can now (once again) be included in a static Perl
5076a392
FC
2626build. The special-case handling for this situation got broken in Perl
26275.11.0, and has now been repaired.
2628
1e463951
FC
2629=item *
2630
2631The previous default size of a PerlIO buffer (4096 bytes) has been increased
2632to the larger of 8192 bytes and your local BUFSIZ. Benchmarks show that doubling
2633this decade-old default increases read and write performance in the neighborhood
2634of 25% to 50% when using the default layers of perlio on top of unix. To choose
2635a non-default size, such as to get back the old value or to obtain an even
2636larger value, configure with:
2637
2638 ./Configure -Accflags=-DPERLIOBUF_DEFAULT_BUFSIZ=N
2639
2640where N is the desired size in bytes; it should probably be a multiple of
2641your page size.
2642
d430b8e7
FC
2643=item *
2644
2645An "incompatible operand types" error in ternary expressions when building
2646with C<clang> has been fixed (5.12.2).
2647
2648=item *
2649
d15cad80 2650Perl now skips setuid L<File::Copy> tests on partitions it detects to be mounted
d430b8e7
FC
2651as C<nosuid> (5.12.2).
2652
5076a392
FC
2653=back
2654
5076a392
FC
2655=head1 Platform Support
2656
5076a392
FC
2657=head2 New Platforms
2658
5076a392
FC
2659=over 4
2660
2661=item AIX
2662
cdc10f43 2663Perl now builds on AIX 4.2 (5.12.1).
5076a392
FC
2664
2665=back
2666
2667=head2 Discontinued Platforms
2668
2669=over 4
2670
5076a392
FC
2671=item Apollo DomainOS
2672
1c7f7822
JV
2673The last vestiges of support for this platform have been excised from
2674the Perl distribution. It was officially discontinued in version 5.12.0.
2675It had not worked for years before that.
5076a392
FC
2676
2677=item MacOS Classic
2678
2679The last vestiges of support for this platform have been excised from the
a60ea503 2680Perl distribution. It was officially discontinued in an earlier version.
5076a392
FC
2681
2682=back
2683
2684=head2 Platform-Specific Notes
2685
d430b8e7
FC
2686=head3 AIX
2687
2688=over
2689
2690=item *
2691
2692F<README.aix> has been updated with information about the XL C/C++ V11 compiler
2693suite (5.12.2).
2694
2695=back
2696
2697=head3 ARM
2698
2699=over
2700
2701=item *
2702
2703The C<d_u32align> configuration probe on ARM has been fixed (5.12.2).
2704
2705=back
2706
554003a2 2707=head3 Cygwin
5076a392
FC
2708
2709=over 4
2710
2711=item *
2712
d15cad80 2713L<MakeMaker> has been updated to build manpages on cygwin.
5076a392
FC
2714
2715=item *
2716
554003a2
FC
2717Improved rebase behaviour
2718
d15cad80
TC
2719If a DLL is updated on cygwin the old imagebase address is reused.
2720This solves most rebase errors, especially when updating on core DLL's.
2721See L<http://www.tishler.net/jason/software/rebase/rebase-2.4.2.README>
2722for more information.
5076a392
FC
2723
2724=item *
2725
d15cad80 2726Support for the standard cygwin dll prefix (needed for FFIs)
5076a392
FC
2727
2728=item *
2729
554003a2 2730Updated build hints file
5076a392
FC
2731
2732=back
2733
cdc10f43
FC
2734=head3 FreeBSD 7
2735
2736=over
2737
2738=item *
2739
40bd7639 2740FreeBSD 7 no longer contains F</usr/bin/objformat>. At build time,
cdc10f43
FC
2741Perl now skips the F<objformat> check for versions 7 and higher and
2742assumes ELF (5.12.1).
2743
2744=back
2745
2746=head3 HP-UX
2747
2748=over
2749
2750=item *
2751
d15cad80 2752Perl now allows B<-Duse64bitint> without promoting to C<use64bitall> on HP-UX
cdc10f43
FC
2753(5.12.1).
2754
2755=back
2756
554003a2 2757=head3 IRIX
5076a392 2758
a60ea503
FC
2759=over
2760
2761=item *
2762
5076a392
FC
2763Conversion of strings to floating-point numbers is now more accurate on
2764IRIX systems [perl #32380].
2765
a60ea503
FC
2766=back
2767
554003a2 2768=head3 Mac OS X
5076a392 2769
a60ea503
FC
2770=over
2771
2772=item *
2773
5076a392 2774Early versions of Mac OS X (Darwin) had buggy implementations of the
d15cad80 2775setregid(), setreuid(), setrgid(,) and setruid() functions, so Perl
5076a392
FC
2776would pretend they did not exist.
2777
2778These functions are now recognised on Mac OS 10.5 (Leopard; Darwin 9) and
2779higher, as they have been fixed [perl #72990].
2780
a60ea503
FC
2781=back
2782
554003a2 2783=head3 MirBSD
5076a392 2784
a60ea503
FC
2785=over
2786
2787=item *
2788
d15cad80 2789Previously if you built Perl with a shared F<libperl.so> on MirBSD (the
554003a2 2790default config), it would work up to the installation; however, once
d15cad80 2791installed, it would be unable to find F<libperl>. Path handling is now
554003a2 2792treated as in the other BSD dialects.
5076a392 2793
a60ea503
FC
2794=back
2795
554003a2 2796=head3 NetBSD
5076a392 2797
a60ea503
FC
2798=over
2799
2800=item *
2801
d15cad80 2802The NetBSD hints file has been changed to make the system malloc the
554003a2 2803default.
5076a392 2804
a60ea503
FC
2805=back
2806
1c7f7822 2807=head3 OpenBSD
5076a392 2808
a60ea503
FC
2809=over
2810
2811=item *
2812
d15cad80
TC
2813OpenBSD E<gt> 3.7 has a new malloc implementation which is I<mmap>-based,
2814and as such can release memory back to the OS; however, Perl's use of
2815this malloc causes a substantial slowdown, so we now default to using
2816Perl's malloc instead [perl #75742].
5076a392 2817
a60ea503
FC
2818=back
2819
554003a2 2820=head3 OpenVOS
5076a392 2821
a60ea503
FC
2822=over
2823
2824=item *
2825
d15cad80 2826Perl now builds again with OpenVOS (formerly known as Stratus VOS)
5a553547 2827[perl #78132] (5.12.3).
5076a392 2828
a60ea503
FC
2829=back
2830
554003a2 2831=head3 Solaris
5076a392 2832
a60ea503
FC
2833=over
2834
2835=item *
2836
2837DTrace is now supported on Solaris. There used to be build failures, but
5a553547 2838these have been fixed [perl #73630] (5.12.3).
5076a392 2839
a60ea503
FC
2840=back
2841
554003a2 2842=head3 VMS
5076a392
FC
2843
2844=over
2845
2846=item *
2847
8b6a1dd5
CB
2848Extension building on older (pre 7.3-2) VMS systems was broken because
2849configure.com hit the DCL symbol length limit of 1K. We now work within
2850this limit when assembling the list of extensions in the core build (5.12.1).
cdc10f43
FC
2851
2852=item *
2853
8b6a1dd5 2854We fixed configuring and building Perl with B<-Uuseperlio> (5.12.1).
cdc10f43
FC
2855
2856=item *
2857
554003a2 2858C<PerlIOUnix_open> now honours the default permissions on VMS.
5076a392 2859
8b6a1dd5 2860When C<perlio> became the default and C<unix> became the default bottom layer,
554003a2 2861the most common path for creating files from Perl became C<PerlIOUnix_open>,
8b6a1dd5
CB
2862which has always explicitly used C<0666> as the permission mask. This prevents
2863inheriting permissions from RMS defaults and ACLs, so to avoid that problem,
2864we now pass C<0777> to C<open()>. In theVMS CRTL, C<0777> has a special
2865meaning over and above intersecting with the current umask; specifically, it
2866allows Unix syscalls to preserve native default permissions (5.12.3).
5076a392
FC
2867
2868=item *
2869
8b6a1dd5
CB
2870The shortening of symbols longer than 31 characters in the core C sources
2871and in extensions is now by default done by the C compiler rather than by
2872xsubpp (which could only do so for generated symbols in XS code). You can
2873reenable xsubpp's symbol shortening by configuring with -Uuseshortenedsymbols,
2874but you'll have some work to do to get the core sources to compile.
5076a392
FC
2875
2876=item *
2877
554003a2 2878Record-oriented files (record format variable or variable with fixed control)
8b6a1dd5 2879opened for write by the C<perlio> layer will now be line-buffered to prevent the
554003a2 2880introduction of spurious line breaks whenever the perlio buffer fills up.
5076a392 2881
d430b8e7
FC
2882=item *
2883
8b6a1dd5 2884F<git_version.h> is now installed on VMS. This was an oversight in v5.12.0 which
d430b8e7
FC
2885caused some extensions to fail to build (5.12.2).
2886
2887=item *
2888
2889Several memory leaks in L<stat()|perlfunc/"stat FILEHANDLE"> have been fixed (5.12.2).
2890
2891=item *
2892
d15cad80 2893A memory leak in Perl_rename() due to a double allocation has been
d430b8e7
FC
2894fixed (5.12.2).
2895
2896=item *
2897
d15cad80
TC
2898A memory leak in vms_fid_to_name() (used by realpath() and
2899realname()> has been fixed (5.12.2).
d430b8e7 2900
5076a392
FC
2901=back
2902
554003a2 2903=head3 Windows
5076a392 2904
5a1f7719
FC
2905See also L</"fork() emulation will not wait for signalled children"> and
2906L</"Perl source code is read in text mode on Windows">, above.
2907
5076a392
FC
2908=over 4
2909
2910=item *
2911
554003a2 2912Fixed build process for SDK2003SP1 compilers.
5076a392 2913
554003a2 2914=item *
5076a392 2915
01b1a9e4
FC
2916Compilation with Visual Studio 2010 is now supported.
2917
2918=item *
2919
d15cad80
TC
2920When using old 32-bit compilers, the define C<_USE_32BIT_TIME_T> is now
2921set in C<$Config{ccflags}>. This improves portability when compiling
2922XS extensions using new compilers, but for a Perl compiled with old 32-bit
554003a2 2923compilers.
5076a392
FC
2924
2925=item *
2926
d15cad80 2927C<$Config{gccversion}> is now set correctly when Perl is built using the
554003a2 2928mingw64 compiler from L<http://mingw64.org> [perl #73754].
5076a392 2929
554003a2
FC
2930=item *
2931
d430b8e7
FC
2932When building Perl with the mingw64 x64 cross-compiler C<incpath>,
2933C<libpth>, C<ldflags>, C<lddlflags> and C<ldflags_nolargefiles> values
2934in F<Config.pm> and F<Config_heavy.pl> were not previously being set
2935correctly because, with that compiler, the include and lib directories
2936are not immediately below C<$(CCHOME)> (5.12.2).
2937
2938=item *
2939
554003a2
FC
2940The build process proceeds more smoothly with mingw and dmake when
2941F<C:\MSYS\bin> is in the PATH, due to a C<Cwd> fix.
5076a392
FC
2942
2943=item *
2944
554003a2
FC
2945Support for building with Visual C++ 2010 is now underway, but is not yet
2946complete. See F<README.win32> or L<perlwin32> for more details.
5076a392 2947
554003a2
FC
2948=item *
2949
d15cad80
TC
2950The option to use an externally-supplied crypt(), or to build with no
2951crypt() at all, has been removed. Perl supplies its own crypt()
554003a2
FC
2952implementation for Windows, and the political situation that required
2953this part of the distribution to sometimes be omitted is long gone.
5076a392
FC
2954
2955=back
2956
2957=head1 Internal Changes
2958
1e463951 2959=head2 New APIs
5076a392 2960
1e463951 2961=head3 CLONE_PARAMS structure added to ease correct thread creation
5076a392 2962
1e463951 2963Modules that create threads should now create C<CLONE_PARAMS> structures
d15cad80
TC
2964by calling the new function Perl_clone_params_new(), and free them with
2965Perl_clone_params_del(). This will ensure compatibility with any future
1e463951
FC
2966changes to the internals of the C<CLONE_PARAMS> structure layout, and that
2967it is correctly allocated and initialised.
5076a392 2968
1e463951 2969=head3 New parsing functions
5076a392 2970
1e463951
FC
2971Several functions have been added for parsing statements or multiple
2972statements:
5076a392 2973
1e463951 2974=over
5076a392
FC
2975
2976=item *
2977
1e463951 2978C<parse_fullstmt> parses a complete Perl statement.
5076a392
FC
2979
2980=item *
2981
1e463951
FC
2982C<parse_stmtseq> parses a sequence of statements, up
2983to closing brace or EOF.
5076a392
FC
2984
2985=item *
2986
1e463951 2987C<parse_block> parses a block [perl #78222].
5076a392
FC
2988
2989=item *
2990
1e463951
FC
2991C<parse_barestmt> parses a statement
2992without a label.
5076a392
FC
2993
2994=item *
2995
1e463951 2996C<parse_label> parses a statement label, separate from statements.
5076a392 2997
1e463951 2998=back
5076a392 2999
1e463951
FC
3000The
3001L<C<parse_fullexpr()>|perlapi/parse_fullexpr>,
3002L<C<parse_listexpr()>|perlapi/parse_listexpr>,
3003L<C<parse_termexpr()>|perlapi/parse_termexpr>, and
3004L<C<parse_arithexpr()>|perlapi/parse_arithexpr>
3005functions have been added to the API. They perform
3006recursive-descent parsing of expressions at various precedence levels.
3007They are expected to be used by syntax plugins.
5076a392 3008
1e463951 3009See L<perlapi> for details.
5076a392 3010
1e463951 3011=head3 Hints hash API
5076a392 3012
1e463951
FC
3013A new C API for introspecting the hinthash C<%^H> at runtime has been
3014added. See C<cop_hints_2hv>, C<cop_hints_fetchpvn>, C<cop_hints_fetchpvs>,
3015C<cop_hints_fetchsv>, and C<hv_copy_hints_hv> in L<perlapi> for details.
5076a392 3016
1e463951
FC
3017A new, experimental API has been added for accessing the internal
3018structure that Perl uses for C<%^H>. See the functions beginning with
3019C<cophh_> in L<perlapi>.
5076a392 3020
d15cad80 3021=head3 C interface to caller()
5076a392 3022
1e463951 3023The C<caller_cx> function has been added as an XSUB-writer's equivalent of
d15cad80 3024caller(). See L<perlapi> for details.
5076a392 3025
1e463951 3026=head3 Custom per-subroutine check hooks
5076a392 3027
1e463951
FC
3028XS code in an extension module can now annotate a subroutine (whether
3029implemented in XS or in Perl) so that nominated XS code will be called
3030at compile time (specifically as part of op checking) to change the op
3031tree of that subroutine. The compile-time check function (supplied by
3032the extension module) can implement argument processing that can't be
3033expressed as a prototype, generate customised compile-time warnings,
3034perform constant folding for a pure function, inline a subroutine
3035consisting of sufficiently simple ops, replace the whole call with a
3036custom op, and so on. This was previously all possible by hooking the
3037C<entersub> op checker, but the new mechanism makes it easy to tie the
3038hook to a specific subroutine. See L<perlapi/cv_set_call_checker>.
5076a392 3039
1e463951
FC
3040To help in writing custom check hooks, several subtasks within standard
3041C<entersub> op checking have been separated out and exposed in the API.
5076a392 3042
1e463951 3043=head3 Improved support for custom OPs
5076a392 3044
1e463951
FC
3045Custom ops can now be registered with the new C<custom_op_register> C
3046function and the C<XOP> structure. This will make it easier to add new
3047properties of custom ops in the future. Two new properties have been added
3048already, C<xop_class> and C<xop_peep>.
5076a392 3049
d15cad80 3050C<xop_class> is one of the OA_*OP constants. It allows L<B> and other
1e463951
FC
3051introspection mechanisms to work with custom ops
3052that aren't BASEOPs. C<xop_peep> is a pointer to
3053a function that will be called for ops of this
3054type from C<Perl_rpeep>.
5076a392 3055
1e463951
FC
3056See L<perlguts/Custom Operators> and L<perlapi/Custom Operators> for more
3057detail.
5076a392 3058
1e463951
FC
3059The old C<PL_custom_op_names>/C<PL_custom_op_descs> interface is still
3060supported but discouraged.
5076a392 3061
1e463951 3062=head3 Scope hooks
5076a392 3063
1e463951
FC
3064It is now possible for XS code to hook into Perl's lexical scope
3065mechanism at compile time, using the new C<Perl_blockhook_register>
a60ea503 3066function. See L<perlguts/"Compile-time scope hooks">.
5076a392 3067
1e463951 3068=head3 The recursive part of the peephole optimizer is now hookable
5076a392
FC
3069
3070In addition to C<PL_peepp>, for hooking into the toplevel peephole optimizer, a
3071C<PL_rpeepp> is now available to hook into the optimizer recursing into
3072side-chains of the optree.
3073
1e463951 3074=head3 New non-magical variants of existing functions
5076a392 3075
1e463951 3076The following functions/macros have been added to the API. The C<*_nomg>
d15cad80
TC
3077macros are equivalent to their non-C<_nomg> variants, except that they ignore
3078C<get-magic>. Those ending in C<_flags> allow one to specify whether
3079C<get-magic> is processed.
5076a392 3080
1e463951
FC
3081 sv_2bool_flags
3082 SvTRUE_nomg
3083 sv_2nv_flags
3084 SvNV_nomg
3085 sv_cmp_flags
3086 sv_cmp_locale_flags
3087 sv_eq_flags
3088 sv_collxfrm_flags
5076a392 3089
d15cad80 3090In some of these cases, the non-C<_flags> functions have
5076a392
FC
3091been replaced with wrappers around the new functions.
3092
1e463951 3093=head3 pv/pvs/sv versions of existing functions
5076a392 3094
d15cad80 3095Many functions ending with pvn now have equivalent C<pv/pvs/sv> versions.
5076a392 3096
1e463951 3097=head3 List op-building functions
5076a392 3098
1e463951
FC
3099List op-building functions have been added to the
3100API. See L<op_append_elem|perlapi/op_append_elem>,
3101L<op_append_list|perlapi/op_append_list>, and
3102L<op_prepend_elem|perlapi/op_prepend_elem> in L<perlapi>.
5076a392 3103
1e463951 3104=head3 C<LINKLIST>
5076a392 3105
1e463951
FC
3106The L<LINKLIST|perlapi/LINKLIST> macro, part of op building that
3107constructs the execution-order op chain, has been added to the API.
5076a392 3108
1e463951 3109=head3 Localisation functions
5076a392 3110
1e463951
FC
3111The C<save_freeop>, C<save_op>, C<save_pushi32ptr> and C<save_pushptrptr>
3112functions have been added to the API.
5076a392 3113
1e463951 3114=head3 Stash names
5076a392 3115
1e463951
FC
3116A stash can now have a list of effective names in addition to its usual
3117name. The first effective name can be accessed via the C<HvENAME> macro,
3118which is now the recommended name to use in MRO linearisations (C<HvNAME>
3119being a fallback if there is no C<HvENAME>).
5076a392 3120
1e463951
FC
3121These names are added and deleted via C<hv_ename_add> and
3122C<hv_ename_delete>. These two functions are I<not> part of the API.
5076a392 3123
1e463951 3124=head3 New functions for finding and removing magic
5076a392 3125
1e463951
FC
3126The L<C<mg_findext()>|perlapi/mg_findext> and
3127L<C<sv_unmagicext()>|perlapi/sv_unmagicext>
3128functions have been added to the API.
3129They allow extension authors to find and remove magic attached to
3130scalars based on both the magic type and the magic virtual table, similar to how
d15cad80 3131sv_magicext() attaches magic of a certain type and with a given virtual table
40bd7639 3132to a scalar. This eliminates the need for extensions to walk the list of
1e463951 3133C<MAGIC> pointers of an C<SV> to find the magic that belongs to them.
5076a392 3134
1e463951 3135=head3 C<find_rundefsv>
5076a392 3136
1e463951
FC
3137This function returns the SV representing C<$_>, whether it's lexical
3138or dynamic.
5076a392 3139
1e463951 3140=head3 C<Perl_croak_no_modify>
5076a392 3141
d15cad80 3142Perl_croak_no_modify() is short-hand for
1e463951 3143C<Perl_croak("%s", PL_no_modify)>.
5076a392 3144
1e463951 3145=head3 C<PERL_STATIC_INLINE> define
5076a392 3146
1e463951
FC
3147The C<PERL_STATIC_INLINE> define has been added to provide the best-guess
3148incantation to use for static inline functions, if the C compiler supports
3149C99-style static inline. If it doesn't, it'll give a plain C<static>.
5076a392 3150
1e463951
FC
3151C<HAS_STATIC_INLINE> can be used to check if the compiler actually supports
3152inline functions.
5076a392 3153
1e463951 3154=head3 New C<pv_escape> option for hexadecimal escapes
5076a392 3155
1e463951
FC
3156A new option, C<PERL_PV_ESCAPE_NONASCII>, has been added to C<pv_escape> to
3157dump all characters above ASCII in hexadecimal. Before, one could get all
3158characters as hexadecimal or the Latin1 non-ASCII as octal.
5076a392 3159
1e463951 3160=head3 C<lex_start>
5076a392 3161
1e463951 3162C<lex_start> has been added to the API, but is considered experimental.
5076a392 3163
d15cad80 3164=head3 op_scope() and op_lvalue()
5076a392 3165
d15cad80 3166The op_scope() and op_lvalue() functions have been added to the API,
1e463951 3167but are considered experimental.
5076a392 3168
1e463951 3169=head2 C API Changes
5076a392 3170
1e463951 3171=head3 C<PERL_POLLUTE> has been removed
5076a392 3172
1e463951 3173The option to define C<PERL_POLLUTE> to expose older 5.005 symbols for
d15cad80 3174backwards compatibility has been removed. Its use was always discouraged,
1e463951 3175and MakeMaker contains a more specific escape hatch:
5076a392 3176
1e463951 3177 perl Makefile.PL POLLUTE=1
5076a392 3178
1e463951
FC
3179This can be used for modules that have not been upgraded to 5.6 naming
3180conventions (and really should be completely obsolete by now).
5076a392 3181
1e463951 3182=head3 Check API compatibility when loading XS modules
5076a392 3183
d15cad80
TC
3184When Perl's API changes in incompatible ways (which usually happens between
3185major releases), XS modules compiled for previous versions of Perl will no
3186longer work. They need to be recompiled against the new Perl.
5076a392 3187
1e463951
FC
3188In order to ensure that modules are recompiled, and to prevent users from
3189accidentally loading modules compiled for old perls into newer ones, the
3190C<XS_APIVERSION_BOOTCHECK> macro has been added. That macro, which is
3191called when loading every newly compiled extension, compares the API
d15cad80 3192version of the running Perl with the version a module has been compiled for
1e463951 3193and raises an exception if they don't match.
5076a392 3194
1e463951 3195=head3 Perl_fetch_cop_label
5076a392 3196
1e463951
FC
3197The first argument of the C API function C<Perl_fetch_cop_label> has changed
3198from C<struct refcounted he *> to C<COP *>, to insulate the user from
3199implementation details.
5076a392 3200
1e463951 3201This API function was marked as "may change", and likely isn't in use outside
d15cad80 3202the core. (Neither an unpacked CPAN nor Google's codesearch finds any other
1e463951 3203references to it.)
5076a392 3204
1e463951 3205=head3 GvCV() and GvGP() are no longer lvalues
5076a392 3206
1e463951
FC
3207The new GvCV_set() and GvGP_set() macros are now provided to replace
3208assignment to those two macros.
5076a392 3209
1e463951
FC
3210This allows a future commit to eliminate some backref magic between GV
3211and CVs, which will require complete control over assignment to the
d15cad80 3212C<gp_cv> slot.
5076a392