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