This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta: typos
[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
52594064 58Unicode semantics. See L<feature/"the 'unicode_strings' 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
122c7b7d 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
038c245e 941This is being deprecated because C<qw(a b c)> is supposed to mean
b6cc6faa 942C<"a", "b", "c"> not C<("a", "b", "c")>. I.e., this doesn't compile:
038c245e
AB
943
944 for my $i "a", "b", "c" { }
945
946So neither should this:
947
948 for my $i qw(a b c) {}
949
950But these both work:
951
952 for my $i ("a", "b", "c") { }
953 for my $i (qw(a b c)) {}
954
955Note that this does not change the behavior of cases like:
956
957 use POSIX qw(setlocale localeconv)
958 our @EXPORT = qw(foo bar baz);
959
b6cc6faa 960Where a list with or without parentheses could have been provided.
038c245e 961
1c7f7822 962=head2 C<\N{BELL}>
5076a392
FC
963
964This is because Unicode is using that name for a different character.
965See L</Unicode Version 6.0 is now supported (mostly)> for more
966explanation.
967
1c7f7822 968=head2 C<?PATTERN?>
5076a392
FC
969
970C<?PATTERN?> (without the initial m) has been deprecated and now produces
971a warning. This is to allow future use of C<?> in new operators.
972The match-once functionality is still available in the form of C<m?PATTERN?>.
973
5076a392
FC
974=head2 Tie functions on scalars holding typeglobs
975
976Calling a tie function (C<tie>, C<tied>, C<untie>) with a scalar argument
977acts on a file handle if the scalar happens to hold a typeglob.
978
979This is a long-standing bug that will be removed in Perl 5.16, as
980there is currently no way to tie the scalar itself when it holds
981a typeglob, and no way to untie a scalar that has had a typeglob
982assigned to it.
983
823d0e46 984Now there is a deprecation warning whenever a tie
5076a392
FC
985function is used on a handle without an explicit C<*>.
986
18139a1b 987=head2 User-defined case-mapping
5076a392 988
18139a1b
FC
989This feature is being deprecated due to its many issues, as documented in
990L<perlunicode/User-Defined Case Mappings (for serious hackers only)>.
1c7f7822 991This feature will be removed in Perl 5.16. Instead use the CPAN module
e48f36f0 992L<Unicode::Casing>, which provides improved functionality.
823d0e46 993
18139a1b 994=head2 Deprecated modules
5076a392
FC
995
996The following modules will be removed from the core distribution in a
997future release, and should be installed from CPAN instead. Distributions
a60ea503 998on CPAN which require these should add them to their prerequisites. The
823d0e46 999core versions of these modules will issue a deprecation warning.
5076a392
FC
1000
1001If you ship a packaged version of Perl, either alone or as part of a
1002larger system, then you should carefully consider the repercussions of
823d0e46 1003core module deprecations. You may want to consider shipping your default
5076a392 1004build of Perl with packages for some or all deprecated modules which
823d0e46 1005install into C<vendor> or C<site> perl library directories. This will
5076a392
FC
1006inhibit the deprecation warnings.
1007
1008Alternatively, you may want to consider patching F<lib/deprecate.pm>
1009to provide deprecation warnings specific to your packaging system
1010or distribution of Perl, consistent with how your packaging system
1011or distribution manages a staged transition from a release where the
1012installation of a single package provides the given functionality, to
1013a later release where the system administrator needs to know to install
1014multiple packages to get that same functionality.
1015
1016You can silence these deprecation warnings by installing the modules
1017in question from CPAN. To install the latest version of all of them,
1018just install C<Task::Deprecations::5_14>.
1019
1020=over
1021
1022=item L<Devel::DProf>
1023
1c7f7822
JV
1024We strongly recommend that you install and used L<Devel::NYTProf> instead
1025of this module, as it offers significantly improved profiling and reporting.
5076a392
FC
1026
1027=back
1028
5076a392
FC
1029=head1 Performance Enhancements
1030
54c7bb16 1031=head2 "Safe signals" optimisation
df91d470 1032
a60ea503 1033Signal dispatch has been moved from the runloop into control ops. This
df91d470
FC
1034should give a few percent speed increase, and eliminates almost all of
1035the speed penalty caused by the introduction of "safe signals" in
a60ea503 10365.8.0. Signals should still be dispatched within the same statement as
df91d470
FC
1037they were previously - if this is not the case, or it is possible to
1038create uninterruptible loops, this is a bug, and reports are encouraged
1039of how to recreate such issues.
1040
54c7bb16 1041=head2 Optimisation of shift; and pop; calls without arguments
df91d470 1042
111b6aa7
FC
1043Two fewer OPs are used for shift and pop calls with no argument (with
1044implicit C<@_>). This change makes C<shift;> 5% faster than C<shift @_;>
1045on non-threaded perls and 25% faster on threaded.
df91d470 1046
fa232254 1047=head2 Optimisation of regexp engine string comparison work
df91d470 1048
fa232254
FC
1049The foldEQ_utf8 API function for case-insensitive comparison of strings (which
1050is used heavily by the regexp engine) was substantially refactored and
1051optimised - and its documentation much improved as a free bonus gift.
df91d470 1052
fa232254 1053=head2 Regular expression compilation speed-up
df91d470 1054
fa232254
FC
1055Compiling regular expressions has been made faster for the case where upgrading
1056the regex to utf8 is necessary but that isn't known when the compilation begins.
df91d470 1057
fa232254 1058=head2 String appending is 100 times faster
df91d470 1059
1c7f7822
JV
1060When doing a lot of string appending, perls built to use the system's
1061C<malloc> could end up allocating a lot more memory than needed in a
1062very inefficient way.
fa232254 1063
1c7f7822
JV
1064C<sv_grow>, the function used to allocate more memory if necessary
1065when appending to a string, has been taught how to round up the memory
fa232254
FC
1066it requests to a certain geometric progression, making it much faster on
1067certain platforms and configurations. On Win32, it's now about 100 times
1068faster.
1069
1070=head2 Eliminate C<PL_*> accessor functions under ithreads
1071
1072When C<MULTIPLICITY> was first developed, and interpreter state moved into
1c7f7822
JV
1073an interpreter struct, thread and interpreter local C<PL_*> variables
1074were defined as macros that called accessor functions, returning the
1075address of the value, outside of the perl core. The intent was to allow
1076members within the interpreter struct to change size without breaking
1077binary compatibility, so that bug fixes could be merged to a maintenance
1078branch that necessitated such a size change. This mechanism was redundant
1079and penalised well-behaved code. It has been removed.
fa232254
FC
1080
1081=head2 Freeing weak references
1082
1c7f7822 1083When there are many weak references to an object, freeing that object
fa232254 1084can under some some circumstances take O(N^2) time to free (where N is the
1c7f7822
JV
1085number of references). The number of circumstances in which this can happen
1086has been reduced [perl #75254]
fa232254
FC
1087
1088=head2 Lexical array and hash assignments
1089
1090An earlier optimisation to speed up C<my @array = ...> and
1091C<my %hash = ...> assignments caused a bug and was disabled in Perl 5.12.0.
1092
1093Now we have found another way to speed up these assignments [perl #82110].
df91d470 1094
111b6aa7 1095=head2 C<@_> uses less memory
df91d470 1096
111b6aa7
FC
1097Previously, C<@_> was allocated for every subroutine at compile time with
1098enough space for four entries. Now this allocation is done on demand when
1099the subroutine is called [perl #72416].
5076a392 1100
5076a392
FC
1101=head2 Size optimisations to SV and HV structures
1102
1103xhv_fill has been eliminated from struct xpvhv, saving 1 IV per hash and
a60ea503 1104on some systems will cause struct xpvhv to become cache-aligned. To avoid
5076a392
FC
1105this memory saving causing a slowdown elsewhere, boolean use of HvFILL
1106now calls HvTOTALKEYS instead (which is equivalent) - so while the fill
111b6aa7
FC
1107data when actually required are now calculated on demand, the cases when
1108this needs to be done should be few and far between.
5076a392 1109
111b6aa7
FC
1110The order of structure elements in SV bodies has changed. Effectively,
1111the NV slot has swapped location with STASH and MAGIC. As all access to
1112SV members is via macros, this should be completely transparent. This
5076a392
FC
1113change allows the space saving for PVHVs documented above, and may reduce
1114the memory allocation needed for PVIVs on some architectures.
1115
fa232254
FC
1116C<XPV>, C<XPVIV>, and C<XPVNV> now only allocate the parts of the C<SV> body
1117they actually use, saving some space.
5076a392 1118
fa232254
FC
1119Scalars containing regular expressions now only allocate the part of the C<SV>
1120body they actually use, saving some space.
5076a392
FC
1121
1122=head2 Memory consumption improvements to Exporter
1123
1124The @EXPORT_FAIL AV is no longer created unless required, hence neither is
111b6aa7
FC
1125the typeglob backing it. This saves about 200 bytes for every package that
1126uses Exporter but doesn't use this functionality.
5076a392 1127
111b6aa7 1128=head2 Memory savings for weak references
5076a392 1129
1c7f7822
JV
1130For weak references, the common case of just a single weak reference
1131per referent has been optimised to reduce the storage required. In this
1132case it saves the equivalent of one small Perl array per referent.
5076a392 1133
111b6aa7 1134=head2 C<%+> and C<%-> use less memory
5076a392
FC
1135
1136The bulk of the C<Tie::Hash::NamedCapture> module used to be in the perl
111b6aa7 1137core. It has now been moved to an XS module, to reduce the overhead for
5076a392
FC
1138programs that do not use C<%+> or C<%->.
1139
fa232254 1140=head2 Multiple small improvements to threads
5076a392 1141
fa232254
FC
1142The internal structures of threading now make fewer API calls and fewer
1143allocations, resulting in noticeably smaller object code. Additionally,
1144many thread context checks have been deferred so that they're only done
1145when required (although this is only possible for non-debugging builds).
5076a392 1146
fa232254 1147=head2 Adjacent pairs of nextstate opcodes are now optimized away
5076a392 1148
fa232254 1149Previously, in code such as
5076a392 1150
fa232254 1151 use constant DEBUG => 0;
5076a392 1152
fa232254
FC
1153 sub GAK {
1154 warn if DEBUG;
1155 print "stuff\n";
1156 }
5076a392 1157
fa232254
FC
1158the ops for C<warn if DEBUG;> would be folded to a C<null> op (C<ex-const>), but
1159the C<nextstate> op would remain, resulting in a runtime op dispatch of
1160C<nextstate>, C<nextstate>, ....
5076a392 1161
fa232254
FC
1162The execution of a sequence of C<nextstate> ops is indistinguishable from just
1163the last C<nextstate> op so the peephole optimizer now eliminates the first of
1164a pair of C<nextstate> ops, except where the first carries a label, since labels
1165must not be eliminated by the optimizer and label usage isn't conclusively known
1166at compile time.
5076a392
FC
1167
1168=head1 Modules and Pragmata
1169
1170=head2 New Modules and Pragmata
1171
1172=over 4
1173
1174=item *
1175
1176C<CPAN::Meta::YAML> 0.003 has been added as a dual-life module. It supports a
1177subset of YAML sufficient for reading and writing META.yml and MYMETA.yml files
1178included with CPAN distributions or generated by the module installation
a60ea503 1179toolchain. It should not be used for any other general YAML parsing or
5076a392
FC
1180generation task.
1181
1182=item *
1183
a60ea503 1184C<CPAN::Meta> version 2.110440 has been added as a dual-life module. It
5076a392
FC
1185provides a standard library to read, interpret and write CPAN distribution
1186metadata files (e.g. META.json and META.yml) which describes a
1187distribution, its contents, and the requirements for building it and
a60ea503 1188installing it. The latest CPAN distribution metadata specification is
5076a392
FC
1189included as C<CPAN::Meta::Spec> and notes on changes in the specification
1190over time are given in C<CPAN::Meta::History>.
1191
1192=item *
1193
c0331f42 1194C<HTTP::Tiny> 0.012 has been added as a dual-life module. It is a very
5076a392
FC
1195small, simple HTTP/1.1 client designed for simple GET requests and file
1196mirroring. It has has been added to enable CPAN.pm and CPANPLUS to
1197"bootstrap" HTTP access to CPAN using pure Perl without relying on external
1198binaries like F<curl> or F<wget>.
1199
1200=item *
1201
1c7f7822
JV
1202C<JSON::PP> 2.27105 has been added as a dual-life module to allow CPAN
1203clients to read F<META.json> files in CPAN distributions.
5076a392
FC
1204
1205=item *
1206
21ef4e45 1207C<Module::Metadata> 1.000004 has been added as a dual-life module. It gathers
5076a392
FC
1208package and POD information from Perl module files. It is a standalone module
1209based on Module::Build::ModuleInfo for use by other module installation
1210toolchain components. Module::Build::ModuleInfo has been deprecated in
1211favor of this module instead.
1212
1213=item *
1214
1215C<Perl::OSType> 1.002 has been added as a dual-life module. It maps Perl
1216operating system names (e.g. 'dragonfly' or 'MSWin32') to more generic types
1217with standardized names (e.g. "Unix" or "Windows"). It has been refactored
1218out of Module::Build and ExtUtils::CBuilder and consolidates such mappings into
1219a single location for easier maintenance.
1220
1221=item *
1222
1223The following modules were added by the C<Unicode::Collate>
a60ea503 1224upgrade. See below for details.
5076a392
FC
1225
1226C<Unicode::Collate::CJK::Big5>
1227
1228C<Unicode::Collate::CJK::GB2312>
1229
1230C<Unicode::Collate::CJK::JISX0208>
1231
1232C<Unicode::Collate::CJK::Korean>
1233
1234C<Unicode::Collate::CJK::Pinyin>
1235
1236C<Unicode::Collate::CJK::Stroke>
1237
1238=item *
1239
1240C<Version::Requirements> version 0.101020 has been added as a dual-life
1241module. It provides a standard library to model and manipulates module
1242prerequisites and version constraints as defined in the L<CPAN::Meta::Spec>.
1243
1244=back
1245
a5794e94 1246=head2 Updated Modules and Pragma
5076a392
FC
1247
1248=over 4
1249
1250=item *
1251
81a53be2
FR
1252C<attributes> has been upgraded from version 0.12 to 0.14.
1253
1254=item *
1255
5076a392
FC
1256C<Archive::Extract> has been upgraded from version 0.38 to 0.48.
1257
1258Updates since 0.38 include: a safe print method that guards
1259Archive::Extract from changes to $\; a fix to the tests when run in core
1984204c
FC
1260perl; support for TZ files; a modification for the lzma
1261logic to favour IO::Uncompress::Unlzma; and a fix
1262for an issue with NetBSD-current and its new unzip
5076a392
FC
1263executable.
1264
1265=item *
1266
1267C<Archive::Tar> has been upgraded from version 1.54 to 1.76.
1268
1984204c
FC
1269Important changes since 1.54 include the following:
1270
1271=over
1272
1273=item *
1274
1275Compatibility with busybox implementations of tar
1276
1277=item *
1278
1279A fix so that C<write()> and C<create_archive()>
1280close only handles they opened
1281
1282=item *
1283
1284A bug was fixed regarding the exit code of extract_archive.
5076a392 1285
1984204c
FC
1286=item *
1287
4f978a3b 1288The C<ptar> utility has a new option to allow safe
5076a392
FC
1289creation of tarballs without world-writable files on Windows, allowing those
1290archives to be uploaded to CPAN.
1291
1984204c
FC
1292=item *
1293
1294A new ptargrep utility for using regular expressions against
5076a392
FC
1295the contents of files in a tar archive.
1296
1984204c
FC
1297=item *
1298
1299Pax extended headers are now skipped.
1300
1301=back
5076a392
FC
1302
1303=item *
1304
fcd5df6d
FR
1305C<Attribute::Handlers> has been upgraded from version 0.87 to 0.89.
1306
1307=item *
1308
3f5a47e4
FR
1309C<autodie> has been upgraded from version 2.06_01 to 2.1001.
1310
1311=item *
1312
578e7c9d
FR
1313C<AutoLoader> has been upgraded from version 5.70 to 5.71.
1314
1315=item *
1316
a13baafd 1317C<B> has been upgraded from version 1.23 to 1.29.
5076a392
FC
1318
1319It no longer crashes when taking apart a C<y///> containing characters
1320outside the octet range or compiled in a C<use utf8> scope.
1321
1322The size of the shared object has been reduced by about 40%, with no
1323reduction in functionality.
1324
1325=item *
1326
4a75fbf5 1327C<B::Concise> has been upgraded from version 0.78 to 0.83.
5076a392
FC
1328
1329B::Concise marks rv2sv, rv2av and rv2hv ops with the new OPpDEREF flag
1330as "DREFed".
1331
1332It no longer produces mangled output with the C<-tree> option
1333[perl #80632].
1334
1335=item *
1336
6bb8c1e3
FR
1337C<B::Debug> has been upgraded from version 1.12 to 1.16.
1338
1339=item *
1340
c67a4e29 1341C<B::Deparse> has been upgraded from version 0.96 to 1.03.
5076a392 1342
1984204c 1343The deparsing of a nextstate op has changed when it has both a
5076a392
FC
1344change of package (relative to the previous nextstate), or a change of
1345C<%^H> or other state, and a label. Previously the label was emitted
cdc10f43 1346first, but now the label is emitted last (5.12.1).
5076a392 1347
5a553547
FC
1348The C<no 5.13.2> or similar form is now correctly handled by B::Deparse
1349(5.12.3).
5076a392
FC
1350
1351B::Deparse now properly handles the code that applies a conditional
1352pattern match against implicit C<$_> as it was fixed in [perl #20444].
1353
1984204c
FC
1354Deparsing of C<our> followed by a variable with funny characters
1355(as permitted under the C<utf8> pragma) has also been fixed [perl #33752].
5076a392
FC
1356
1357=item *
1358
d97c5d3b
FR
1359C<B::Lint> has been upgraded from version 1.11_01 to 1.13.
1360
1361=item *
1362
5aef2c44
FR
1363C<base> has been upgraded from version 2.15 to 2.16.
1364
1365=item *
1366
876607aa
FR
1367C<Benchmark> has been upgraded from version 1.11 to 1.12.
1368
1369=item *
1370
0f3a8103 1371C<bignum> has been upgraded from version 0.23 to 0.27.
e539ae69
FR
1372
1373=item *
1374
c74c1fa8 1375C<Carp> has been upgraded from version 1.15 to 1.20.
5076a392
FC
1376
1377L<Carp> now detects incomplete L<caller()|perlfunc/"caller EXPR"> overrides and
d430b8e7
FC
1378avoids using bogus C<@DB::args>. To provide backtraces,
1379Carp relies on particular behaviour of the C<caller>
1380built-in. Carp now detects if other code has
5076a392 1381overridden this with an incomplete implementation, and modifies its backtrace
d430b8e7
FC
1382accordingly. Previously incomplete overrides would cause incorrect values
1383in backtraces (best case), or obscure fatal errors (worst case).
5076a392
FC
1384
1385This fixes certain cases of C<Bizarre copy of ARRAY> caused by modules
d430b8e7 1386overriding C<caller()> incorrectly (5.12.2).
5076a392 1387
1984204c 1388It now also avoids using regular expressions that cause perl to
5076a392
FC
1389load its Unicode tables, in order to avoid the 'BEGIN not safe after
1390errors' error that will ensue if there has been a syntax error
1391[perl #82854].
1392
1393=item *
1394
9eb7ad55 1395C<CGI> has been upgraded from version 3.48 to 3.52.
5076a392
FC
1396
1397This provides the following security fixes: the MIME boundary in
1984204c
FC
1398multipart_init is now random and the handling of
1399newlines embedded in header values has been improved.
5076a392
FC
1400
1401=item *
1402
5076a392
FC
1403C<Compress::Raw::Bzip2> has been upgraded from version 2.024 to 2.033.
1404
1984204c 1405It has been updated to use bzip2 1.0.6.
5076a392
FC
1406
1407=item *
1408
51090521
FR
1409C<Compress::Raw::Zlib> has been upgraded from version 2.024 to 2.033.
1410
1411=item *
1412
87c7b53d
FC
1413C<constant> has been upgraded from version 1.20 to 1.21.
1414
1415Unicode constants work once more. They have been broken since perl 5.10.0
1416[CPAN RT #67525].
1417
1418=item *
1419
f75b7efc 1420C<CPAN> has been upgraded from version 1.94_56 to 1.9600.
1984204c
FC
1421
1422Major highlights:
5076a392
FC
1423
1424=over 4
1425
1984204c 1426=item * much less configuration dialog hassle
5076a392 1427
1984204c 1428=item * support for META/MYMETA.json
5076a392 1429
1984204c 1430=item * support for local::lib
5076a392 1431
1984204c 1432=item * support for HTTP::Tiny to reduce the dependency on ftp sites
5076a392 1433
1984204c 1434=item * automatic mirror selection
5076a392 1435
1984204c 1436=item * iron out all known bugs in configure_requires
5076a392 1437
1984204c
FC
1438=item * support for distributions compressed with bzip2
1439
1440=item * allow Foo/Bar.pm on the commandline to mean Foo::Bar
1441
1442=back
5076a392
FC
1443
1444=item *
1445
d430b8e7
FC
1446C<CPANPLUS> has been upgraded from version 0.90 to 0.9103.
1447
1448A change to F<cpanp-run-perl>
1449resolves L<RT #55964|http://rt.cpan.org/Public/Bug/Display.html?id=55964>
1450and L<RT #57106|http://rt.cpan.org/Public/Bug/Display.html?id=57106>, both
1451of which related to failures to install distributions that use
1452C<Module::Install::DSL> (5.12.2).
5076a392 1453
1984204c
FC
1454A dependency on Config was not recognised as a
1455core module dependency. This has been fixed.
5076a392 1456
1984204c 1457CPANPLUS now includes support for META.json and MYMETA.json.
5076a392
FC
1458
1459=item *
1460
4467e8f7
FR
1461C<CPANPLUS::Dist::Build> has been upgraded from version 0.46 to 0.54.
1462
1463=item *
1464
5076a392
FC
1465C<Data::Dumper> has been upgraded from version 2.125 to 2.130_02.
1466
4ed2cea4
FC
1467The indentation used to be off when C<$Data::Dumper::Terse> was set. This
1468has been fixed [perl #73604].
1469
1984204c
FC
1470This upgrade also fixes a crash when using custom sort functions that might
1471cause the stack to change [perl #74170].
5076a392
FC
1472
1473C<Dumpxs> no longer crashes with globs returned by C<*$io_ref>
1474[perl #72332].
1475
1476=item *
1477
549d34f5
FR
1478C<DB_File> has been upgraded from version 1.820 to 1.821.
1479
1480=item *
1481
851dbda2
FR
1482C<DBM_Filter> has been upgraded from version 0.03 to 0.04.
1483
1484=item *
1485
5076a392
FC
1486C<Devel::DProf> has been upgraded from version 20080331.00 to 20110228.00.
1487
1488Merely loading C<Devel::DProf> now no longer triggers profiling to start.
1489C<use Devel::DProf> and C<perl -d:DProf ...> still behave as before and start
1490the profiler.
1491
1492NOTE: C<Devel::DProf> is deprecated and will be removed from a future
1984204c 1493version of Perl. We strongly recommend that you install and use
5076a392
FC
1494L<Devel::NYTProf> instead, as it offers significantly improved
1495profiling and reporting.
1496
1497=item *
1498
868625d2
FR
1499C<Devel::Peek> has been upgraded from version 1.04 to 1.07.
1500
1501=item *
1502
66899ca3
FR
1503C<Devel::SelfStubber> has been upgraded from version 1.03 to 1.05.
1504
1505=item *
1506
5076a392
FC
1507C<diagnostics> has been upgraded from version 1.19 to 1.22.
1508
1509It now renders pod links slightly better, and has been taught to find
1510descriptions for messages that share their descriptions with other
1511messages.
1512
1513=item *
1514
1515C<Digest::MD5> has been upgraded from version 2.39 to 2.51.
1516
1517It is now safe to use this module in combination with threads.
1518
1519=item *
1520
1521C<Digest::SHA> has been upgraded from version 5.47 to 5.61.
1522
1523C<shasum> now more closely mimics C<sha1sum>/C<md5sum>.
1524
1525C<Addfile> accepts all POSIX filenames.
1526
1984204c
FC
1527New SHA-512/224 and SHA-512/256 transforms (ref. NIST Draft FIPS 180-4
1528[February 2011])
5076a392
FC
1529
1530=item *
1531
88410521
FR
1532C<DirHandle> has been upgraded from version 1.03 to 1.04.
1533
1534=item *
1535
e53cbaa3
FR
1536C<Dumpvalue> has been upgraded from version 1.13 to 1.16.
1537
1538=item *
1539
31e8b85a 1540C<DynaLoader> has been upgraded from version 1.10 to 1.13.
5076a392
FC
1541
1542It fixes a buffer overflow when passed a very long file name.
1543
1544It no longer inherits from AutoLoader; hence it no longer
1545produces weird error messages for unsuccessful method calls on classes that
1546inherit from DynaLoader [perl #84358].
1547
1548=item *
1549
1550C<Encode> has been upgraded from version 2.39 to 2.42.
1551
1552Now, all 66 Unicode non-characters are treated the same way U+FFFF has
1984204c
FC
1553always been treated; in cases when it was disallowed, all 66 are
1554disallowed; in those cases where it warned, all 66 warn.
5076a392
FC
1555
1556=item *
1557
68f90ac3
FR
1558C<Env> has been upgraded from version 1.01 to 1.02.
1559
1560=item *
1561
5076a392
FC
1562C<Errno> has been upgraded from version 1.11 to 1.13.
1563
1564The implementation of C<Errno> has been refactored to use about 55% less memory.
5076a392
FC
1565
1566On some platforms with unusual header files, like Win32/gcc using mingw64
1567headers, some constants which weren't actually error numbers have been exposed
1568by C<Errno>. This has been fixed [perl #77416].
1569
1570=item *
1571
1572C<Exporter> has been upgraded from version 5.64_01 to 5.64_03.
1573
1574Exporter no longer overrides C<$SIG{__WARN__}> [perl #74472]
1575
1576=item *
1577
7287d036 1578C<ExtUtils::CBuilder> has been upgraded from version 0.27 to 0.280203.
25fe7f8f
FR
1579
1580=item *
1581
2292e71e
FR
1582C<ExtUtils::Command> has been upgraded from version 1.16 to 1.17.
1583
1584=item *
1585
5076a392
FC
1586C<ExtUtils::Constant> has been upgraded from 0.22 to 0.23.
1587
1588The C<AUTOLOAD> helper code generated by C<ExtUtils::Constant::ProxySubs>
1589can now C<croak> for missing constants, or generate a complete C<AUTOLOAD>
1984204c
FC
1590subroutine in XS, allowing simplification of many modules that use it
1591(C<Fcntl>, C<File::Glob>, C<GDBM_File>, C<I18N::Langinfo>, C<POSIX>,
1592C<Socket>).
5076a392
FC
1593
1594C<ExtUtils::Constant::ProxySubs> can now optionally push the names of all
1984204c 1595constants onto the package's C<@EXPORT_OK>.
5076a392
FC
1596
1597=item *
1598
588c5853
FR
1599C<ExtUtils::Install> has been upgraded from version 1.55 to 1.56.
1600
1601=item *
1602
5418ffb3
FR
1603C<ExtUtils::MakeMaker> has been upgraded from version 6.56 to 6.57_05.
1604
1605=item *
1606
f40ab45f
FR
1607C<ExtUtils::Manifest> has been upgraded from version 1.57 to 1.58.
1608
1609=item *
1610
10fb15d2 1611C<ExtUtils::ParseXS> has been upgraded from version 2.21 to 2.2210.
b7064dd7
FR
1612
1613=item *
1614
8b87be80 1615C<Fcntl> has been upgraded from version 1.06 to 1.11.
26f7fa64
FR
1616
1617=item *
1618
da25e274 1619C<File::Basename> has been upgraded from version 2.78 to 2.82.
8b87be80
FR
1620
1621=item *
1622
05102622
FR
1623C<File::CheckTree> has been upgraded from version 4.4 to 4.41.
1624
1625=item *
1626
65d78858
FR
1627C<File::Copy> has been upgraded from version 2.17 to 2.21.
1628
1629=item *
1630
e12786fa 1631C<File::DosGlob> has been upgraded from version 1.01 to 1.04.
5076a392
FC
1632
1633It allows patterns containing literal parentheses (they no longer need to
1984204c
FC
1634be escaped). On Windows, it no longer
1635adds an extra F<./> to the file names
5076a392
FC
1636returned when the pattern is a relative glob with a drive specification,
1637like F<c:*.pl> [perl #71712].
1638
1639=item *
1640
1641C<File::Fetch> has been upgraded from version 0.24 to 0.32.
1642
1643C<HTTP::Lite> is now supported for 'http' scheme.
1644
1645The C<fetch> utility is supported on FreeBSD, NetBSD and
1646Dragonfly BSD for the C<http> and C<ftp> schemes.
1647
1648=item *
1649
23f2cbb1 1650C<File::Find> has been upgraded from version 1.15 to 1.19.
5076a392 1651
1984204c 1652It improves handling of backslashes on Windows, so that paths like
5076a392
FC
1653F<c:\dir\/file> are no longer generated [perl #71710].
1654
1655=item *
1656
0ae9f678
FR
1657C<File::Glob> has been upgraded from version 1.07 to 1.12.
1658
1659=item *
1660
d430b8e7
FC
1661C<File::Spec> has been upgraded from version 3.31 to 3.33.
1662
1663Several portability fixes were made in C<File::Spec::VMS>: a colon is now
1664recognized as a delimiter in native filespecs; caret-escaped delimiters are
1665recognized for better handling of extended filespecs; C<catpath()> returns
1666an empty directory rather than the current directory if the input directory
1667name is empty; C<abs2rel()> properly handles Unix-style input (5.12.2).
1668
1669=item *
1670
46ba0657 1671C<File::stat> has been upgraded from 1.02 to 1.05.
5076a392
FC
1672
1673The C<-x> and C<-X> file test operators now work correctly under the root
1674user.
1675
1676=item *
1677
b7edcc3c
FR
1678C<Filter::Simple> has been upgraded from version 0.84 to 0.86.
1679
1680=item *
1681
dc6857fd 1682C<GDBM_File> has been upgraded from 1.10 to 1.14.
5076a392
FC
1683
1684This fixes a memory leak when DBM filters are used.
1685
1686=item *
1687
6e107b45 1688C<Hash::Util> has been upgraded from 0.07 to 0.11.
5076a392 1689
1984204c
FC
1690Hash::Util no longer emits spurious "uninitialized" warnings when
1691recursively locking hashes that have undefined values [perl #74280].
5076a392
FC
1692
1693=item *
1694
89ce9b34
FR
1695C<Hash::Util::FieldHash> has been upgraded from version 1.04 to 1.09.
1696
1697=item *
1698
eec33fe6
FR
1699C<I18N::Collate> has been upgraded from version 1.01 to 1.02.
1700
1701=item *
1702
ad5f8f47 1703C<I18N::Langinfo> has been upgraded from version 0.03 to 0.08.
5076a392
FC
1704
1705C<langinfo()> now defaults to using C<$_> if there is no argument given, just
5334145a 1706as the documentation has always claimed.
5076a392
FC
1707
1708=item *
1709
c41635f7
FR
1710C<I18N::LangTags> has been upgraded from version 0.35 to 0.35_01.
1711
1712=item *
1713
98a6a4ff
FR
1714C<if> has been upgraded from version 0.05 to 0.0601.
1715
1716=item *
1717
f6ff7fb6
FR
1718C<IO> has been upgraded from version 1.25_02 to 1.25_04.
1719
582bf58c
FR
1720This version of C<IO> includes a new C<IO::Select>, which now allows IO::Handle
1721objects (and objects in derived classes) to be removed from an IO::Select set
1722even if the underlying file descriptor is closed or invalid.
5076a392
FC
1723
1724=item *
1725
d07561d3 1726C<IPC::Cmd> has been upgraded from version 0.54 to 0.70.
5076a392 1727
1984204c
FC
1728Resolves an issue with splitting Win32 command lines. An argument
1729consisting of the single character "0" used to be omitted (CPAN RT #62961).
5076a392
FC
1730
1731=item *
1732
3f16e4eb 1733C<IPC::Open3> has been upgraded from 1.05 to 1.09.
5076a392 1734
4ed2cea4
FC
1735C<open3> now produces an error if the C<exec> call fails, allowing this
1736condition to be distinguished from a child process that exited with a
1737non-zero status [perl #72016].
1738
5076a392
FC
1739The internal C<xclose> routine now knows how to handle file descriptors, as
1740documented, so duplicating STDIN in a child process using its file
1741descriptor now works [perl #76474].
1742
1743=item *
1744
c8b41807
FR
1745C<IPC::SysV> has been upgraded from version 2.01 to 2.03.
1746
1747=item *
1748
ef79f038
FR
1749C<lib> has been upgraded from version 0.62 to 0.63.
1750
1751=item *
1752
5b1884f4 1753C<Locale::Maketext> has been upgraded from version 1.14 to 1.19.
5076a392 1754
1984204c 1755Locale::Maketext now supports external caches.
5076a392 1756
1984204c
FC
1757This upgrade also fixes an infinite loop in
1758C<Locale::Maketext::Guts::_compile()> when
5076a392
FC
1759working with tainted values (CPAN RT #40727).
1760
1984204c 1761C<< ->maketext >> calls will now back up and restore C<$@> so that error
5076a392
FC
1762messages are not suppressed (CPAN RT #34182).
1763
1764=item *
1765
3811bd2b
FR
1766C<Log::Message> has been upgraded from version 0.02 to 0.04.
1767
1768=item *
1769
8eb65377
FR
1770C<Log::Message::Simple> has been upgraded from version 0.06 to 0.08.
1771
1772=item *
1773
5076a392
FC
1774C<Math::BigInt> has been upgraded from version 1.89_01 to 1.994.
1775
1776This fixes, among other things, incorrect results when computing binomial
1777coefficients [perl #77640].
1778
1984204c 1779It also prevents C<sqrt($int)> from crashing under C<use bigrat;>
5076a392
FC
1780[perl #73534].
1781
1782=item *
1783
846c1cec
FR
1784C<Math::BigInt::FastCalc> has been upgraded from version 0.19 to 0.28.
1785
1786=item *
1787
fce4aef3
FR
1788C<Math::BigRat> has been upgraded from version 0.24 to 0.26_02.
1789
1790=item *
1791
12e26027
FR
1792C<Memoize> has been upgraded from version 1.01_03 to 1.02.
1793
1794=item *
1795
5076a392
FC
1796C<MIME::Base64> has been upgraded from 3.08 to 3.13.
1797
1798Includes new functions to calculate the length of encoded and decoded
1799base64 strings.
1800
1801Now provides C<encode_base64url> and C<decode_base64url> functions to process
1802the base64 scheme for "URL applications".
1803
1804=item *
1805
1806C<Module::Build> has been upgraded from version 0.3603 to 0.3800.
1807
1808A notable change is the deprecation of several modules.
1809Module::Build::Version has been deprecated and Module::Build now relies
1810directly upon L<version>. Module::Build::ModuleInfo has been deprecated in
1811favor of a standalone copy of it called L<Module::Metadata>.
1812Module::Build::YAML has been deprecated in favor of L<CPAN::Meta::YAML>.
1813
1814Module::Build now also generates META.json and MYMETA.json files
1815in accordance with version 2 of the CPAN distribution metadata specification,
1816L<CPAN::Meta::Spec>. The older format META.yml and MYMETA.yml files are
1817still generated, as well.
1818
1819=item *
1820
7259fe26 1821C<Module::CoreList> has been upgraded from version 2.29 to 2.47.
5076a392
FC
1822
1823Besides listing the updated core modules of this release, it also stops listing
1984204c 1824the C<Filespec> module. That module never existed in core. The scripts
5076a392 1825generating C<Module::CoreList> confused it with C<VMS::Filespec>, which actually
1984204c 1826is a core module as of perl 5.8.7.
5076a392
FC
1827
1828=item *
1829
193af05b
FR
1830C<Module::Load> has been upgraded from version 0.16 to 0.18.
1831
1832=item *
1833
5b3a054f
FR
1834C<Module::Load::Conditional> has been upgraded from version 0.34 to 0.44.
1835
1836=item *
1837
01835e3a
FR
1838C<mro> has been upgraded from version 1.02 to 1.07.
1839
1840=item *
1841
bfe7bf96 1842C<NDBM_File> has been upgraded from version 1.08 to 1.12.
4f978a3b
FR
1843
1844This fixes a memory leak when DBM filters are used.
1845
1846=item *
1847
d0aa5c91
FR
1848C<Net::Ping> has been upgraded from version 2.36 to 2.38.
1849
1850=item *
1851
d44b8a8c
FR
1852C<NEXT> has been upgraded from version 0.64 to 0.65.
1853
1854=item *
1855
678d4fd4
FR
1856C<Object::Accessor> has been upgraded from version 0.36 to 0.38.
1857
1858=item *
1859
34188656 1860C<ODBM_File> have been upgraded from version 1.07 to 1.10.
5076a392
FC
1861
1862This fixes a memory leak when DBM filters are used.
1863
1864=item *
1865
4c69840c
FR
1866C<Opcode> has been upgraded from version 1.15 to 1.18.
1867
1868=item *
1869
f4c5ae54 1870C<overload> has been upgraded from 1.10 to 1.13.
5076a392
FC
1871
1872C<overload::Method> can now handle subroutines that are themselves blessed
1873into overloaded classes [perl #71998].
1874
5076a392
FC
1875The documentation has greatly improved. See L</Documentation> below.
1876
1877=item *
1878
f84c796e
FR
1879C<Params::Check> has been upgraded from version 0.26 to 0.28.
1880
1881=item *
1882
550ee92b
FR
1883C<parent> has been upgraded from version 0.223 to 0.225.
1884
1885=item *
1886
5076a392
FC
1887C<Parse::CPAN::Meta> has been upgraded from version 1.40 to 1.4401.
1888
1984204c 1889The latest Parse::CPAN::Meta can now read YAML and JSON files using
5076a392
FC
1890L<CPAN::Meta::YAML> and L<JSON::PP>, which are now part of the Perl core.
1891
1892=item *
1893
e981cf86
FR
1894C<PerlIO::encoding> has been upgraded from version 0.12 to 0.14.
1895
1896=item *
1897
5076a392
FC
1898C<PerlIO::scalar> has been upgraded from 0.07 to 0.11.
1899
1900A C<read> after a C<seek> beyond the end of the string no longer thinks it
1901has data to read [perl #78716].
1902
1903=item *
1904
776f733b
FR
1905C<PerlIO::via> has been upgraded from version 0.09 to 0.11.
1906
1907=item *
1908
cb1db9bd 1909C<Pod::Html> has been upgraded from version 1.09 to 1.11.
ae9456cc
FR
1910
1911=item *
1912
be3c8498
FR
1913C<Pod::LaTeX> has been upgraded from version 0.58 to 0.59.
1914
1915=item *
1916
fd8a2e89
FR
1917C<Pod::Perldoc> has been upgraded from version 3.15_02 to 3.15_03.
1918
1919=item *
1920
5bcb6583
FR
1921C<Pod::Simple> has been upgraded from version 3.13 to 3.16.
1922
1923=item *
1924
abb8c779 1925C<POSIX> has been upgraded from 1.19 to 1.24.
5076a392
FC
1926
1927It now includes constants for POSIX signal constants.
1928
1929=item *
1930
aa6faf7a 1931C<re> has been upgraded from version 0.11 to 0.18.
5076a392
FC
1932
1933New C<use re "/flags"> pragma
1934
5076a392 1935The C<regmust> function used to crash when called on a regular expression
1984204c 1936belonging to a pluggable engine. Now it croaks instead.
5076a392
FC
1937
1938C<regmust> no longer leaks memory.
1939
1940=item *
1941
1942C<Safe> has been upgraded from version 2.25 to 2.29.
1943
cdc10f43
FC
1944Coderefs returned by C<reval()> and C<rdo()> are now wrapped via
1945C<wrap_code_refs> (5.12.1).
1946
5076a392
FC
1947This fixes a possible infinite loop when looking for coderefs.
1948
cdc10f43 1949It adds several version::vxs::* routines to the default share.
5076a392
FC
1950
1951=item *
1952
2c19fa42
FR
1953C<SDBM_File> has been upgraded from version 1.06 to 1.09.
1954
1955=item *
1956
5076a392
FC
1957C<SelfLoader> has been upgraded from 1.17 to 1.18.
1958
1959It now works in taint mode [perl #72062].
1960
1961=item *
1962
1963C<sigtrap> has been upgraded from version 1.04 to 1.05.
1964
1965It no longer tries to modify read-only arguments when generating a
1966backtrace [perl #72340].
1967
1968=item *
1969
1984204c 1970C<Socket> has been upgraded from version 1.87 to 1.94.
5076a392 1971
1c7f7822 1972See L</Improved IPv6 support>, above.
5076a392
FC
1973
1974=item *
1975
1976C<Storable> has been upgraded from version 2.22 to 2.27.
1977
1978Includes performance improvement for overloaded classes.
1979
5076a392 1980This adds support for serialising code references that contain UTF-8 strings
1984204c
FC
1981correctly. The Storable minor version
1982number changed as a result, meaning that
5076a392
FC
1983Storable users who set C<$Storable::accept_future_minor> to a C<FALSE> value
1984will see errors (see L<Storable/FORWARD COMPATIBILITY> for more details).
1985
1986Freezing no longer gets confused if the Perl stack gets reallocated
1987during freezing [perl #80074].
1988
1989=item *
1990
648c3d7d
FR
1991C<Sys::Hostname> has been upgraded from version 1.11 to 1.16.
1992
1993=item *
1994
90c6e78f
FR
1995C<Term::ANSIColor> has been upgraded from version 2.02 to 3.00.
1996
1997=item *
1998
d9f2f059
FR
1999C<Term::UI> has been upgraded from version 0.20 to 0.26.
2000
2001=item *
2002
80ebb519
FR
2003C<Test::Harness> has been upgraded from version 3.17 to 3.23.
2004
2005=item *
2006
5076a392
FC
2007C<Test::Simple> has been upgraded from version 0.94 to 0.98.
2008
2009Among many other things, subtests without a C<plan> or C<no_plan> now have an
2010implicit C<done_testing()> added to them.
2011
2012=item *
2013
5076a392
FC
2014C<Thread::Semaphore> has been upgraded from version 2.09 to 2.12.
2015
1984204c
FC
2016It provides two new methods that give more control over the decrementing of
2017semaphores: C<down_nb> and C<down_force>.
5076a392
FC
2018
2019=item *
2020
f0d895e1
FR
2021C<Thread::Queue> has been upgraded from version 2.11 to 2.12.
2022
2023=item *
2024
1a6b954e
FR
2025C<threads> has been upgraded from version 1.75 to 1.83.
2026
2027=item *
2028
55816daa
FR
2029C<threads::shared> has been upgraded from version 1.32 to 1.36.
2030
2031=item *
2032
5076a392
FC
2033C<Tie::Hash> has been upgraded from version 1.03 to 1.04.
2034
2035Calling C<< Tie::Hash-E<gt>TIEHASH() >> used to loop forever. Now it C<croak>s.
2036
2037=item *
2038
f2adc546
FR
2039C<Tie::Hash::NamedCapture> has been upgraded from version 0.06 to 0.08.
2040
2041=item *
2042
ed68b07e
FR
2043C<Tie::RefHash> has been upgraded from version 1.38 to 1.39.
2044
2045=item *
2046
bb3c221a
FR
2047C<Time::HiRes> has been upgraded from version 1.9719 to 1.9721_01.
2048
2049=item *
2050
97fa568b
FR
2051C<Time::Local> has been upgraded from version 1.1901_01 to 1.2000.
2052
2053=item *
2054
a83cb732
FR
2055C<Time::Piece> has been upgraded from version 1.15_01 to 1.20_01.
2056
2057=item *
2058
5076a392
FC
2059C<Unicode::Collate> has been upgraded from version 0.52_01 to 0.73.
2060
1984204c 2061Unicode::Collate has been updated to use Unicode 6.0.0.
5076a392 2062
1984204c
FC
2063Unicode::Collate::Locale now supports a plethora of new locales: ar, be,
2064bg, de__phonebook, hu, hy, kk, mk, nso, om, tn, vi, hr, ig, ja, ko, ru, sq,
2065se, sr, to, uk, zh, zh__big5han, zh__gb2312han, zh__pinyin and zh__stroke.
5076a392
FC
2066
2067The following modules have been added:
2068
2069C<Unicode::Collate::CJK::Big5> for C<zh__big5han> which makes
2070tailoring of CJK Unified Ideographs in the order of CLDR's big5han ordering.
2071
2072C<Unicode::Collate::CJK::GB2312> for C<zh__gb2312han> which makes
2073tailoring of CJK Unified Ideographs in the order of CLDR's gb2312han ordering.
2074
2075C<Unicode::Collate::CJK::JISX0208> which makes tailoring of 6355 kanji
2076(CJK Unified Ideographs) in the JIS X 0208 order.
2077
2078C<Unicode::Collate::CJK::Korean> which makes tailoring of CJK Unified Ideographs
2079in the order of CLDR's Korean ordering.
2080
2081C<Unicode::Collate::CJK::Pinyin> for C<zh__pinyin> which makes
2082tailoring of CJK Unified Ideographs in the order of CLDR's pinyin ordering.
2083
2084C<Unicode::Collate::CJK::Stroke> for C<zh__stroke> which makes
2085tailoring of CJK Unified Ideographs in the order of CLDR's stroke ordering.
2086
5076a392
FC
2087This also sees the switch from using the pure-perl version of this
2088module to the XS version.
2089
2090=item *
2091
ec52b54b
FR
2092C<Unicode::Normalize> has been upgraded from version 1.03 to 1.10.
2093
2094=item *
2095
5076a392
FC
2096C<Unicode::UCD> has been upgraded from version 0.27 to 0.32.
2097
1984204c
FC
2098A new function, C<Unicode::UCD::num()>, has been added. This function
2099returns the numeric value of the string passed it or C<undef> if the string
2100in its entirety has no "safe" numeric value. (For more detail, and for the
2101definition of "safe", see L<Unicode::UCD/num>.)
5076a392 2102
1984204c 2103This upgrade also includes a number of bug fixes:
5076a392
FC
2104
2105=over 4
2106
2107=item charinfo()
2108
2109=over 4
2110
2111=item *
2112
2113It is now updated to Unicode Version 6 with Corrigendum #8, except,
2114as with Perl 5.14, the code point at U+1F514 has no name.
2115
2116=item *
2117
2118The Hangul syllable code points have the correct names, and their
2119decompositions are always output without requiring L<Lingua::KO::Hangul::Util>
2120to be installed.
2121
2122=item *
2123
54c7bb16
FC
2124The CJK (Chinese-Japanese-Korean) code points U+2A700 to U+2B734
2125and U+2B740 to U+2B81D are now properly handled.
5076a392
FC
2126
2127=item *
2128
2129The numeric values are now output for those CJK code points that have them.
2130
2131=item *
2132
2133The names that are output for code points with multiple aliases are now the
2134corrected ones.
2135
2136=back
2137
2138=item charscript()
2139
2140This now correctly returns "Unknown" instead of C<undef> for the script
2141of a code point that hasn't been assigned another one.
2142
2143=item charblock()
2144
2145This now correctly returns "No_Block" instead of C<undef> for the block
2146of a code point that hasn't been assigned to another one.
2147
2148=back
2149
5076a392
FC
2150=item *
2151
2152C<version> has been upgraded from 0.82 to 0.88.
2153
1984204c 2154Due to a bug, now fixed, the C<is_strict> and C<is_lax> functions did not
cdc10f43 2155work when exported (5.12.1).
5076a392
FC
2156
2157=item *
2158
3e625598 2159C<warnings> has been upgraded from version 1.09 to 1.12.
5076a392
FC
2160
2161Calling C<use warnings> without arguments is now significantly more efficient.
2162
4f978a3b
FR
2163=item *
2164
2165C<warnings::register> have been upgraded from version 1.01 to 1.02.
2166
5076a392
FC
2167It is now possible to register warning categories other than the names of
2168packages using C<warnings::register>. See L<perllexwarn> for more information.
2169
2170=item *
2171
62e270c2
FR
2172C<XSLoader> has been upgraded from version 0.10 to 0.13.
2173
2174=item *
2175
5076a392
FC
2176C<VMS::DCLsym> has been upgraded from version 1.03 to 1.05.
2177
2178Two bugs have been fixed [perl #84086]:
2179
2180The symbol table name was lost when tying a hash, due to a thinko in
2181C<TIEHASH>. The result was that all tied hashes interacted with the
2182local symbol table.
2183
2184Unless a symbol table name had been explicitly specified in the call
2185to the constructor, querying the special key ':LOCAL' failed to
2186identify objects connected to the local symbol table.
2187
2188=item *
2189
2190C<Win32> has been upgraded from version 0.39 to 0.44.
2191
1984204c
FC
2192This release has several new functions: C<Win32::GetSystemMetrics>,
2193C<Win32::GetProductInfo>, C<Win32::GetOSDisplayName>.
5076a392 2194
1984204c
FC
2195The names returned by C<Win32::GetOSName> and C<Win32::GetOSDisplayName>
2196have been corrected.
5076a392 2197
3bbe5383
FR
2198=item *
2199
2200C<XS::Typemap> has been upgraded from version 0.03 to 0.05.
2201
5076a392
FC
2202=back
2203
5076a392
FC
2204=head2 Removed Modules and Pragmata
2205
1c7f7822
JV
2206As promised in Perl 5.12.0's release notes, the following modules have
2207been removed from the core distribution, and if needed should be installed
2208from CPAN instead.
5076a392
FC
2209
2210=over
2211
4f978a3b
FR
2212=item *
2213
2214C<Class::ISA> has been removed from the Perl core. Prior version was 0.36.
5076a392 2215
4f978a3b
FR
2216=item *
2217
2218C<Pod::Plainer> has been removed from the Perl core. Prior version was 1.02.
2219
2220=item *
5076a392 2221
4f978a3b 2222C<Switch> has been removed from the Perl core. Prior version was 2.16.
5076a392
FC
2223
2224=back
2225
2226The removal of C<Shell> has been deferred until after 5.14, as the
2227implementation of C<Shell> shipped with 5.12.0 did not correctly issue the
2228warning that it was to be removed from core.
2229
2230=head1 Documentation
2231
5076a392
FC
2232=head2 New Documentation
2233
41e29def 2234=head3 L<perlgpl>
5076a392
FC
2235
2236L<perlgpl> has been updated to contain GPL version 1, as is included in the
cdc10f43 2237F<README> distributed with perl (5.12.1).
5076a392 2238
41e29def 2239=head3 Perl 5.12.x delta files
5076a392 2240
41e29def
FC
2241The perldelta files for Perl 5.12.1 to 5.12.3 have been added from the
2242maintenance branch: L<perl5121delta>, L<perl5122delta>, L<perl5123delta>.
5076a392
FC
2243
2244=head3 L<perlpodstyle>
2245
2246New style guide for POD documentation,
2247split mostly from the NOTES section of the pod2man man page.
2248
41e29def
FC
2249=head3 L<perlsource>, L<perlinterp>, L<perlhacktut>, and L<perlhacktips>
2250
cc13eef1 2251See L</perlhack and perlrepository revamp>, below.
5076a392
FC
2252
2253=head2 Changes to Existing Documentation
2254
41e29def 2255=head3 L<perlmodlib> is now complete
4ed2cea4 2256
1c7f7822 2257The perlmodlib page that came with Perl 5.12.0 was missing a number of
a60ea503 2258modules, due to a bug in the script that generates the list. This has been
cdc10f43 2259fixed [perl #74332] (5.12.1).
4ed2cea4 2260
1c7f7822 2261=head3 Replace incorrect tr/// table in L<perlebcdic>
5076a392 2262
41e29def 2263L<perlebcdic> contains a helpful table to use in tr/// to convert
1c7f7822
JV
2264between EBCDIC and Latin1/ASCII. The table was the inverse of the one
2265it describes, though the code that used the table worked correctly for
2266the specific example given.
5076a392 2267
1c7f7822 2268The table has been corrected, and the sample code changed to correspond.
5076a392 2269
1c7f7822
JV
2270The table has also been changed to hex from octal and the recipes in the
2271pod have been altered to print out leading zeros to make all the values
2272the same length.
5076a392 2273
41e29def 2274=head3 Tricks for user-defined casing
5076a392 2275
41e29def
FC
2276L<perlunicode> now contains an explanation of how to override, mangle
2277and otherwise tweak the way perl handles upper-, lower- and other-case
2278conversions on Unicode data, and how to provide scoped changes to alter
2279one's own code's behaviour without stomping on anybody else.
5076a392 2280
1c7f7822 2281=head3 INSTALL explicitly states that Perl requires a C89 compiler
5076a392 2282
d430b8e7
FC
2283This was already true but it's now Officially Stated For The Record
2284(5.12.2).
5076a392 2285
41e29def 2286=head3 Explanation of C<\xI<HH>> and C<\oI<OOO>> escapes
5076a392 2287
41e29def
FC
2288L<perlop> has been updated with more detailed explanation of these two
2289character escapes.
5076a392 2290
41e29def 2291=head3 C<-0I<NNN>> switch
5076a392 2292
41e29def 2293In L<perlrun>, the behavior of the C<-0NNN> switch for C<-0400> or higher
d430b8e7 2294has been clarified (5.12.2).
5076a392 2295
cdc10f43
FC
2296=head3 Maintenance policy
2297
2298L<perlpolicy> now contains the policy on what patches are acceptable for
2299maintenance branches (5.12.1).
2300
41e29def 2301=head3 Deprecation policy
5076a392 2302
41e29def 2303L<perlpolicy> now contains the policy on compatibility and deprecation
d430b8e7 2304along with definitions of terms like "deprecation" (5.12.2).
5076a392 2305
41e29def 2306=head3 New descriptions in L<perldiag>
5076a392
FC
2307
2308The following existing diagnostics are now documented:
2309
2310=over 4
2311
2312=item *
2313
2314L<Ambiguous use of %c resolved as operator %c|perldiag/"Ambiguous use of %c resolved as operator %c">
2315
2316=item *
2317
2318L<Ambiguous use of %c{%s} resolved to %c%s|perldiag/"Ambiguous use of %c{%s} resolved to %c%s">
2319
2320=item *
2321
2322L<Ambiguous use of %c{%s%s} resolved to %c%s%s|perldiag/"Ambiguous use of %c{%s%s} resolved to %c%s%s">
2323
2324=item *
2325
2326L<Ambiguous use of -%s resolved as -&%s()|perldiag/"Ambiguous use of -%s resolved as -&%s()">
2327
2328=item *
2329
2330L<Invalid strict version format (%s)|perldiag/"Invalid strict version format (%s)">
2331
2332=item *
2333
2334L<Invalid version format (%s)|perldiag/"Invalid version format (%s)">
2335
2336=item *
2337
2338L<Invalid version object|perldiag/"Invalid version object">
2339
2340=back
2341
5076a392
FC
2342=head3 L<perlbook>
2343
41e29def 2344L<perlbook> has been expanded to cover many more popular books.
5076a392 2345
41e29def 2346=head3 C<SvTRUE> macro
5076a392 2347
41e29def
FC
2348The documentation for the C<SvTRUE> macro in
2349L<perlapi> was simply wrong in stating that
a60ea503 2350get-magic is not processed. It has been corrected.
5076a392 2351
41e29def 2352=head3 L<perlvar> revamp
5076a392 2353
41e29def 2354L<perlvar> reorders the variables and groups them by topic. Each variable
5076a392 2355introduced after Perl 5.000 notes the first version in which it is
41e29def 2356available. L<perlvar> also has a new section for deprecated variables to
5076a392
FC
2357note when they were removed.
2358
41e29def 2359=head3 Array and hash slices in scalar context
5076a392 2360
41e29def 2361These are now documented in L<perldata>.
5076a392 2362
41e29def 2363=head3 C<use locale> and formats
5076a392
FC
2364
2365L<perlform> and L<perllocale> have been corrected to state that
2366C<use locale> affects formats.
2367
5076a392
FC
2368=head3 L<overload>
2369
a60ea503 2370L<overload>'s documentation has practically undergone a rewrite. It
5076a392
FC
2371is now much more straightforward and clear.
2372
cc13eef1 2373=head3 perlhack and perlrepository revamp
5076a392 2374
5076a392 2375The L<perlhack> document is now much shorter, and focuses on the Perl 5
1c7f7822
JV
2376development process and submitting patches to Perl. The technical content
2377has been moved to several new documents, L<perlsource>, L<perlinterp>,
2378L<perlhacktut>, and L<perlhacktips>. This technical content has only
2379been lightly edited.
5076a392 2380
1c7f7822
JV
2381The perlrepository document has been renamed to L<perlgit>. This new
2382document is just a how-to on using git with the Perl source code.
2383Any other content that used to be in perlrepository has been moved
2384to L<perlhack>.
5076a392 2385
41e29def 2386=head3 Time::Piece examples
5076a392
FC
2387
2388Examples in L<perlfaq4> have been updated to show the use of
41e29def 2389L<Time::Piece>.
5076a392
FC
2390
2391=head1 Diagnostics
2392
2393The following additions or changes have been made to diagnostic output,
2394including warnings and fatal error messages. For the complete list of
2395diagnostic messages, see L<perldiag>.
2396
2397=head2 New Diagnostics
2398
a593b319
FC
2399=head3 New Errors
2400
5076a392
FC
2401=over
2402
a593b319 2403=item Closure prototype called
5076a392 2404
a593b319
FC
2405This error occurs when a subroutine reference passed to an attribute
2406handler is called, if the subroutine is a closure [perl #68560].
5076a392 2407
a593b319 2408=item Insecure user-defined property %s
5076a392 2409
a593b319
FC
2410Perl detected tainted data when trying to compile a regular
2411expression that contains a call to a user-defined character property
2412function, i.e. C<\p{IsFoo}> or C<\p{InFoo}>.
2413See L<perlunicode/User-Defined Character Properties> and L<perlsec>.
5076a392 2414
a593b319 2415=item panic: gp_free failed to free glob pointer - something is repeatedly re-creating entries
5076a392 2416
a593b319
FC
2417This new error is triggered if a destructor called on an object in a
2418typeglob that is being freed creates a new typeglob entry containing an
2419object with a destructor that creates a new entry containing an object....
5076a392 2420
a593b319 2421=item Parsing code internal error (%s)
5076a392 2422
a593b319
FC
2423This new fatal error is produced when parsing
2424code supplied by an extension violates the
2425parser's API in a detectable way.
5076a392 2426
a593b319 2427=item refcnt: fd %d%s
5076a392 2428
a593b319
FC
2429This new error only occurs if a internal consistency check fails when a
2430pipe is about to be closed.
5076a392 2431
a593b319 2432=item Regexp modifier "/%c" may not appear twice
5076a392 2433
a593b319
FC
2434The regular expression pattern has one of the
2435mutually exclusive modifiers repeated.
5076a392 2436
a593b319 2437=item Regexp modifiers "/%c" and "/%c" are mutually exclusive
5076a392 2438
a593b319
FC
2439The regular expression pattern has more than one of the mutually
2440exclusive modifiers.
5076a392 2441
a593b319 2442=item Using !~ with %s doesn't make sense
5076a392 2443
a593b319 2444This error occurs when C<!~> is used with C<s///r> or C<y///r>.
5076a392 2445
a593b319 2446=back
5076a392 2447
a593b319 2448=head3 New Warnings
5076a392 2449
a593b319 2450=over
5076a392 2451
a593b319 2452=item "\b{" is deprecated; use "\b\{" instead
5076a392 2453
a593b319 2454=item "\B{" is deprecated; use "\B\{" instead
5076a392 2455
a593b319
FC
2456Use of an unescaped "{" immediately following a C<\b> or C<\B> is now
2457deprecated so as to reserve its use for Perl itself in a future release.
5076a392 2458
a593b319 2459=item Operation "%s" returns its argument for ...
5076a392 2460
a593b319 2461Performing an operation requiring Unicode semantics (such as case-folding)
a60ea503
FC
2462on a Unicode surrogate or a non-Unicode character now triggers this
2463warning.
5076a392 2464
a593b319
FC
2465=item Use of qw(...) as parentheses is deprecated
2466
2467See L</"Use of qw(...) as parentheses">, above, for details.
5076a392
FC
2468
2469=back
2470
2471=head2 Changes to Existing Diagnostics
2472
2473=over 4
2474
2475=item *
2476
4ed2cea4
FC
2477The "Variable $foo is not imported" warning that precedes a
2478C<strict 'vars'> error has now been assigned the "misc" category, so that
2479C<no warnings> will suppress it [perl #73712].
2480
2481=item *
2482
5076a392
FC
2483C<warn> and C<die> now produce 'Wide character' warnings when fed a
2484character outside the byte range if STDERR is a byte-sized handle.
2485
2486=item *
2487
2488The 'Layer does not match this perl' error message has been replaced with
a593b319 2489these more helpful messages [perl #73754]:
5076a392
FC
2490
2491=over 4
2492
2493=item *
2494
2495PerlIO layer function table size (%d) does not match size expected by this
2496perl (%d)
2497
2498=item *
2499
2500PerlIO layer instance size (%d) does not match size expected by this perl
2501(%d)
2502
2503=back
2504
5076a392
FC
2505=item *
2506
2507The "Found = in conditional" warning that is emitted when a constant is
2508assigned to a variable in a condition is now withheld if the constant is
2509actually a subroutine or one generated by C<use constant>, since the value
2510of the constant may not be known at the time the program is written
2511[perl #77762].
2512
2513=item *
2514
2515Previously, if none of the C<gethostbyaddr>, C<gethostbyname> and
2516C<gethostent> functions were implemented on a given platform, they would
2517all die with the message 'Unsupported socket function "gethostent" called',
2518with analogous messages for C<getnet*> and C<getserv*>. This has been
2519corrected.
2520
2521=item *
2522
a593b319
FC
2523The warning message about unrecognized regular expression escapes passed
2524through has been changed to include any literal '{' following the
2525two-character escape. E.g., "\q{" is now emitted instead of "\q".
5076a392
FC
2526
2527=back
2528
2529=head1 Utility Changes
2530
0b88cc74 2531=head3 L<perlbug>
5076a392
FC
2532
2533=over 4
2534
2535=item *
2536
0b88cc74
FC
2537L<perlbug> now looks in the EMAIL environment variable for a return address
2538if the REPLY-TO and REPLYTO variables are empty.
5076a392
FC
2539
2540=item *
2541
0b88cc74
FC
2542L<perlbug> did not previously generate a From: header, potentially
2543resulting in dropped mail. Now it does include that header.
5076a392
FC
2544
2545=item *
2546
0b88cc74 2547The user's address is now used as the return-path.
4ed2cea4 2548
0b88cc74
FC
2549Many systems these days don't have a valid Internet domain name and
2550perlbug@perl.org does not accept email with a return-path that does
2551not resolve. So the user's address is now passed to sendmail so it's
2552less likely to get stuck in a mail queue somewhere [perl #82996].
5076a392 2553
2c389f6c
FC
2554=item *
2555
d430b8e7
FC
2556L<perlbug> now always gives the reporter a chance to change the email
2557address it guesses for them (5.12.2).
2558
2559=item *
2560
2561L<perlbug> should no longer warn about uninitialized values when using the C<-d>
2562and C<-v> options (5.12.2).
2c389f6c 2563
5076a392
FC
2564=back
2565
0b88cc74 2566=head3 L<perl5db.pl>
5076a392 2567
0b88cc74 2568=over
5076a392
FC
2569
2570=item *
2571
0b88cc74
FC
2572The remote terminal works after forking and spawns new sessions - one
2573for each forked process.
5076a392
FC
2574
2575=back
2576
0b88cc74 2577=head3 L<ptargrep>
5076a392
FC
2578
2579=over 4
2580
2581=item *
2582
0b88cc74
FC
2583L<ptargrep> is a new utility to apply pattern matching to the contents of
2584files in a tar archive. It comes with C<Archive::Tar>.
5076a392
FC
2585
2586=back
2587
2588=head1 Configuration and Compilation
2589
61752d82
FC
2590See also L</"Naming fixes in Policy_sh.SH may invalidate Policy.sh">,
2591above.
2592
5076a392
FC
2593=over 4
2594
2595=item *
2596
1c7f7822
JV
2597CCINCDIR and CCLIBDIR for the mingw64 cross-compiler are now correctly
2598under $(CCHOME)\mingw\include and \lib rather than immediately below
2599$(CCHOME).
5076a392 2600
5076a392
FC
2601This means the 'incpath', 'libpth', 'ldflags', 'lddlflags' and
2602'ldflags_nolargefiles' values in Config.pm and Config_heavy.pl are now
87595b22 2603set correctly.
5076a392
FC
2604
2605=item *
2606
87595b22
FC
2607'make test.valgrind' has been adjusted to account for cpan/dist/ext
2608separation.
5076a392
FC
2609
2610=item *
2611
2612On compilers that support it, C<-Wwrite-strings> is now added to cflags by
2613default.
2614
2615=item *
2616
2617The C<Encode> module can now (once again) be included in a static Perl
2618build. The special-case handling for this situation got broken in Perl
26195.11.0, and has now been repaired.
2620
1e463951
FC
2621=item *
2622
2623The previous default size of a PerlIO buffer (4096 bytes) has been increased
2624to the larger of 8192 bytes and your local BUFSIZ. Benchmarks show that doubling
2625this decade-old default increases read and write performance in the neighborhood
2626of 25% to 50% when using the default layers of perlio on top of unix. To choose
2627a non-default size, such as to get back the old value or to obtain an even
2628larger value, configure with:
2629
2630 ./Configure -Accflags=-DPERLIOBUF_DEFAULT_BUFSIZ=N
2631
2632where N is the desired size in bytes; it should probably be a multiple of
2633your page size.
2634
d430b8e7
FC
2635=item *
2636
2637An "incompatible operand types" error in ternary expressions when building
2638with C<clang> has been fixed (5.12.2).
2639
2640=item *
2641
2642Perl now skips setuid C<File::Copy> tests on partitions it detects to be mounted
2643as C<nosuid> (5.12.2).
2644
5076a392
FC
2645=back
2646
5076a392
FC
2647=head1 Platform Support
2648
5076a392
FC
2649=head2 New Platforms
2650
5076a392
FC
2651=over 4
2652
2653=item AIX
2654
cdc10f43 2655Perl now builds on AIX 4.2 (5.12.1).
5076a392
FC
2656
2657=back
2658
2659=head2 Discontinued Platforms
2660
2661=over 4
2662
5076a392
FC
2663=item Apollo DomainOS
2664
1c7f7822
JV
2665The last vestiges of support for this platform have been excised from
2666the Perl distribution. It was officially discontinued in version 5.12.0.
2667It had not worked for years before that.
5076a392
FC
2668
2669=item MacOS Classic
2670
2671The last vestiges of support for this platform have been excised from the
a60ea503 2672Perl distribution. It was officially discontinued in an earlier version.
5076a392
FC
2673
2674=back
2675
2676=head2 Platform-Specific Notes
2677
d430b8e7
FC
2678=head3 AIX
2679
2680=over
2681
2682=item *
2683
2684F<README.aix> has been updated with information about the XL C/C++ V11 compiler
2685suite (5.12.2).
2686
2687=back
2688
2689=head3 ARM
2690
2691=over
2692
2693=item *
2694
2695The C<d_u32align> configuration probe on ARM has been fixed (5.12.2).
2696
2697=back
2698
554003a2 2699=head3 Cygwin
5076a392
FC
2700
2701=over 4
2702
2703=item *
2704
554003a2 2705MakeMaker has been updated to build man pages on cygwin.
5076a392
FC
2706
2707=item *
2708
554003a2
FC
2709Improved rebase behaviour
2710
2711If a dll is updated on cygwin the old imagebase address is reused.
2712This solves most rebase errors, especially when updating on core dll's.
2713See L<http://www.tishler.net/jason/software/rebase/rebase-2.4.2.README> for more information.
5076a392
FC
2714
2715=item *
2716
554003a2 2717Support for the standard cygwin dll prefix, which is e.g. needed for FFI's
5076a392
FC
2718
2719=item *
2720
554003a2 2721Updated build hints file
5076a392
FC
2722
2723=back
2724
cdc10f43
FC
2725=head3 FreeBSD 7
2726
2727=over
2728
2729=item *
2730
2731FreeBSD 7 no longer contains F</usr/bin/objformat>. At build time,
2732Perl now skips the F<objformat> check for versions 7 and higher and
2733assumes ELF (5.12.1).
2734
2735=back
2736
2737=head3 HP-UX
2738
2739=over
2740
2741=item *
2742
2743Perl now allows -Duse64bitint without promoting to use64bitall on HP-UX
2744(5.12.1).
2745
2746=back
2747
554003a2 2748=head3 IRIX
5076a392 2749
a60ea503
FC
2750=over
2751
2752=item *
2753
5076a392
FC
2754Conversion of strings to floating-point numbers is now more accurate on
2755IRIX systems [perl #32380].
2756
a60ea503
FC
2757=back
2758
554003a2 2759=head3 Mac OS X
5076a392 2760
a60ea503
FC
2761=over
2762
2763=item *
2764
5076a392
FC
2765Early versions of Mac OS X (Darwin) had buggy implementations of the
2766C<setregid>, C<setreuid>, C<setrgid> and C<setruid> functions, so perl
2767would pretend they did not exist.
2768
2769These functions are now recognised on Mac OS 10.5 (Leopard; Darwin 9) and
2770higher, as they have been fixed [perl #72990].
2771
a60ea503
FC
2772=back
2773
554003a2 2774=head3 MirBSD
5076a392 2775
a60ea503
FC
2776=over
2777
2778=item *
2779
554003a2
FC
2780Previously if you built perl with a shared libperl.so on MirBSD (the
2781default config), it would work up to the installation; however, once
2782installed, it would be unable to find libperl. So path handling is now
2783treated as in the other BSD dialects.
5076a392 2784
a60ea503
FC
2785=back
2786
554003a2 2787=head3 NetBSD
5076a392 2788
a60ea503
FC
2789=over
2790
2791=item *
2792
554003a2
FC
2793The NetBSD hints file has been changed to make the system's malloc the
2794default.
5076a392 2795
a60ea503
FC
2796=back
2797
1c7f7822 2798=head3 OpenBSD
5076a392 2799
a60ea503
FC
2800=over
2801
2802=item *
2803
554003a2
FC
2804OpenBSD E<gt> 3.7 has a new malloc implementation which is mmap-based
2805and as such can release memory back to the OS; however, perl's use of
2806this malloc causes a substantial slowdown so we now default to using
2807perl's malloc instead [perl #75742].
5076a392 2808
a60ea503
FC
2809=back
2810
554003a2 2811=head3 OpenVOS
5076a392 2812
a60ea503
FC
2813=over
2814
2815=item *
2816
554003a2 2817perl now builds again with OpenVOS (formerly known as Stratus VOS)
5a553547 2818[perl #78132] (5.12.3).
5076a392 2819
a60ea503
FC
2820=back
2821
554003a2 2822=head3 Solaris
5076a392 2823
a60ea503
FC
2824=over
2825
2826=item *
2827
2828DTrace is now supported on Solaris. There used to be build failures, but
5a553547 2829these have been fixed [perl #73630] (5.12.3).
5076a392 2830
a60ea503
FC
2831=back
2832
554003a2 2833=head3 VMS
5076a392
FC
2834
2835=over
2836
2837=item *
2838
cdc10f43
FC
2839It's now possible to build extensions on older (pre 7.3-2) VMS systems.
2840
2841DCL symbol length was limited to 1K up until about seven years or
2842so ago, but there was no particularly deep reason to prevent those
2843older systems from configuring and building Perl (5.12.1).
2844
2845=item *
2846
2847We fixed the previously-broken C<-Uuseperlio> build on VMS.
2848
2849We were checking a variable that doesn't exist in the non-default
2850case of disabling perlio. Now we only look at it when it exists (5.12.1).
2851
2852=item *
2853
2854We fixed the -Uuseperlio command-line option in configure.com.
2855
2856Formerly it only worked if you went through all the questions
2857interactively and explicitly answered no (5.12.1).
2858
2859=item *
2860
554003a2 2861C<PerlIOUnix_open> now honours the default permissions on VMS.
5076a392 2862
554003a2
FC
2863When C<perlio> became the default and C<unixio> became the default bottom layer,
2864the most common path for creating files from Perl became C<PerlIOUnix_open>,
2865which has always explicitly used C<0666> as the permission mask.
5076a392 2866
554003a2
FC
2867To avoid this, C<0777> is now passed as the permissions to C<open()>. In the
2868VMS CRTL, C<0777> has a special meaning over and above intersecting with the
2869current umask; specifically, it allows Unix syscalls to preserve native default
5a553547
FC
2870permissions (5.12.3).
2871
2872=item *
2873
2874Spurious record boundaries are no longer
2875introduced by the PerlIO layer during output (5.12.3).
5076a392
FC
2876
2877=item *
2878
554003a2
FC
2879The shortening of symbols longer than 31 characters in the C sources is
2880now done by the compiler rather than by xsubpp (which could only do so
2881for generated symbols in XS code).
5076a392
FC
2882
2883=item *
2884
554003a2
FC
2885Record-oriented files (record format variable or variable with fixed control)
2886opened for write by the perlio layer will now be line-buffered to prevent the
2887introduction of spurious line breaks whenever the perlio buffer fills up.
5076a392 2888
d430b8e7
FC
2889=item *
2890
a60ea503
FC
2891F<git_version.h> is now installed on VMS. This
2892was an oversight in v5.12.0 which
d430b8e7
FC
2893caused some extensions to fail to build (5.12.2).
2894
2895=item *
2896
2897Several memory leaks in L<stat()|perlfunc/"stat FILEHANDLE"> have been fixed (5.12.2).
2898
2899=item *
2900
2901A memory leak in C<Perl_rename()> due to a double allocation has been
2902fixed (5.12.2).
2903
2904=item *
2905
2906A memory leak in C<vms_fid_to_name()> (used by C<realpath()> and
2907C<realname()>) has been fixed (5.12.2).
2908
5076a392
FC
2909=back
2910
554003a2 2911=head3 Windows
5076a392 2912
5a1f7719
FC
2913See also L</"fork() emulation will not wait for signalled children"> and
2914L</"Perl source code is read in text mode on Windows">, above.
2915
5076a392
FC
2916=over 4
2917
2918=item *
2919
554003a2 2920Fixed build process for SDK2003SP1 compilers.
5076a392 2921
554003a2 2922=item *
5076a392 2923
01b1a9e4
FC
2924Compilation with Visual Studio 2010 is now supported.
2925
2926=item *
2927
554003a2
FC
2928When using old 32-bit compilers, the define C<_USE_32BIT_TIME_T> will now
2929be set in C<$Config{ccflags}>. This improves portability when compiling
2930XS extensions using new compilers, but for a perl compiled with old 32-bit
2931compilers.
5076a392
FC
2932
2933=item *
2934
554003a2
FC
2935C<$Config{gccversion}> is now set correctly when perl is built using the
2936mingw64 compiler from L<http://mingw64.org> [perl #73754].
5076a392 2937
554003a2
FC
2938=item *
2939
d430b8e7
FC
2940When building Perl with the mingw64 x64 cross-compiler C<incpath>,
2941C<libpth>, C<ldflags>, C<lddlflags> and C<ldflags_nolargefiles> values
2942in F<Config.pm> and F<Config_heavy.pl> were not previously being set
2943correctly because, with that compiler, the include and lib directories
2944are not immediately below C<$(CCHOME)> (5.12.2).
2945
2946=item *
2947
554003a2
FC
2948The build process proceeds more smoothly with mingw and dmake when
2949F<C:\MSYS\bin> is in the PATH, due to a C<Cwd> fix.
5076a392
FC
2950
2951=item *
2952
554003a2
FC
2953Support for building with Visual C++ 2010 is now underway, but is not yet
2954complete. See F<README.win32> or L<perlwin32> for more details.
5076a392 2955
554003a2
FC
2956=item *
2957
2958The option to use an externally-supplied C<crypt()>, or to build with no
2959C<crypt()> at all, has been removed. Perl supplies its own C<crypt()>
2960implementation for Windows, and the political situation that required
2961this part of the distribution to sometimes be omitted is long gone.
5076a392
FC
2962
2963=back
2964
2965=head1 Internal Changes
2966
1e463951 2967=head2 New APIs
5076a392 2968
1e463951 2969=head3 CLONE_PARAMS structure added to ease correct thread creation
5076a392 2970
1e463951
FC
2971Modules that create threads should now create C<CLONE_PARAMS> structures
2972by calling the new function C<Perl_clone_params_new()>, and free them with
2973C<Perl_clone_params_del()>. This will ensure compatibility with any future
2974changes to the internals of the C<CLONE_PARAMS> structure layout, and that
2975it is correctly allocated and initialised.
5076a392 2976
1e463951 2977=head3 New parsing functions
5076a392 2978
1e463951
FC
2979Several functions have been added for parsing statements or multiple
2980statements:
5076a392 2981
1e463951 2982=over
5076a392
FC
2983
2984=item *
2985
1e463951 2986C<parse_fullstmt> parses a complete Perl statement.
5076a392
FC
2987
2988=item *
2989
1e463951
FC
2990C<parse_stmtseq> parses a sequence of statements, up
2991to closing brace or EOF.
5076a392
FC
2992
2993=item *
2994
1e463951 2995C<parse_block> parses a block [perl #78222].
5076a392
FC
2996
2997=item *
2998
1e463951
FC
2999C<parse_barestmt> parses a statement
3000without a label.
5076a392
FC
3001
3002=item *
3003
1e463951 3004C<parse_label> parses a statement label, separate from statements.
5076a392 3005
1e463951 3006=back
5076a392 3007
1e463951
FC
3008The
3009L<C<parse_fullexpr()>|perlapi/parse_fullexpr>,
3010L<C<parse_listexpr()>|perlapi/parse_listexpr>,
3011L<C<parse_termexpr()>|perlapi/parse_termexpr>, and
3012L<C<parse_arithexpr()>|perlapi/parse_arithexpr>
3013functions have been added to the API. They perform
3014recursive-descent parsing of expressions at various precedence levels.
3015They are expected to be used by syntax plugins.
5076a392 3016
1e463951 3017See L<perlapi> for details.
5076a392 3018
1e463951 3019=head3 Hints hash API
5076a392 3020
1e463951
FC
3021A new C API for introspecting the hinthash C<%^H> at runtime has been
3022added. See C<cop_hints_2hv>, C<cop_hints_fetchpvn>, C<cop_hints_fetchpvs>,
3023C<cop_hints_fetchsv>, and C<hv_copy_hints_hv> in L<perlapi> for details.
5076a392 3024
1e463951
FC
3025A new, experimental API has been added for accessing the internal
3026structure that Perl uses for C<%^H>. See the functions beginning with
3027C<cophh_> in L<perlapi>.
5076a392 3028
1e463951 3029=head3 C interface to C<caller()>
5076a392 3030
1e463951
FC
3031The C<caller_cx> function has been added as an XSUB-writer's equivalent of
3032C<caller()>. See L<perlapi> for details.
5076a392 3033
1e463951 3034=head3 Custom per-subroutine check hooks
5076a392 3035
1e463951
FC
3036XS code in an extension module can now annotate a subroutine (whether
3037implemented in XS or in Perl) so that nominated XS code will be called
3038at compile time (specifically as part of op checking) to change the op
3039tree of that subroutine. The compile-time check function (supplied by
3040the extension module) can implement argument processing that can't be
3041expressed as a prototype, generate customised compile-time warnings,
3042perform constant folding for a pure function, inline a subroutine
3043consisting of sufficiently simple ops, replace the whole call with a
3044custom op, and so on. This was previously all possible by hooking the
3045C<entersub> op checker, but the new mechanism makes it easy to tie the
3046hook to a specific subroutine. See L<perlapi/cv_set_call_checker>.
5076a392 3047
1e463951
FC
3048To help in writing custom check hooks, several subtasks within standard
3049C<entersub> op checking have been separated out and exposed in the API.
5076a392 3050
1e463951 3051=head3 Improved support for custom OPs
5076a392 3052
1e463951
FC
3053Custom ops can now be registered with the new C<custom_op_register> C
3054function and the C<XOP> structure. This will make it easier to add new
3055properties of custom ops in the future. Two new properties have been added
3056already, C<xop_class> and C<xop_peep>.
5076a392 3057
1e463951
FC
3058C<xop_class> is one of the OA_*OP constants, and allows L<B> and other
3059introspection mechanisms to work with custom ops
3060that aren't BASEOPs. C<xop_peep> is a pointer to
3061a function that will be called for ops of this
3062type from C<Perl_rpeep>.
5076a392 3063
1e463951
FC
3064See L<perlguts/Custom Operators> and L<perlapi/Custom Operators> for more
3065detail.
5076a392 3066
1e463951
FC
3067The old C<PL_custom_op_names>/C<PL_custom_op_descs> interface is still
3068supported but discouraged.
5076a392 3069
1e463951 3070=head3 Scope hooks
5076a392 3071
1e463951
FC
3072It is now possible for XS code to hook into Perl's lexical scope
3073mechanism at compile time, using the new C<Perl_blockhook_register>
a60ea503 3074function. See L<perlguts/"Compile-time scope hooks">.
5076a392 3075
1e463951 3076=head3 The recursive part of the peephole optimizer is now hookable
5076a392
FC
3077
3078In addition to C<PL_peepp>, for hooking into the toplevel peephole optimizer, a
3079C<PL_rpeepp> is now available to hook into the optimizer recursing into
3080side-chains of the optree.
3081
1e463951 3082=head3 New non-magical variants of existing functions
5076a392 3083
1e463951
FC
3084The following functions/macros have been added to the API. The C<*_nomg>
3085macros are equivalent to their non-_nomg variants, except that they ignore
3086get-magic. Those ending in C<_flags> allow one to specify whether
3087get-magic is processed.
5076a392 3088
1e463951
FC
3089 sv_2bool_flags
3090 SvTRUE_nomg
3091 sv_2nv_flags
3092 SvNV_nomg
3093 sv_cmp_flags
3094 sv_cmp_locale_flags
3095 sv_eq_flags
3096 sv_collxfrm_flags
5076a392 3097
1e463951 3098In some of these cases, the non-_flags functions have
5076a392
FC
3099been replaced with wrappers around the new functions.
3100
1e463951 3101=head3 pv/pvs/sv versions of existing functions
5076a392 3102
1e463951 3103Many functions ending with pvn now have equivalent pv/pvs/sv versions.
5076a392 3104
1e463951 3105=head3 List op-building functions
5076a392 3106
1e463951
FC
3107List op-building functions have been added to the
3108API. See L<op_append_elem|perlapi/op_append_elem>,
3109L<op_append_list|perlapi/op_append_list>, and
3110L<op_prepend_elem|perlapi/op_prepend_elem> in L<perlapi>.
5076a392 3111
1e463951 3112=head3 C<LINKLIST>
5076a392 3113
1e463951
FC
3114The L<LINKLIST|perlapi/LINKLIST> macro, part of op building that
3115constructs the execution-order op chain, has been added to the API.
5076a392 3116
1e463951 3117=head3 Localisation functions
5076a392 3118
1e463951
FC
3119The C<save_freeop>, C<save_op>, C<save_pushi32ptr> and C<save_pushptrptr>
3120functions have been added to the API.
5076a392 3121
1e463951 3122=head3 Stash names
5076a392 3123
1e463951
FC
3124A stash can now have a list of effective names in addition to its usual
3125name. The first effective name can be accessed via the C<HvENAME> macro,
3126which is now the recommended name to use in MRO linearisations (C<HvNAME>
3127being a fallback if there is no C<HvENAME>).
5076a392 3128
1e463951
FC
3129These names are added and deleted via C<hv_ename_add> and
3130C<hv_ename_delete>. These two functions are I<not> part of the API.
5076a392 3131
1e463951 3132=head3 New functions for finding and removing magic
5076a392 3133
1e463951
FC
3134The L<C<mg_findext()>|perlapi/mg_findext> and
3135L<C<sv_unmagicext()>|perlapi/sv_unmagicext>
3136functions have been added to the API.
3137They allow extension authors to find and remove magic attached to
3138scalars based on both the magic type and the magic virtual table, similar to how
3139C<sv_magicext()> attaches magic of a certain type and with a given virtual table
3140to a scalar. This eliminates the need for extensions to walk the list of
3141C<MAGIC> pointers of an C<SV> to find the magic that belongs to them.
5076a392 3142
1e463951 3143=head3 C<find_rundefsv>
5076a392 3144
1e463951
FC
3145This function returns the SV representing C<$_>, whether it's lexical
3146or dynamic.
5076a392 3147
1e463951 3148=head3 C<Perl_croak_no_modify>
5076a392 3149
1e463951
FC
3150C<Perl_croak_no_modify()> is short-hand for
3151C<Perl_croak("%s", PL_no_modify)>.
5076a392 3152
1e463951 3153=head3 C<PERL_STATIC_INLINE> define
5076a392 3154
1e463951
FC
3155The C<PERL_STATIC_INLINE> define has been added to provide the best-guess
3156incantation to use for static inline functions, if the C compiler supports
3157C99-style static inline. If it doesn't, it'll give a plain C<static>.
5076a392 3158
1e463951
FC
3159C<HAS_STATIC_INLINE> can be used to check if the compiler actually supports
3160inline functions.
5076a392 3161
1e463951 3162=head3 New C<pv_escape> option for hexadecimal escapes
5076a392 3163
1e463951
FC
3164A new option, C<PERL_PV_ESCAPE_NONASCII>, has been added to C<pv_escape> to
3165dump all characters above ASCII in hexadecimal. Before, one could get all
3166characters as hexadecimal or the Latin1 non-ASCII as octal.
5076a392 3167
1e463951 3168=head3 C<lex_start>
5076a392 3169
1e463951 3170C<lex_start> has been added to the API, but is considered experimental.
5076a392 3171
1e463951 3172=head3 C<op_scope()> and C<op_lvalue()>
5076a392 3173
1e463951
FC
3174The C<op_scope()> and C<op_lvalue()> functions have been added to the API,
3175but are considered experimental.
5076a392 3176
1e463951 3177=head2 C API Changes
5076a392 3178
1e463951 3179=head3 C<PERL_POLLUTE> has been removed
5076a392 3180
1e463951
FC
3181The option to define C<PERL_POLLUTE> to expose older 5.005 symbols for
3182backwards compatibility has been removed. It's use was always discouraged,
3183and MakeMaker contains a more specific escape hatch:
5076a392 3184
1e463951 3185 perl Makefile.PL POLLUTE=1
5076a392 3186
1e463951
FC
3187This can be used for modules that have not been upgraded to 5.6 naming
3188conventions (and really should be completely obsolete by now).
5076a392 3189
1e463951 3190=head3 Check API compatibility when loading XS modules
5076a392 3191
1e463951
FC
3192When perl's API changes in incompatible ways (which usually happens between
3193major releases), XS modules compiled for previous versions of perl will not
3194work anymore. They will need to be recompiled against the new perl.
5076a392 3195
1e463951
FC
3196In order to ensure that modules are recompiled, and to prevent users from
3197accidentally loading modules compiled for old perls into newer ones, the
3198C<XS_APIVERSION_BOOTCHECK> macro has been added. That macro, which is
3199called when loading every newly compiled extension, compares the API
3200version of the running perl with the version a module has been compiled for
3201and raises an exception if they don't match.
5076a392 3202
1e463951 3203=head3 Perl_fetch_cop_label
5076a392 3204
1e463951
FC
3205The first argument of the C API function C<Perl_fetch_cop_label> has changed
3206from C<struct refcounted he *> to C<COP *>, to insulate the user from
3207implementation details.
5076a392 3208
1e463951
FC
3209This API function was marked as "may change", and likely isn't in use outside
3210the core. (Neither an unpacked CPAN, nor Google's codesearch, finds any other
3211references to it.)
5076a392 3212
1e463951 3213=head3 GvCV() and GvGP() are no longer lvalues
5076a392 3214
1e463951
FC
3215The new GvCV_set() and GvGP_set() macros are now provided to replace
3216assignment to those two macros.
5076a392 3217
1e463951
FC
3218This allows a future commit to eliminate some backref magic between GV
3219and CVs, which will require complete control over assignment to the
3220gp_cv slot.
5076a392 3221
1e463951 3222=head3 CvGV() is no longer an lvalue
5076a392 3223
1e463951
FC
3224Under some circumstances, the C<CvGV()> field of a CV is now
3225reference-counted. To ensure consistent behaviour, direct assignment to
3226it, for example C<CvGV(cv) = gv> is now a compile-time error. A new macro,
3227C<CvGV_set(cv,gv)> has been introduced to perform this operation
3228safely. Note that modification of this field is not part of the public
3229API, regardless of this new macro (and despite its being listed in this section).
5076a392 3230
1e463951 3231=head3 CvSTASH() is no longer an lvalue
5076a392 3232
1e463951
FC
3233The C<CvSTASH()> macro can now only be used as an rvalue. C<CvSTASH_set()>
3234has been added to replace assignment to C<CvSTASH()>. This is to ensure
3235that backreferences are handled properly. These macros are not part of the
3236API.
5076a392 3237
1e463951 3238=head3 Calling conventions for C<newFOROP> and C<newWHILEOP>
5076a392 3239
1e463951
FC
3240The way the parser handles labels has been cleaned up and refactored. As a
3241result, the C<newFOROP()> constructor function no longer takes a parameter
3242stating what label is to go in the state op.
5076a392 3243
1e463951
FC
3244The C<newWHILEOP()> and C<newFOROP()> functions no longer accept a line
3245number as a parameter.
5076a392 3246
1e463951 3247=head3 Flags passed to C<uvuni_to_utf8_flags> and C<utf8n_to_uvuni>
5076a392 3248
1e463951
FC
3249Some of the flags parameters to uvuni_to_utf8_flags() and
3250utf8n_to_uvuni() have changed. This is a result of Perl's now allowing
5076a392
FC
3251internal storage and manipulation of code points that are problematic
3252in some situations. Hence, the default actions for these functions has
3253been complemented to allow these code points. The new flags are
3254documented in L<perlapi>. Code that requires the problematic code
483b16f3 3255points to be rejected needs to change to use the new flags. Some flag
5076a392
FC
3256names are retained for backward source compatibility, though they do
3257nothing, as they are now the default. However the flags
3258C<UNICODE_ALLOW_FDD0>, C<UNICODE_ALLOW_FFFF>, C<UNICODE_ILLEGAL>, and
3259C<UNICODE_IS_ILLEGAL> have been removed, as they stem from a
3260fundamentally broken model of how the Unicode non-character code points
3261should be handled, which is now described in
52d6192b
FC
3262L<perlunicode/Non-character code points>. See also the Unicode section
3263under L</Selected Bug Fixes>.
5076a392 3264
1e463951 3265=head2 Deprecated C APIs
5076a392 3266
1e463951 3267=over
5076a392 3268
1e463951 3269=item C<Perl_ptr_table_clear>
5076a392 3270
1e463951
FC
3271C<Perl_ptr_table_clear> is no longer part of Perl's public API. Calling it
3272now generates a deprecation warning, and it will be removed in a future
3273release.
5076a392 3274
1e463951 3275=item C<sv_compile_2op>
5076a392 3276
1e463951
FC
3277The C<sv_compile_2op()> API function is now deprecated. Searches suggest
3278that nothing on CPAN is using it, so this should have zero impact.
5076a392 3279
1e463951
FC
3280It attempted to provide an API to compile code down to an optree, but failed
3281to bind correctly to lexicals in the enclosing scope. It's not possible to
3282fix this problem within the constraints of its parameters and return value.
5076a392 3283
1e463951 3284=item C<find_rundefsvoffset>
5076a392 3285
1e463951
FC
3286The C<find_rundefsvoffset> function has been deprecated. It appeared that
3287its design was insufficient for reliably getting the lexical C<$_> at
3288run-time.
5076a392 3289
1e463951 3290Use the new C<find_rundefsv> function or the C<UNDERBAR> macro
cbb8c2bc
FC
3291instead. They directly return the right SV
3292representing C<$_>, whether it's
1e463951 3293lexical or dynamic.
5076a392 3294
1e463951 3295=item C<CALL_FPTR> and C<CPERLscope>
5076a392 3296
1e463951
FC
3297Those are left from an old implementation of C<MULTIPLICITY> using C++ objects,
3298which was removed in Perl 5.8. Nowadays these macros do exactly nothing, so
3299they shouldn't be used anymore.
5076a392 3300
1e463951
FC
3301For compatibility, they are still defined for external C<XS> code. Only
3302extensions defining C<PERL_CORE> must be updated now.
5076a392 3303
1e463951 3304=back
5076a392 3305
1e463951 3306=head2 Other Internal Changes
5076a392 3307
1e463951 3308=head3 Stack unwinding
5076a392 3309
1e463951
FC
3310The protocol for unwinding the C stack at the last stage of a C<die>
3311has changed how it identifies the target stack frame. This now uses
3312a separate variable C<PL_restartjmpenv>, where previously it relied on
3313the C<blk_eval.cur_top_env> pointer in the C<eval> context frame that
3314has nominally just been discarded. This change means that code running
3315during various stages of Perl-level unwinding no longer needs to take
3316care to avoid destroying the ghost frame.
5076a392 3317
1e463951 3318=head3 Scope stack entries
5076a392 3319
1e463951
FC
3320The format of entries on the scope stack has been changed, resulting in a
3321reduction of memory usage of about 10%. In particular, the memory used by
3322the scope stack to record each active lexical variable has been halved.
5076a392 3323
1e463951 3324=head3 Memory allocation for pointer tables
5076a392 3325
1e463951
FC
3326Memory allocation for pointer tables has been changed. Previously
3327C<Perl_ptr_table_store> allocated memory from the same arena system as
3328C<SV> bodies and C<HE>s, with freed memory remaining bound to those arenas
3329until interpreter exit. Now it allocates memory from arenas private to the
3330specific pointer table, and that memory is returned to the system when
3331C<Perl_ptr_table_free> is called. Additionally, allocation and release are
3332both less CPU intensive.
5076a392 3333
1e463951 3334=head3 C<UNDERBAR>
5076a392 3335
1e463951
FC
3336The C<UNDERBAR> macro now calls C<find_rundefsv>. C<dUNDERBAR> is now a
3337noop but should still be used to ensure past and future compatibility.
5076a392 3338
1e463951 3339=head3 String comparison routines renamed
5076a392 3340
1e463951
FC
3341The ibcmp_* functions have been renamed and are now called foldEQ,
3342foldEQ_locale and foldEQ_utf8. The old names are still available as
3343macros.
3344
3345=head3 C<chop> and C<chomp> implementations merged
3346
3347The opcode bodies for C<chop> and C<chomp> and for C<schop> and C<schomp>
3348have been merged. The implementation functions C<Perl_do_chop()> and
3349C<Perl_do_chomp()>, never part of the public API, have been merged and
3350moved to a static function in F<pp.c>. This shrinks the perl binary
3351slightly, and should not affect any code outside the core (unless it is
3352relying on the order of side effects when C<chomp> is passed a I<list> of
3353values).
5076a392
FC
3354
3355=head1 Selected Bug Fixes
3356
e8e35311
FC
3357=head2 I/O
3358
5076a392
FC
3359=over 4
3360
3361=item *
3362
e8e35311 3363Perl no longer produces this warning:
a593b319
FC
3364
3365 $ perl -we 'open my $f, ">", \my $x; binmode $f, "scalar"'
3366 Use of uninitialized value in binmode at -e line 1.
3367
3368=item *
3369
e8e35311
FC
3370Opening a glob reference via C<< open $fh, "E<gt>", \*glob >> will no longer
3371cause the glob to be corrupted when the filehandle is printed to. This would
3372cause perl to crash whenever the glob's contents were accessed
3373[perl #77492].
4ed2cea4
FC
3374
3375=item *
3376
e8e35311 3377PerlIO no longer crashes when called recursively, e.g., from a signal
cbb8c2bc 3378handler. Now it just leaks memory [perl #75556].
4ed2cea4
FC
3379
3380=item *
3381
e8e35311 3382Most I/O functions were not warning for unopened handles unless the
cbb8c2bc 3383'closed' and 'unopened' warnings categories were both enabled. Now only
e8e35311 3384C<use warnings 'unopened'> is necessary to trigger these warnings (as was
438c239f 3385always meant to be the case).
4ed2cea4
FC
3386
3387=item *
3388
438c239f 3389There have been several fixes to PerlIO layers:
e8e35311 3390
438c239f
FC
3391When C<binmode FH, ":crlf"> pushes the C<:crlf> layer on top of the stack,
3392it no longer enables crlf layers lower in the stack, to avoid unexpected
3393results [perl #38456].
4ed2cea4 3394
438c239f
FC
3395Opening a file in C<:raw> mode now does what it advertises to do (first
3396open the file, then binmode it), instead of simply leaving off the top
3397layer [perl #80764].
5076a392 3398
438c239f
FC
3399The three layers C<:pop>, C<:utf8> and C<:bytes> didn't allow stacking when
3400opening a file. For example
e8e35311 3401this:
5076a392 3402
e8e35311 3403 open FH, '>:pop:perlio', 'some.file' or die $!;
5076a392 3404
438c239f
FC
3405Would throw an error: "Invalid argument". This has been fixed in this
3406release [perl #82484].
5076a392 3407
e8e35311
FC
3408=back
3409
3410=head2 Regular Expression Bug Fixes
3411
3412=over
5076a392
FC
3413
3414=item *
3415
e8e35311
FC
3416The regular expression engine no longer loops when matching
3417C<"\N{LATIN SMALL LIGATURE FF}" =~ /f+/i> and similar expressions
cdc10f43 3418[perl #72998] (5.12.1).
5076a392
FC
3419
3420=item *
3421
e8e35311
FC
3422The trie runtime code should no longer allocate massive amounts of memory,
3423fixing #74484.
5076a392
FC
3424
3425=item *
3426
438c239f
FC
3427Syntax errors in C<< (?{...}) >> blocks no longer cause panic messages
3428[perl #2353].
5076a392
FC
3429
3430=item *
3431
438c239f
FC
3432A pattern like C<(?:(o){2})?> no longer causes a "panic" error
3433[perl #39233].
5076a392
FC
3434
3435=item *
3436
438c239f 3437A fatal error in regular expressions containing C<(.*?)> when processing
d430b8e7 3438UTF-8 data has been fixed [perl #75680] (5.12.2).
5076a392
FC
3439
3440=item *
3441
e8e35311 3442An erroneous regular expression engine optimisation that caused regex verbs like
438c239f 3443C<*COMMIT> sometimes to be ignored has been removed.
5076a392
FC
3444
3445=item *
3446
e8e35311
FC
3447The regular expression bracketed character class C<[\8\9]> was effectively the
3448same as C<[89\000]>, incorrectly matching a NULL character. It also gave
3449incorrect warnings that the C<8> and C<9> were ignored. Now C<[\8\9]> is the
3450same as C<[89]> and gives legitimate warnings that C<\8> and C<\9> are
3451unrecognized escape sequences, passed-through.
5076a392
FC
3452
3453=item *
3454
e8e35311
FC
3455A regular expression match in the right-hand side of a global substitution
3456(C<s///g>) that is in the same scope will no longer cause match variables
cbb8c2bc 3457to have the wrong values on subsequent iterations. This can happen when an
e8e35311
FC
3458array or hash subscript is interpolated in the right-hand side, as in
3459C<s|(.)|@a{ print($1), /./ }|g> [perl #19078].
5076a392
FC
3460
3461=item *
3462
438c239f
FC
3463Several cases in which characters in the Latin-1 non-ASCII range (0x80 to
34640xFF) used not to match themselves or used to match both a character class
3465and its complement have been fixed. For instance, U+00E2 could match both
3466C<\w> and C<\W> [perl #78464] [perl #18281] [perl #60156].
5076a392
FC
3467
3468=item *
3469
e8e35311
FC
3470Matching a Unicode character against an alternation containing characters
3471that happened to match continuation bytes in the former's UTF8
3472representation (C<qq{\x{30ab}} =~ /\xab|\xa9/>) would cause erroneous
3473warnings [perl #70998].
5076a392
FC
3474
3475=item *
3476
e8e35311
FC
3477The trie optimisation was not taking empty groups into account, preventing
3478'foo' from matching C</\A(?:(?:)foo|bar|zot)\z/> [perl #78356].
5076a392
FC
3479
3480=item *
3481
e8e35311
FC
3482A pattern containing a C<+> inside a lookahead would sometimes cause an
3483incorrect match failure in a global match (e.g., C</(?=(\S+))/g>)
3484[perl #68564].
5076a392
FC
3485
3486=item *
3487