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