This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta: Clean up the Documentation section
[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
12Some of the bug fixes in this release have been backported to subsequent
13releases of 5.12.x. Those are indicated with the 5.12.x version in
14parentheses.
15
16XXX Go through the perl512*delta files and do that.
17
18=head1 Notice
19
20XXX Any important notices here
21
22=head1 Core Enhancements
23
1f539a1a 24=head2 Unicode
5076a392 25
1f539a1a 26=head3 Unicode Version 6.0 is now supported (mostly)
5076a392 27
1f539a1a
FC
28Perl comes with the Unicode 6.0 data base updated with
29L<Corrigendum #8|http://www.unicode.org/versions/corrigendum8.html>,
30with one exception noted below.
31See L<http://unicode.org/versions/Unicode6.0.0> for details on the new
32release. Perl does not support any Unicode provisional properties,
33including the new ones for this release, but their database files are
34packaged with Perl.
5076a392 35
1f539a1a 36Unicode 6.0 has chosen to use the name C<BELL> for the character at U+1F514,
e1b1739f 37which is a symbol that looks like a bell, and is used in Japanese cell
1f539a1a
FC
38phones. This conflicts with the long-standing Perl usage of having
39C<BELL> mean the ASCII C<BEL> character, U+0007. In Perl 5.14,
40C<\N{BELL}> will continue to mean U+0007, but its use will generate a
41deprecated warning message, unless such warnings are turned off. The
42new name for U+0007 in Perl will be C<ALERT>, which corresponds nicely
43with the existing shorthand sequence for it, C<"\a">. C<\N{BEL}> will
44mean U+0007, with no warning given. The character at U+1F514 will not
45have a name in 5.14, but can be referred to by C<\N{U+1F514}>. The plan
46is that in Perl 5.16, C<\N{BELL}> will refer to U+1F514, and so all code
47that uses C<\N{BELL}> should convert by then to using C<\N{ALERT}>,
48C<\N{BEL}>, or C<"\a"> instead.
5076a392 49
1f539a1a 50=head3 Full functionality for C<use feature 'unicode_strings'>
5076a392 51
1f539a1a
FC
52This release provides full functionality for C<use feature
53'unicode_strings'>. Under its scope, all string operations executed and
54regular expressions compiled (even if executed outside its scope) have
55Unicode semantics. See L<feature>.
5076a392 56
1f539a1a
FC
57This feature avoids most forms of the "Unicode Bug" (See
58L<perlunicode/The "Unicode Bug"> for details.) If there is a
59possibility that your code will process Unicode strings, you are
60B<strongly> encouraged to use this subpragma to avoid nasty surprises.
5076a392 61
1f539a1a 62=head3 C<\N{I<name>}> and C<charnames> enhancements
5076a392 63
1f539a1a 64=over
5076a392 65
1f539a1a 66=item *
5076a392
FC
67
68C<\N{}> and C<charnames::vianame> now know about the abbreviated
e1b1739f
FC
69character names listed by Unicode, such as NBSP, SHY, LRO, ZWJ, etc., all
70the customary abbreviations for the C0 and C1 control characters (such as
71ACK, BEL, CAN, etc.), and a few new variants of some C1 full names that
72are in common usage.
5076a392 73
1f539a1a
FC
74=item *
75
959ad7d5
FC
76Unicode has a number of named character sequences, in which particular sequences
77of code points are given names. C<\N{...}> now recognizes these.
78
1f539a1a
FC
79=item *
80
959ad7d5
FC
81C<\N{}>, C<charnames::vianame>, C<charnames::viacode> now know about every
82character in Unicode. Previously, they didn't know about the Hangul syllables
83nor a number of CJK (Chinese/Japanese/Korean) characters.
84
1f539a1a
FC
85=item *
86
5076a392
FC
87In the past, it was ineffective to override one of Perl's abbreviations
88with your own custom alias. Now it works.
89
1f539a1a
FC
90=item *
91
e1b1739f 92You can also create a custom alias of the ordinal of a
5076a392
FC
93character, known by C<\N{...}>, C<charnames::vianame()>, and
94C<charnames::viacode()>. Previously, an alias had to be to an official
95Unicode character name. This made it impossible to create an alias for
e1b1739f
FC
96a code point that had no name, such as those reserved for private
97use.
5076a392 98
1f539a1a
FC
99=item *
100
959ad7d5
FC
101A new function, C<charnames::string_vianame()>, has been added.
102This function is a run-time version of C<\N{...}>, returning the string
103of characters whose Unicode name is its parameter. It can handle
104Unicode named character sequences, whereas the pre-existing
105C<charnames::vianame()> cannot, as the latter returns a single code
106point.
107
1f539a1a
FC
108=back
109
5076a392
FC
110See L<charnames> for details on all these changes.
111
1f539a1a 112=head3 Any unsigned value can be encoded as a character
5076a392 113
1f539a1a
FC
114With this release, Perl is adopting a model that any unsigned value can
115be treated as a code point and encoded internally (as utf8) without
54c7bb16 116warnings - not just the code points that are legal in Unicode.
1f539a1a
FC
117However, unless utf8 warnings have been
118explicitly lexically turned off, outputting or performing a
119Unicode-defined operation (such as upper-casing) on such a code point
120will generate a warning. Attempting to input these using strict rules
121(such as with the C<:encoding('UTF-8')> layer) will continue to fail.
122Prior to this release the handling was very inconsistent, and incorrect
123in places. Also, the Unicode non-characters, some of which previously were
124erroneously considered illegal in places by Perl, contrary to the Unicode
125standard, are now always legal internally. But inputting or outputting
126them will work the same as for the non-legal Unicode code points, as the
127Unicode standard says they are illegal for "open interchange".
5076a392 128
1f539a1a 129=head3 New warnings categories for problematic (non-)Unicode code points.
5076a392 130
e1b1739f
FC
131Three new warnings subcategories of "utf8" have been added. These
132allow you to turn off some "utf8" warnings, while allowing
133others warnings to remain on. The three categories are:
1f539a1a
FC
134C<surrogate> when UTF-16 surrogates are encountered;
135C<nonchar> when Unicode non-character code points are encountered;
136and C<non_unicode> when code points that are above the legal Unicode
137maximum of 0x10FFFF are encountered.
5076a392 138
1f539a1a 139=head2 Regular Expressions
5076a392 140
1f539a1a 141=head3 C<(?^...)> construct to signify default modifiers
5076a392 142
e1b1739f
FC
143An ASCII caret (also called a "circumflex accent") C<"^">
144immediately following a C<"(?"> in a regular expression
145now means that the subexpression does not inherit the
146surrounding modifiers such as C</i>, but reverts to the
5076a392
FC
147Perl defaults. Any modifiers following the caret override the defaults.
148
149The stringification of regular expressions now uses this
150notation. E.g., before, C<qr/hlagh/i> would be stringified as
151C<(?i-xsm:hlagh)>, but now it's stringified as C<(?^i:hlagh)>.
152
153The main purpose of this is to allow tests that rely on the
e1b1739f 154stringification not to have to change when new modifiers are added.
5076a392
FC
155See L<perlre/Extended Patterns>.
156
1f539a1a 157=head3 C</d>, C</l>, C</u>, C</a>, and C</aa> modifiers
5076a392 158
959ad7d5
FC
159Four new regular expression modifiers have been added. These are mutually
160exclusive; one only can be turned on at a time.
5076a392 161
959ad7d5 162The C</l> modifier says to compile the regular expression as if it were
5076a392
FC
163in the scope of C<use locale>, even if it is not.
164
959ad7d5 165The C</u> modifier says to compile the regular expression as if it were
5076a392
FC
166in the scope of a C<use feature "unicode_strings"> pragma.
167
e1b1739f 168The C</d> (default) modifier is used to override any C<use locale> and
5076a392
FC
169C<use feature "unicode_strings"> pragmas that are in effect at the time
170of compiling the regular expression.
171
959ad7d5
FC
172The C</a> regular expression modifier restricts C<\s>, C<\d> and C<\w> and
173the Posix (C<[[:posix:]]>) character classes to the ASCII range. The
174complements and C<\b> and C<\B> are correspondingly
175affected. Otherwise, C</a> behaves like the C</u> modifier, in that
e1b1739f 176case-insensitive matching uses Unicode semantics.
5076a392 177
959ad7d5
FC
178The C</aa> modifier is like C</a>, except that, in case-insensitive matching, no ASCII character will match a
179non-ASCII character. For example,
5076a392 180
959ad7d5 181 'k' =~ /\N{KELVIN SIGN}/ai
5076a392 182
959ad7d5 183will match; it won't under C</aa>.
5076a392 184
959ad7d5 185See L<perlre/Modifiers> for more detail.
5076a392 186
1f539a1a 187=head3 Non-destructive substitution
5076a392 188
1f539a1a
FC
189The substitution (C<s///>) and transliteration
190(C<y///>) operators now support an C</r> option that
191copies the input variable, carries out the substitution on
192the copy and returns the result. The original remains unmodified.
5076a392 193
1f539a1a
FC
194 my $old = 'cat';
195 my $new = $old =~ s/cat/dog/r;
196 # $old is 'cat' and $new is 'dog'
5076a392 197
1f539a1a 198This is particularly useful with C<map>. See L<perlop> for more examples.
5076a392 199
1f539a1a 200=head3 Reentrant regular expression engine
5076a392 201
1f539a1a
FC
202It is now safe to use regular expressions within C<(?{...})> and
203C<(??{...})> code blocks inside regular expressions.
5076a392 204
1f539a1a 205These block are still experimental, however, and still have problems with
e1b1739f 206lexical (C<my>) variables and abnormal exiting.
5076a392 207
1f539a1a 208=head3 C<use re '/flags';>
5076a392
FC
209
210The C<re> pragma now has the ability to turn on regular expression flags
211till the end of the lexical scope:
212
213 use re '/x';
214 "foo" =~ / (.+) /; # /x implied
215
216See L<re/"'/flags' mode"> for details.
217
1f539a1a 218=head3 \o{...} for octals
5076a392 219
e1b1739f
FC
220There is a new octal escape sequence, C<"\o">, in double-quote-like
221contexts. This construct allows large octal ordinals beyond the
1f539a1a
FC
222current max of 0777 to be represented. It also allows you to specify a
223character in octal which can safely be concatenated with other regex
224snippets and which won't be confused with being a backreference to
225a regex capture group. See L<perlre/Capture groups>.
226
227=head3 Add C<\p{Titlecase}> as a synonym for C<\p{Title}>
228
229This synonym is added for symmetry with the Unicode property names
230C<\p{Uppercase}> and C<\p{Lowercase}>.
5076a392 231
1f539a1a
FC
232=head3 Regular expression debugging output improvement
233
234Regular expression debugging output (turned on by C<use re 'debug';>) now
235uses hexadecimal when escaping non-ASCII characters, instead of octal.
236
237=head2 Syntactical Enhancements
238
239=head3 Array and hash container functions accept references
5076a392
FC
240
241All built-in functions that operate directly on array or hash
242containers now also accept hard references to arrays or hashes:
243
244 |----------------------------+---------------------------|
245 | Traditional syntax | Terse syntax |
246 |----------------------------+---------------------------|
247 | push @$arrayref, @stuff | push $arrayref, @stuff |
248 | unshift @$arrayref, @stuff | unshift $arrayref, @stuff |
249 | pop @$arrayref | pop $arrayref |
250 | shift @$arrayref | shift $arrayref |
251 | splice @$arrayref, 0, 2 | splice $arrayref, 0, 2 |
252 | keys %$hashref | keys $hashref |
253 | keys @$arrayref | keys $arrayref |
254 | values %$hashref | values $hashref |
255 | values @$arrayref | values $arrayref |
256 | ($k,$v) = each %$hashref | ($k,$v) = each $hashref |
257 | ($k,$v) = each @$arrayref | ($k,$v) = each $arrayref |
258 |----------------------------+---------------------------|
259
260This allows these built-in functions to act on long dereferencing chains
261or on the return value of subroutines without needing to wrap them in
262C<@{}> or C<%{}>:
263
264 push @{$obj->tags}, $new_tag; # old way
265 push $obj->tags, $new_tag; # new way
266
267 for ( keys %{$hoh->{genres}{artists}} ) {...} # old way
268 for ( keys $hoh->{genres}{artists} ) {...} # new way
269
270For C<push>, C<unshift> and C<splice>, the reference will auto-vivify
271if it is not defined, just as if it were wrapped with C<@{}>.
272
5076a392
FC
273For C<keys>, C<values>, C<each>, when overloaded dereferencing is
274present, the overloaded dereference is used instead of dereferencing the
e1b1739f
FC
275underlying reftype. Warnings are issued about assumptions made in
276ambiguous cases.
5076a392 277
1f539a1a
FC
278=head3 Single term prototype
279
280The C<+> prototype is a special alternative to C<$> that will act like
281C<\[@%]> when given a literal array or hash variable, but will otherwise
e1b1739f 282force scalar context on the argument. See L<perlsub/Prototypes>.
1f539a1a
FC
283
284=head3 C<package> block syntax
285
286A package declaration can now contain a code block, in which case the
287declaration is in scope only inside that block. So C<package Foo { ... }>
288is precisely equivalent to C<{ package Foo; ... }>. It also works with
289a version number in the declaration, as in C<package Foo 1.2 { ... }>.
e1b1739f 290See L<perlfunc>.
1f539a1a
FC
291
292=head3 Statement labels can appear in more places
293
294Statement labels can now occur before any type of statement or declaration,
295such as C<package>.
296
297=head3 Stacked labels
298
299Multiple statement labels can now appear before a single statement.
300
301=head3 Uppercase X/B allowed in hexadecimal/binary literals
302
303Literals may now use either upper case C<0X...> or C<0B...> prefixes,
304in addition to the already supported C<0x...> and C<0b...>
e1b1739f 305syntax [perl #76296].
1f539a1a
FC
306
307C, Ruby, Python and PHP already supported this syntax, and it makes
308Perl more internally consistent. A round-trip with C<eval sprintf
e1b1739f 309"%#X", 0x10> now returns C<16>, the way C<eval sprintf "%#x", 0x10> does.
1f539a1a
FC
310
311=head2 Exception Handling
312
313Several changes have been made to the way C<die>, C<warn>, and C<$@>
314behave, in order to make them more reliable and consistent.
315
316When an exception is thrown inside an C<eval>, the exception is no
317longer at risk of being clobbered by code running during unwinding
318(e.g., destructors). Previously, the exception was written into C<$@>
319early in the throwing process, and would be overwritten if C<eval> was
320used internally in the destructor for an object that had to be freed
321while exiting from the outer C<eval>. Now the exception is written
322into C<$@> last thing before exiting the outer C<eval>, so the code
323running immediately thereafter can rely on the value in C<$@> correctly
324corresponding to that C<eval>. (C<$@> is still also set before exiting the
325C<eval>, for the sake of destructors that rely on this.)
326
327Likewise, a C<local $@> inside an C<eval> will no longer clobber any
328exception thrown in its scope. Previously, the restoration of C<$@> upon
329unwinding would overwrite any exception being thrown. Now the exception
330gets to the C<eval> anyway. So C<local $@> is safe before a C<die>.
331
332Exceptions thrown from object destructors no longer modify the C<$@>
333of the surrounding context. (If the surrounding context was exception
334unwinding, this used to be another way to clobber the exception being
335thrown.) Previously such an exception was
336sometimes emitted as a warning, and then either was
337string-appended to the surrounding C<$@> or completely replaced the
338surrounding C<$@>, depending on whether that exception and the surrounding
339C<$@> were strings or objects. Now, an exception in this situation is
340always emitted as a warning, leaving the surrounding C<$@> untouched.
341In addition to object destructors, this also affects any function call
342performed by XS code using the C<G_KEEPERR> flag.
343
344Warnings for C<warn> can now be objects, in the same way as exceptions
345for C<die>. If an object-based warning gets the default handling,
346of writing to standard error, it is stringified as
347before, with the file and line number appended. But
348a C<$SIG{__WARN__}> handler will now receive an
349object-based warning as an object, where previously it was passed the
350result of stringifying the object.
351
352=head2 Other Enhancements
353
354=head3 Assignment to C<$0> sets the legacy process name with C<prctl()> on Linux
355
356On Linux the legacy process name will be set with L<prctl(2)>, in
357addition to altering the POSIX name via C<argv[0]> as perl has done
358since version 4.000. Now system utilities that read the legacy process
359name such as ps, top and killall will recognize the name you set when
360assigning to C<$0>. The string you supply will be cut off at 16 bytes,
361this is a limitation imposed by Linux.
362
363=head3 C<srand()> now returns the seed
364
e1b1739f
FC
365This allows programs that need to have repeatable results not to have to come
366up with their own seed-generating mechanism. Instead, they can use C<srand()>
367and stash the return value for future use. Typical is a test program which
1f539a1a 368has too many combinations to test comprehensively in the time available to it
e1b1739f 369each run. It can test a random subset each time and, should there be a failure,
1f539a1a 370log the seed used for that run so that it can later be used to reproduce the
e1b1739f 371same results.
1f539a1a
FC
372
373=head3 printf-like functions understand post-1980 size modifiers
374
375Perl's printf and sprintf operators, and Perl's internal printf replacement
376function, now understand the C90 size modifiers "hh" (C<char>), "z"
377(C<size_t>), and "t" (C<ptrdiff_t>). Also, when compiled with a C99
378compiler, Perl now understands the size modifier "j" (C<intmax_t>).
379
380So, for example, on any modern machine, C<sprintf('%hhd', 257)> returns '1'.
381
382=head3 New global variable C<${^GLOBAL_PHASE}>
5076a392
FC
383
384A new global variable, C<${^GLOBAL_PHASE}>, has been added to allow
385introspection of the current phase of the perl interpreter. It's explained in
386detail in L<perlvar/"${^GLOBAL_PHASE}"> and
387L<perlmod/"BEGIN, UNITCHECK, CHECK, INIT and END">.
388
1f539a1a 389=head3 C<-d:-foo> calls C<Devel::foo::unimport>
5076a392
FC
390
391The syntax C<-dI<B<:>foo>> was extended in 5.6.1 to make C<-dI<:fooB<=bar>>>
392equivalent to C<-MDevel::foo=bar>, which expands
393internally to C<use Devel::foo 'bar';>.
394F<perl> now allows prefixing the module name with C<->, with the same
395semantics as C<-M>, I<i.e.>
396
397=over 4
398
399=item C<-d:-foo>
400
401Equivalent to C<-M-Devel::foo>, expands to
402C<no Devel::foo;>, calls C<< Devel::foo->unimport() >>
403if the method exists.
404
405=item C<-d:-foo=bar>
406
407Equivalent to C<-M-Devel::foo=bar>, expands to C<no Devel::foo 'bar';>,
408calls C<< Devel::foo->unimport('bar') >> if the method exists.
409
410=back
411
e1b1739f 412This is particularly useful for suppressing the default actions of a
5076a392
FC
413C<Devel::*> module's C<import> method whilst still loading it for debugging.
414
1f539a1a 415=head3 Filehandle method calls load L<IO::File> on demand
5076a392
FC
416
417When a method call on a filehandle would die because the method cannot
418be resolved, and L<IO::File> has not been loaded, Perl now loads L<IO::File>
419via C<require> and attempts method resolution again:
420
421 open my $fh, ">", $file;
422 $fh->binmode(":raw"); # loads IO::File and succeeds
423
424This also works for globs like STDOUT, STDERR and STDIN:
425
426 STDOUT->autoflush(1);
427
428Because this on-demand load only happens if method resolution fails, the
429legacy approach of manually loading an L<IO::File> parent class for partial
430method support still works as expected:
431
432 use IO::Handle;
433 open my $fh, ">", $file;
434 $fh->autoflush(1); # IO::File not loaded
435
1984204c
FC
436=head3 IPv6 support
437
438The C<Socket> module provides new affordances for IPv6,
439including implementations of the C<Socket::getaddrinfo()> and
440C<Socket::getnameinfo()> functions, along with related constants, and a
441handful of new functions. See L<Socket>.
442
1f539a1a 443=head3 DTrace probes now include package name
5076a392
FC
444
445The DTrace probes now include an additional argument (C<arg3>) which contains
446the package the subroutine being entered or left was compiled in.
447
448For example using the following DTrace script:
449
450 perl$target:::sub-entry
451 {
452 printf("%s::%s\n", copyinstr(arg0), copyinstr(arg3));
453 }
454
455and then running:
456
457 perl -e'sub test { }; test'
458
459DTrace will print:
460
461 main::test
462
9378886b
FC
463=head2 New C APIs
464
aa81da68
FC
465=head3 CLONE_PARAMS structure added to ease correct thread creation
466
467Modules that create threads should now create C<CLONE_PARAMS> structures
468by calling the new function C<Perl_clone_params_new()>, and free them with
469C<Perl_clone_params_del()>. This will ensure compatibility with any future
470changes to the internals of the C<CLONE_PARAMS> structure layout, and that
471it is correctly allocated and initialised.
472
473=head3 API function to parse statements
474
475The C<parse_fullstmt> function has been added to allow parsing of a single
476complete Perl statement. See L<perlapi> for details.
477
478=head3 API functions for accessing the runtime hinthash
479
480A new C API for introspecting the hinthash C<%^H> at runtime has been added.
481See C<cop_hints_2hv>, C<cop_hints_fetchpvn>, C<cop_hints_fetchpvs>,
482C<cop_hints_fetchsv>, and C<hv_copy_hints_hv> in L<perlapi> for details.
483
484=head3 C interface to C<caller()>
485
486The C<caller_cx> function has been added as an XSUB-writer's equivalent of
487C<caller()>. See L<perlapi> for details.
488
489=head3 Custom per-subroutine check hooks
490
491XS code in an extension module can now annotate a subroutine (whether
492implemented in XS or in Perl) so that nominated XS code will be called
493at compile time (specifically as part of op checking) to change the op
494tree of that subroutine. The compile-time check function (supplied by
495the extension module) can implement argument processing that can't be
496expressed as a prototype, generate customised compile-time warnings,
497perform constant folding for a pure function, inline a subroutine
498consisting of sufficiently simple ops, replace the whole call with a
499custom op, and so on. This was previously all possible by hooking the
500C<entersub> op checker, but the new mechanism makes it easy to tie the
501hook to a specific subroutine. See L<perlapi/cv_set_call_checker>.
502
503To help in writing custom check hooks, several subtasks within standard
504C<entersub> op checking have been separated out and exposed in the API.
505
506=head3 Improved support for custom OPs
507
508Custom ops can now be registered with the new C<custom_op_register> C
509function and the C<XOP> structure. This will make it easier to add new
510properties of custom ops in the future. Two new properties have been added
511already, C<xop_class> and C<xop_peep>.
512
513C<xop_class> is one of the OA_*OP constants, and allows L<B> and other
514introspection mechanisms to work with custom ops that aren't BASEOPs.
515C<xop_peep> is a pointer to a function that will be called for ops of this
516type from C<Perl_rpeep>.
517
518See L<perlguts/Custom Operators> and L<perlapi/Custom Operators> for more
519detail.
520
521The old C<PL_custom_op_names>/C<PL_custom_op_descs> interface is still
522supported but discouraged.
523
524=head3 Return value of C<delete $+{...}>
525
526Custom regular expression engines can now determine the return value of
527C<delete> on an entry of C<%+> or C<%->.
528
529XXX Mention the actual API.
9378886b 530
5076a392
FC
531=head1 Security
532
948b8455 533=head2 User-defined regular expression properties
5076a392
FC
534
535In L<perlunicode/"User-Defined Character Properties">, it says you can
536create custom properties by defining subroutines whose names begin with
948b8455
FC
537"In" or "Is". However, Perl did not actually enforce that naming
538restriction, so \p{foo::bar} could call foo::bar() if it existed. Now this
539convention has been enforced.
5076a392 540
948b8455
FC
541Also, Perl no longer allows a tainted regular expression to invoke a
542user-defined. It simply dies instead [perl #82616].
5076a392
FC
543
544=head1 Incompatible Changes
545
61752d82
FC
546Perl 5.14.0 is not binary-compatible with any previous stable release.
547
548=head2 Regular Expressions and String Escapes
549
550=head3 C<\cI<X>>
5076a392
FC
551
552The backslash-c construct was designed as a way of specifying
553non-printable characters, but there were no restrictions (on ASCII
554platforms) on what the character following the C<c> could be. Now, that
555character must be one of the ASCII characters.
556
54c7bb16 557=head3 \400-\777
5076a392 558
54c7bb16 559Use of C<\400>-C<\777> in regexes in certain circumstances has given
5076a392
FC
560different, anomalous behavior than their use in all other
561double-quote-like contexts. Since 5.10.1, a deprecated warning message
562has been raised when this happens. Now, all double-quote-like contexts
563have the same behavior, namely to be equivalent to C<\x{100}> -
564C<\x{1FF}>, with no deprecation warning. Use of these values in the
565command line option C<"-0"> retains the current meaning to slurp input
566files whole; previously, this was documented only for C<"-0777">. It is
567recommended, however, because of various ambiguities, to use the new
568C<\o{...}> construct to represent characters in octal.
5076a392 569
61752d82 570=head3 Most C<\p{}> properties are now immune to case-insensitive matching
5076a392 571
61752d82
FC
572For most Unicode properties, it doesn't make sense to have them match
573differently under C</i> case-insensitive matching than not. And doing
574so leads to unexpected results and potential security holes. For
575example
5076a392 576
61752d82 577 m/\p{ASCII_Hex_Digit}+/i
5076a392 578
61752d82
FC
579could previously match non-ASCII characters because of the Unicode
580matching rules. There were a number of bugs in this feature until an
581earlier release in the 5.13 series. Now this release reverts, and
582removes the feature completely except for the few properties where
583people have come to expect it, namely the ones where casing is an
584integral part of their functionality, such as C<m/\p{Uppercase}/i> and
585C<m/\p{Lowercase}/i>, both of which match the exact same code points,
586namely those matched by C<m/\p{Cased}/i>. Details are in
587L<perlrecharclass/Unicode Properties>.
5076a392 588
61752d82
FC
589XXX The mention of ‘until an earlier release in the 5.13 series’ needs to
590change, but I do not fully understand what happened here.
5076a392 591
61752d82
FC
592User-defined property handlers that need to match differently under
593C</i> must change to read the new boolean parameter passed to it which is
594non-zero if case-insensitive matching is in effect or 0 otherwise. See
595L<perluniprops/User-Defined Character Properties>.
5076a392 596
61752d82 597=head3 \p{} implies Unicode semantics
5076a392 598
61752d82
FC
599Now, a Unicode property match specified in the pattern will indicate
600that the pattern is meant for matching according to Unicode rules, the way
601C<\x{}> does.
5076a392 602
61752d82 603=head3 Regular expressions retain their localeness when interpolated
5076a392 604
61752d82
FC
605Regular expressions compiled under C<"use locale"> now retain this when
606interpolated into a new regular expression compiled outside a
607C<"use locale">, and vice-versa.
5076a392 608
61752d82
FC
609Previously, a regular expression interpolated into another one inherited
610the localeness of the surrounding one, losing whatever state it
611originally had. This is considered a bug fix, but may trip up code that
612has come to rely on the incorrect behavior.
5076a392 613
61752d82 614=head3 Stringification of regexes has changed
5076a392
FC
615
616Default regular expression modifiers are now notated by using
617C<(?^...)>. Code relying on the old stringification will fail. The
618purpose of this is so that when new modifiers are added, such code will
619not have to change (after this one time), as the stringification will
620automatically incorporate the new modifiers.
621
622Code that needs to work properly with both old- and new-style regexes
f318e2e6 623can avoid the whole issue by using (for Perls since 5.9.5; see L<re>):
5076a392
FC
624
625 use re qw(regexp_pattern);
626 my ($pat, $mods) = regexp_pattern($re_ref);
627
5076a392
FC
628If the actual stringification is important, or older Perls need to be
629supported, you can use something like the following:
630
631 # Accept both old and new-style stringification
632 my $modifiers = (qr/foobar/ =~ /\Q(?^/) ? '^' : '-xism';
633
634And then use C<$modifiers> instead of C<-xism>.
635
61752d82 636=head3 Run-time code blocks in regular expressions inherit pragmata
5076a392 637
61752d82
FC
638Code blocks in regular expressions (C<(?{...})> and C<(??{...})>) used not
639to inherit any pragmata (strict, warnings, etc.) if the regular expression
640was compiled at run time as happens in cases like these two:
5076a392 641
61752d82
FC
642 use re 'eval';
643 $foo =~ $bar; # when $bar contains (?{...})
644 $foo =~ /$bar(?{ $finished = 1 })/;
645
646This was a bug, which has now been fixed. But it has the potential to break
647any code that was relying on it.
5076a392 648
61752d82 649=head2 Stashes and Package Variables
5076a392 650
61752d82 651=head3 Localised tied hashes and arrays are no longed tied
5076a392 652
61752d82 653In the following:
5076a392 654
61752d82
FC
655 tie @a, ...;
656 {
657 local @a;
658 # here, @a is a now a new, untied array
659 }
660 # here, @a refers again to the old, tied array
5076a392 661
61752d82
FC
662The new local array used to be made tied too, which was fairly pointless,
663and has now been fixed. This fix could however potentially cause a change
664in behaviour of some code.
5076a392 665
61752d82 666=head3 Stashes are now always defined
5076a392 667
61752d82
FC
668C<defined %Foo::> now always returns true, even when no symbols have yet been
669defined in that package.
5076a392 670
61752d82
FC
671This is a side effect of removing a special case kludge in the tokeniser,
672added for 5.10.0, to hide side effects of changes to the internal storage of
673hashes that drastically reduce their memory usage overhead.
674
675Calling defined on a stash has been deprecated since 5.6.0, warned on
676lexicals since 5.6.0, and warned for stashes (and other package
677variables) since 5.12.0. C<defined %hash> has always exposed an
678implementation detail - emptying a hash by deleting all entries from it does
679not make C<defined %hash> false, hence C<defined %hash> is not valid code to
680determine whether an arbitrary hash is empty. Instead, use the behaviour
681that an empty C<%hash> always returns false in a scalar context.
682
683=head3 Dereferencing typeglobs
5076a392
FC
684
685If you assign a typeglob to a scalar variable:
686
687 $glob = *foo;
688
689the glob that is copied to C<$glob> is marked with a special flag
690indicating that the glob is just a copy. This allows subsequent assignments
691to C<$glob> to overwrite the glob. The original glob, however, is
692immutable.
693
694Many Perl operators did not distinguish between these two types of globs.
695This would result in strange behaviour in edge cases: C<untie $scalar>
696would do nothing if the last thing assigned to the scalar was a glob
697(because it treated it as C<untie *$scalar>, which unties a handle).
f318e2e6 698Assignment to a glob slot (e.g., C<*$glob = \@some_array>) would simply
5076a392
FC
699assign C<\@some_array> to C<$glob>.
700
701To fix this, the C<*{}> operator (including the C<*foo> and C<*$foo> forms)
702has been modified to make a new immutable glob if its operand is a glob
703copy. Various operators that make a distinction between globs and scalars
61752d82
FC
704have been modified to treat only immutable globs as globs. (C<tie>,
705C<tied> and C<untie> has been left as they are for compatibility's sake,
706but will warn. See L</Deprecations>.)
5076a392
FC
707
708This causes an incompatible change in code that assigns a glob to the
709return value of C<*{}> when that operator was passed a glob copy. Take the
710following code, for instance:
711
712 $glob = *foo;
713 *$glob = *bar;
714
715The C<*$glob> on the second line returns a new immutable glob. That new
716glob is made an alias to C<*bar>. Then it is discarded. So the second
717assignment has no effect.
718
5076a392
FC
719The upside to this incompatible change is that bugs [perl #77496],
720[perl #77502], [perl #77508], [perl #77688], and [perl #77812],
721and maybe others, too, have been fixed.
722
723See L<http://rt.perl.org/rt3/Public/Bug/Display.html?id=77810> for even
724more detail.
725
61752d82 726=head3 Clearing stashes
5076a392
FC
727
728Stash list assignment C<%foo:: = ()> used to make the stash anonymous
729temporarily while it was being emptied. Consequently, any of its
730subroutines referenced elsewhere would become anonymous (showing up as
731"(unknown)" in C<caller>). Now they retain their package names, such that
732C<caller> will return the original sub name if there is still a reference
733to its typeglob, or "foo::__ANON__" otherwise [perl #79208].
734
61752d82
FC
735=head3 Magic variables outside the main package
736
737In previous versions of Perl, magic variables like C<$!>, C<%SIG>, etc. would
738'leak' into other packages. So C<%foo::SIG> could be used to access signals,
739C<${"foo::!"}> (with strict mode off) to access C's C<errno>, etc.
740
741This was a bug, or an 'unintentional' feature, which caused various ill effects,
742such as signal handlers being wiped when modules were loaded, etc.
743
744This has been fixed (or the feature has been removed, depending on how you see
745it).
746
747=head2 Changes to Syntax or to Perl Operators
748
749=head3 C<given> return values
750
751C<given> blocks now return the last evaluated
752expression, or an empty list if the block was exited by C<break>. Thus you
753can now write:
754
755 my $type = do {
756 given ($num) {
757 break when undef;
758 'integer' when /^[+-]?[0-9]+$/;
759 'float' when /^[+-]?[0-9]+(?:\.[0-9]+)?$/;
760 'unknown';
761 }
762 };
763
764See L<perlsyn/Return value> for details.
765
766=head3 Change in the parsing of certain prototypes
767
768Functions declared with the following prototypes now behave correctly as unary
769functions:
770
771 *
772 \$ \% \@ \* \&
773 \[...]
774 ;$ ;*
775 ;\$ ;\% etc.
776 ;\[...]
777
778Due to this bug fix [perl #75904], functions
779using the C<(*)>, C<(;$)> and C<(;*)> prototypes
780are parsed with higher precedence than before. So in the following example:
781
782 sub foo($);
783 foo $a < $b;
784
785the second line is now parsed correctly as C<< foo($a) < $b >>, rather than
786C<< foo($a < $b) >>. This happens when one of these operators is used in
787an unparenthesised argument:
788
789 < > <= >= lt gt le ge
790 == != <=> eq ne cmp ~~
791 &
792 | ^
793 &&
794 || //
795 .. ...
796 ?:
797 = += -= *= etc.
798
799=head3 Smart-matching against array slices
800
801Previously, the following code resulted in a successful match:
802
803 my @a = qw(a y0 z);
804 my @b = qw(a x0 z);
805 @a[0 .. $#b] ~~ @b;
806
807This odd behaviour has now been fixed [perl #77468].
808
809=head3 Negation treats strings differently from before
810
811The unary negation operator C<-> now treats strings that look like numbers
812as numbers [perl #57706].
813
814=head3 Negative zero
815
816Negative zero (-0.0), when converted to a string, now becomes "0" on all
817platforms. It used to become "-0" on some, but "0" on others.
818
819If you still need to determine whether a zero is negative, use
820C<sprintf("%g", $zero) =~ /^-/> or the L<Data::Float> module on CPAN.
821
822=head3 C<:=> is now a syntax error
5076a392
FC
823
824Previously C<my $pi := 4;> was exactly equivalent to C<my $pi : = 4;>,
825with the C<:> being treated as the start of an attribute list, ending before
826the C<=>. The use of C<:=> to mean C<: => was deprecated in 5.12.0, and is now
827a syntax error. This will allow the future use of C<:=> as a new token.
828
829We find no Perl 5 code on CPAN using this construction, outside the core's
830tests for it, so we believe that this change will have very little impact on
831real-world codebases.
832
833If it is absolutely necessary to have empty attribute lists (for example,
834because of a code generator) then avoid the error by adding a space before
835the C<=>.
836
61752d82 837=head2 Threads and Processes
5076a392 838
61752d82 839=head3 Directory handles not copied to threads
5076a392 840
61752d82
FC
841On systems other than Windows that do not have
842a C<fchdir> function, newly-created threads no
843longer inherit directory handles from their parent threads. Such programs
844would usually have crashed anyway [perl #75154].
5076a392 845
61752d82 846=head3 C<close> on shared pipes
5076a392 847
61752d82
FC
848The C<close> function no longer waits for the child process to exit if the
849underlying file descriptor is still in use by another thread, to avoid
850deadlocks. It returns true in such cases.
5076a392 851
61752d82 852=head2 Configuration
5076a392 853
61752d82 854=head3 Naming fixes in Policy_sh.SH may invalidate Policy.sh
5076a392 855
61752d82
FC
856Several long-standing typos and naming confusions in Policy_sh.SH have
857been fixed, standardizing on the variable names used in config.sh.
5076a392 858
61752d82
FC
859This will change the behavior of Policy.sh if you happen to have been
860accidentally relying on the Policy.sh incorrect behavior.
f318e2e6 861
61752d82 862=head2 C API changes
5076a392 863
61752d82 864=head3 Check API compatibility when loading XS modules
5076a392 865
61752d82
FC
866When perl's API changes in incompatible ways (which usually happens between
867major releases), XS modules compiled for previous versions of perl will not
868work anymore. They will need to be recompiled against the new perl.
869
870In order to ensure that modules are recompiled, and to prevent users from
871accidentally loading modules compiled for old perls into newer ones, the
872C<XS_APIVERSION_BOOTCHECK> macro has been added. That macro, which is called
873when loading every newly compiled extension, compares the API version of the
874running perl with the version a module has been compiled for and raises an
875exception if they don't match.
5076a392 876
61752d82
FC
877=head3 Perl_fetch_cop_label
878
879The first argument of the C API function C<Perl_fetch_cop_label> has changed
880from C<struct refcounted he *> to C<COP *>, to better insulate the user from
881implementation details.
882
883This API function was marked as "may change", and likely isn't in use outside
884the core. (Neither an unpacked CPAN, nor Google's codesearch, finds any other
885references to it.)
886
887=head3 GvCV() and GvGP() are no longer lvalues
f318e2e6
FC
888
889The new GvCV_set() and GvGP_set() macros are now provided to replace
890assignment to those two macros.
5076a392
FC
891
892This allows a future commit to eliminate some backref magic between GV
893and CVs, which will require complete control over assignment to the
894gp_cv slot.
895
5076a392
FC
896=head1 Deprecations
897
5076a392
FC
898=head2 Omitting a space between a regular expression and subsequent word
899
18139a1b
FC
900Omitting a space between a regular expression operator or
901its modifiers and the following word is deprecated. For
902example, C<< m/foo/sand $bar >> will still be parsed
903as C<< m/foo/s and $bar >> but will issue a warning.
5076a392
FC
904
905=head2 Deprecation warning added for deprecated-in-core .pl libs
906
907This is a mandatory warning, not obeying -X or lexical warning bits.
908The warning is modelled on that supplied by deprecate.pm for
909deprecated-in-core .pm libraries. It points to the specific CPAN
823d0e46
FC
910distribution that contains the .pl libraries. The CPAN version, of
911course, does not generate the warning.
5076a392
FC
912
913=head2 List assignment to C<$[>
914
823d0e46
FC
915Assignment to C<$[> was deprecated and started to give warnings in
916Perl version 5.12.0. This version of perl also starts to emit a warning when
917assigning to C<$[> in list context. This fixes an oversight in 5.12.0.
5076a392
FC
918
919=head2 Use of qw(...) as parentheses
920
921Historically the parser fooled itself into thinking that C<qw(...)> literals
922were always enclosed in parentheses, and as a result you could sometimes omit
923parentheses around them:
924
925 for $x qw(a b c) { ... }
926
927The parser no longer lies to itself in this way. Wrap the list literal in
823d0e46 928parentheses, like this:
5076a392
FC
929
930 for $x (qw(a b c)) { ... }
931
932=head2 C<\N{BELL}> is deprecated
933
934This is because Unicode is using that name for a different character.
935See L</Unicode Version 6.0 is now supported (mostly)> for more
936explanation.
937
938=head2 C<?PATTERN?> is deprecated
939
940C<?PATTERN?> (without the initial m) has been deprecated and now produces
941a warning. This is to allow future use of C<?> in new operators.
942The match-once functionality is still available in the form of C<m?PATTERN?>.
943
5076a392
FC
944=head2 Tie functions on scalars holding typeglobs
945
946Calling a tie function (C<tie>, C<tied>, C<untie>) with a scalar argument
947acts on a file handle if the scalar happens to hold a typeglob.
948
949This is a long-standing bug that will be removed in Perl 5.16, as
950there is currently no way to tie the scalar itself when it holds
951a typeglob, and no way to untie a scalar that has had a typeglob
952assigned to it.
953
823d0e46 954Now there is a deprecation warning whenever a tie
5076a392
FC
955function is used on a handle without an explicit C<*>.
956
18139a1b 957=head2 User-defined case-mapping
5076a392 958
18139a1b
FC
959This feature is being deprecated due to its many issues, as documented in
960L<perlunicode/User-Defined Case Mappings (for serious hackers only)>.
961It is planned to remove this feature in Perl 5.16. A CPAN module
962providing improved functionality is being prepared for release by the
963time 5.14 is.
964
823d0e46
FC
965XXX What module is that?
966
18139a1b 967=head2 Deprecated modules
5076a392
FC
968
969The following modules will be removed from the core distribution in a
970future release, and should be installed from CPAN instead. Distributions
971on CPAN which require these should add them to their prerequisites. The
823d0e46 972core versions of these modules will issue a deprecation warning.
5076a392
FC
973
974If you ship a packaged version of Perl, either alone or as part of a
975larger system, then you should carefully consider the repercussions of
823d0e46 976core module deprecations. You may want to consider shipping your default
5076a392 977build of Perl with packages for some or all deprecated modules which
823d0e46 978install into C<vendor> or C<site> perl library directories. This will
5076a392
FC
979inhibit the deprecation warnings.
980
981Alternatively, you may want to consider patching F<lib/deprecate.pm>
982to provide deprecation warnings specific to your packaging system
983or distribution of Perl, consistent with how your packaging system
984or distribution manages a staged transition from a release where the
985installation of a single package provides the given functionality, to
986a later release where the system administrator needs to know to install
987multiple packages to get that same functionality.
988
989You can silence these deprecation warnings by installing the modules
990in question from CPAN. To install the latest version of all of them,
991just install C<Task::Deprecations::5_14>.
992
993=over
994
995=item L<Devel::DProf>
996
997We strongly recommend that you install and used L<Devel::NYTProf> in
998preference, as it offers significantly improved profiling and reporting.
999
1000=back
1001
18139a1b 1002=head2 Deprecated C APIs
5076a392 1003
18139a1b 1004=over
5076a392 1005
18139a1b
FC
1006=item C<Perl_ptr_table_clear>
1007
1008C<Perl_ptr_table_clear> is no longer part of Perl's public API. Calling it now
1009generates a deprecation warning, and it will be removed in a future
1010release.
1011
1012=item C<sv_compile_2op>
1013
1014The C<sv_compile_2op()> API function is now deprecated. Searches suggest
1015that nothing on CPAN is using it, so this should have zero impact.
1016
1017It attempted to provide an API to compile code down to an optree, but failed
1018to bind correctly to lexicals in the enclosing scope. It's not possible to
1019fix this problem within the constraints of its parameters and return value.
1020
1021=back
5076a392
FC
1022
1023=head1 Performance Enhancements
1024
54c7bb16 1025=head2 "Safe signals" optimisation
df91d470
FC
1026
1027Signal dispatch has been moved from the runloop into control ops. This
1028should give a few percent speed increase, and eliminates almost all of
1029the speed penalty caused by the introduction of "safe signals" in
10305.8.0. Signals should still be dispatched within the same statement as
1031they were previously - if this is not the case, or it is possible to
1032create uninterruptible loops, this is a bug, and reports are encouraged
1033of how to recreate such issues.
1034
54c7bb16 1035=head2 Optimisation of shift; and pop; calls without arguments
df91d470 1036
111b6aa7
FC
1037Two fewer OPs are used for shift and pop calls with no argument (with
1038implicit C<@_>). This change makes C<shift;> 5% faster than C<shift @_;>
1039on non-threaded perls and 25% faster on threaded.
df91d470 1040
fa232254 1041=head2 Optimisation of regexp engine string comparison work
df91d470 1042
fa232254
FC
1043The foldEQ_utf8 API function for case-insensitive comparison of strings (which
1044is used heavily by the regexp engine) was substantially refactored and
1045optimised - and its documentation much improved as a free bonus gift.
df91d470 1046
fa232254 1047=head2 Regular expression compilation speed-up
df91d470 1048
fa232254
FC
1049Compiling regular expressions has been made faster for the case where upgrading
1050the regex to utf8 is necessary but that isn't known when the compilation begins.
df91d470 1051
fa232254 1052=head2 String appending is 100 times faster
df91d470 1053
fa232254
FC
1054When doing a lot of string appending, perl could end up allocating a lot more
1055memory than needed in a very inefficient way, if perl was configured to use the
1056system's C<malloc> implementation instead of its own.
1057
1058C<sv_grow>, which is what's being used to allocate more memory if necessary
1059when appending to a string, has now been taught how to round up the memory
1060it requests to a certain geometric progression, making it much faster on
1061certain platforms and configurations. On Win32, it's now about 100 times
1062faster.
1063
1064=head2 Eliminate C<PL_*> accessor functions under ithreads
1065
1066When C<MULTIPLICITY> was first developed, and interpreter state moved into
1067an interpreter struct, thread and interpreter local C<PL_*> variables were
1068defined as macros that called accessor functions, returning the address of
1069the value, outside of the perl core. The intent was to allow members
1070within the interpreter struct to change size without breaking binary
1071compatibility, so that bug fixes could be merged to a maintenance branch
1072that necessitated such a size change.
1073
1074However, some non-core code defines C<PERL_CORE>, sometimes intentionally
1075to bypass this mechanism for speed reasons, sometimes for other reasons but
1076with the inadvertent side effect of bypassing this mechanism. As some of
1077this code is widespread in production use, the result is that the core
1078I<can't> change the size of members of the interpreter struct, as it will
1079break such modules compiled against a previous release on that maintenance
1080branch. The upshot is that this mechanism is redundant, and well-behaved
1081code is penalised by it. Hence it can and should be removed (and has
1082been).
1083
1084=head2 Freeing weak references
1085
1086When an object has many weak references to it, freeing that object
1087can under some some circumstances take O(N^2) time to free (where N is the
1088number of references). The number of circumstances has been reduced
1089[perl #75254]
1090
1091=head2 Lexical array and hash assignments
1092
1093An earlier optimisation to speed up C<my @array = ...> and
1094C<my %hash = ...> assignments caused a bug and was disabled in Perl 5.12.0.
1095
1096Now we have found another way to speed up these assignments [perl #82110].
df91d470 1097
111b6aa7 1098=head2 C<@_> uses less memory
df91d470 1099
111b6aa7
FC
1100Previously, C<@_> was allocated for every subroutine at compile time with
1101enough space for four entries. Now this allocation is done on demand when
1102the subroutine is called [perl #72416].
5076a392 1103
5076a392
FC
1104=head2 Size optimisations to SV and HV structures
1105
1106xhv_fill has been eliminated from struct xpvhv, saving 1 IV per hash and
111b6aa7 1107on some systems will cause struct xpvhv to become cache-aligned. To avoid
5076a392
FC
1108this memory saving causing a slowdown elsewhere, boolean use of HvFILL
1109now calls HvTOTALKEYS instead (which is equivalent) - so while the fill
111b6aa7
FC
1110data when actually required are now calculated on demand, the cases when
1111this needs to be done should be few and far between.
5076a392 1112
111b6aa7
FC
1113The order of structure elements in SV bodies has changed. Effectively,
1114the NV slot has swapped location with STASH and MAGIC. As all access to
1115SV members is via macros, this should be completely transparent. This
5076a392
FC
1116change allows the space saving for PVHVs documented above, and may reduce
1117the memory allocation needed for PVIVs on some architectures.
1118
fa232254
FC
1119C<XPV>, C<XPVIV>, and C<XPVNV> now only allocate the parts of the C<SV> body
1120they actually use, saving some space.
5076a392 1121
fa232254
FC
1122Scalars containing regular expressions now only allocate the part of the C<SV>
1123body they actually use, saving some space.
5076a392
FC
1124
1125=head2 Memory consumption improvements to Exporter
1126
1127The @EXPORT_FAIL AV is no longer created unless required, hence neither is
111b6aa7
FC
1128the typeglob backing it. This saves about 200 bytes for every package that
1129uses Exporter but doesn't use this functionality.
5076a392 1130
111b6aa7 1131=head2 Memory savings for weak references
5076a392
FC
1132
1133For weak references, the common case of just a single weak reference per
1134referent has been optimised to reduce the storage required. In this case it
111b6aa7 1135saves the equivalent of one small Perl array per referent.
5076a392 1136
111b6aa7 1137=head2 C<%+> and C<%-> use less memory
5076a392
FC
1138
1139The bulk of the C<Tie::Hash::NamedCapture> module used to be in the perl
111b6aa7 1140core. It has now been moved to an XS module, to reduce the overhead for
5076a392
FC
1141programs that do not use C<%+> or C<%->.
1142
fa232254 1143=head2 Multiple small improvements to threads
5076a392 1144
fa232254
FC
1145The internal structures of threading now make fewer API calls and fewer
1146allocations, resulting in noticeably smaller object code. Additionally,
1147many thread context checks have been deferred so that they're only done
1148when required (although this is only possible for non-debugging builds).
5076a392 1149
fa232254 1150=head2 Adjacent pairs of nextstate opcodes are now optimized away
5076a392 1151
fa232254 1152Previously, in code such as
5076a392 1153
fa232254 1154 use constant DEBUG => 0;
5076a392 1155
fa232254
FC
1156 sub GAK {
1157 warn if DEBUG;
1158 print "stuff\n";
1159 }
5076a392 1160
fa232254
FC
1161the ops for C<warn if DEBUG;> would be folded to a C<null> op (C<ex-const>), but
1162the C<nextstate> op would remain, resulting in a runtime op dispatch of
1163C<nextstate>, C<nextstate>, ....
5076a392 1164
fa232254
FC
1165The execution of a sequence of C<nextstate> ops is indistinguishable from just
1166the last C<nextstate> op so the peephole optimizer now eliminates the first of
1167a pair of C<nextstate> ops, except where the first carries a label, since labels
1168must not be eliminated by the optimizer and label usage isn't conclusively known
1169at compile time.
5076a392
FC
1170
1171=head1 Modules and Pragmata
1172
1173=head2 New Modules and Pragmata
1174
1175=over 4
1176
1177=item *
1178
1179C<CPAN::Meta::YAML> 0.003 has been added as a dual-life module. It supports a
1180subset of YAML sufficient for reading and writing META.yml and MYMETA.yml files
1181included with CPAN distributions or generated by the module installation
1182toolchain. It should not be used for any other general YAML parsing or
1183generation task.
1184
1185=item *
1186
1187C<CPAN::Meta> version 2.110440 has been added as a dual-life module. It
1188provides a standard library to read, interpret and write CPAN distribution
1189metadata files (e.g. META.json and META.yml) which describes a
1190distribution, its contents, and the requirements for building it and
1191installing it. The latest CPAN distribution metadata specification is
1192included as C<CPAN::Meta::Spec> and notes on changes in the specification
1193over time are given in C<CPAN::Meta::History>.
1194
1195=item *
1196
1197C<HTTP::Tiny> 0.010 has been added as a dual-life module. It is a very
1198small, simple HTTP/1.1 client designed for simple GET requests and file
1199mirroring. It has has been added to enable CPAN.pm and CPANPLUS to
1200"bootstrap" HTTP access to CPAN using pure Perl without relying on external
1201binaries like F<curl> or F<wget>.
1202
1203=item *
1204
1205C<JSON::PP> 2.27105 has been added as a dual-life module, for the sake of
1206reading F<META.json> files in CPAN distributions.
1207
1208=item *
1209
1210C<Module::Metadata> 1.000003 has been added as a dual-life module. It gathers
1211package and POD information from Perl module files. It is a standalone module
1212based on Module::Build::ModuleInfo for use by other module installation
1213toolchain components. Module::Build::ModuleInfo has been deprecated in
1214favor of this module instead.
1215
1216=item *
1217
1218C<Perl::OSType> 1.002 has been added as a dual-life module. It maps Perl
1219operating system names (e.g. 'dragonfly' or 'MSWin32') to more generic types
1220with standardized names (e.g. "Unix" or "Windows"). It has been refactored
1221out of Module::Build and ExtUtils::CBuilder and consolidates such mappings into
1222a single location for easier maintenance.
1223
1224=item *
1225
1226The following modules were added by the C<Unicode::Collate>
1227upgrade. See below for details.
1228
1229C<Unicode::Collate::CJK::Big5>
1230
1231C<Unicode::Collate::CJK::GB2312>
1232
1233C<Unicode::Collate::CJK::JISX0208>
1234
1235C<Unicode::Collate::CJK::Korean>
1236
1237C<Unicode::Collate::CJK::Pinyin>
1238
1239C<Unicode::Collate::CJK::Stroke>
1240
1241=item *
1242
1243C<Version::Requirements> version 0.101020 has been added as a dual-life
1244module. It provides a standard library to model and manipulates module
1245prerequisites and version constraints as defined in the L<CPAN::Meta::Spec>.
1246
1247=back
1248
1249=head2 Updated Modules and Pragmata
1250
1251=over 4
1252
1253=item *
1254
5076a392
FC
1255C<Archive::Extract> has been upgraded from version 0.38 to 0.48.
1256
1257Updates since 0.38 include: a safe print method that guards
1258Archive::Extract from changes to $\; a fix to the tests when run in core
1984204c
FC
1259perl; support for TZ files; a modification for the lzma
1260logic to favour IO::Uncompress::Unlzma; and a fix
1261for an issue with NetBSD-current and its new unzip
5076a392
FC
1262executable.
1263
1264=item *
1265
1266C<Archive::Tar> has been upgraded from version 1.54 to 1.76.
1267
1984204c
FC
1268Important changes since 1.54 include the following:
1269
1270=over
1271
1272=item *
1273
1274Compatibility with busybox implementations of tar
1275
1276=item *
1277
1278A fix so that C<write()> and C<create_archive()>
1279close only handles they opened
1280
1281=item *
1282
1283A bug was fixed regarding the exit code of extract_archive.
5076a392 1284
1984204c
FC
1285=item *
1286
1287C<ptar> has a new option to allow safe
5076a392
FC
1288creation of tarballs without world-writable files on Windows, allowing those
1289archives to be uploaded to CPAN.
1290
1984204c
FC
1291=item *
1292
1293A new ptargrep utility for using regular expressions against
5076a392
FC
1294the contents of files in a tar archive.
1295
1984204c
FC
1296=item *
1297
1298Pax extended headers are now skipped.
1299
1300=back
5076a392
FC
1301
1302=item *
1303
5076a392
FC
1304C<B> has been upgraded from version 1.23 to 1.27.
1305
1306It no longer crashes when taking apart a C<y///> containing characters
1307outside the octet range or compiled in a C<use utf8> scope.
1308
1309The size of the shared object has been reduced by about 40%, with no
1310reduction in functionality.
1311
1312=item *
1313
1314C<B::Concise> has been upgraded from version 0.78 to 0.82.
1315
1316B::Concise marks rv2sv, rv2av and rv2hv ops with the new OPpDEREF flag
1317as "DREFed".
1318
1319It no longer produces mangled output with the C<-tree> option
1320[perl #80632].
1321
1322=item *
1323
5076a392
FC
1324C<B::Deparse> has been upgraded from version 0.96 to 1.02.
1325
1984204c 1326The deparsing of a nextstate op has changed when it has both a
5076a392
FC
1327change of package (relative to the previous nextstate), or a change of
1328C<%^H> or other state, and a label. Previously the label was emitted
1984204c 1329first, but now the label is emitted last.
5076a392 1330
1984204c 1331The C<no 5.13.2> or similar form is now correctly handled by B::Deparse.
5076a392
FC
1332
1333B::Deparse now properly handles the code that applies a conditional
1334pattern match against implicit C<$_> as it was fixed in [perl #20444].
1335
1984204c
FC
1336Deparsing of C<our> followed by a variable with funny characters
1337(as permitted under the C<utf8> pragma) has also been fixed [perl #33752].
5076a392
FC
1338
1339=item *
1340
5076a392
FC
1341C<Carp> has been upgraded from version 1.18 to 1.19.
1342
1343L<Carp> now detects incomplete L<caller()|perlfunc/"caller EXPR"> overrides and
1344avoids using bogus C<@DB::args>. To provide backtraces, Carp relies on
1345particular behaviour of the caller built-in. Carp now detects if other code has
1346overridden this with an incomplete implementation, and modifies its backtrace
1347accordingly. Previously incomplete overrides would cause incorrect values in
1348backtraces (best case), or obscure fatal errors (worst case)
1349
1350This fixes certain cases of C<Bizarre copy of ARRAY> caused by modules
1351overriding C<caller()> incorrectly.
1352
1984204c 1353It now also avoids using regular expressions that cause perl to
5076a392
FC
1354load its Unicode tables, in order to avoid the 'BEGIN not safe after
1355errors' error that will ensue if there has been a syntax error
1356[perl #82854].
1357
1358=item *
1359
1360C<CGI> has been upgraded from version 3.48 to 3.51.
1361
1362This provides the following security fixes: the MIME boundary in
1984204c
FC
1363multipart_init is now random and the handling of
1364newlines embedded in header values has been improved.
5076a392
FC
1365
1366=item *
1367
5076a392
FC
1368C<Compress::Raw::Bzip2> has been upgraded from version 2.024 to 2.033.
1369
1984204c 1370It has been updated to use bzip2 1.0.6.
5076a392
FC
1371
1372=item *
1373
1984204c
FC
1374C<CPAN> has been upgraded from version 1.94_56 to 1.9600.-
1375
1376Major highlights:
5076a392
FC
1377
1378=over 4
1379
1984204c 1380=item * much less configuration dialog hassle
5076a392 1381
1984204c 1382=item * support for META/MYMETA.json
5076a392 1383
1984204c 1384=item * support for local::lib
5076a392 1385
1984204c 1386=item * support for HTTP::Tiny to reduce the dependency on ftp sites
5076a392 1387
1984204c 1388=item * automatic mirror selection
5076a392 1389
1984204c 1390=item * iron out all known bugs in configure_requires
5076a392 1391
1984204c
FC
1392=item * support for distributions compressed with bzip2
1393
1394=item * allow Foo/Bar.pm on the commandline to mean Foo::Bar
1395
1396=back
5076a392
FC
1397
1398=item *
1399
1400C<CPANPLUS> has been upgraded from version 0.90 to 0.9102.
1401
1984204c
FC
1402A dependency on Config was not recognised as a
1403core module dependency. This has been fixed.
5076a392 1404
1984204c 1405CPANPLUS now includes support for META.json and MYMETA.json.
5076a392
FC
1406
1407=item *
1408
5076a392
FC
1409C<Data::Dumper> has been upgraded from version 2.125 to 2.130_02.
1410
4ed2cea4
FC
1411The indentation used to be off when C<$Data::Dumper::Terse> was set. This
1412has been fixed [perl #73604].
1413
1984204c
FC
1414This upgrade also fixes a crash when using custom sort functions that might
1415cause the stack to change [perl #74170].
5076a392
FC
1416
1417C<Dumpxs> no longer crashes with globs returned by C<*$io_ref>
1418[perl #72332].
1419
1420=item *
1421
5076a392
FC
1422C<Devel::DProf> has been upgraded from version 20080331.00 to 20110228.00.
1423
1424Merely loading C<Devel::DProf> now no longer triggers profiling to start.
1425C<use Devel::DProf> and C<perl -d:DProf ...> still behave as before and start
1426the profiler.
1427
1428NOTE: C<Devel::DProf> is deprecated and will be removed from a future
1984204c 1429version of Perl. We strongly recommend that you install and use
5076a392
FC
1430L<Devel::NYTProf> instead, as it offers significantly improved
1431profiling and reporting.
1432
1433=item *
1434
5076a392
FC
1435C<diagnostics> has been upgraded from version 1.19 to 1.22.
1436
1437It now renders pod links slightly better, and has been taught to find
1438descriptions for messages that share their descriptions with other
1439messages.
1440
1441=item *
1442
1443C<Digest::MD5> has been upgraded from version 2.39 to 2.51.
1444
1445It is now safe to use this module in combination with threads.
1446
1447=item *
1448
1449C<Digest::SHA> has been upgraded from version 5.47 to 5.61.
1450
1451C<shasum> now more closely mimics C<sha1sum>/C<md5sum>.
1452
1453C<Addfile> accepts all POSIX filenames.
1454
1984204c
FC
1455New SHA-512/224 and SHA-512/256 transforms (ref. NIST Draft FIPS 180-4
1456[February 2011])
5076a392
FC
1457
1458=item *
1459
5076a392
FC
1460C<DynaLoader> has been upgraded from version 1.10 to 1.12.
1461
1462It fixes a buffer overflow when passed a very long file name.
1463
1464It no longer inherits from AutoLoader; hence it no longer
1465produces weird error messages for unsuccessful method calls on classes that
1466inherit from DynaLoader [perl #84358].
1467
1468=item *
1469
1470C<Encode> has been upgraded from version 2.39 to 2.42.
1471
1472Now, all 66 Unicode non-characters are treated the same way U+FFFF has
1984204c
FC
1473always been treated; in cases when it was disallowed, all 66 are
1474disallowed; in those cases where it warned, all 66 warn.
5076a392
FC
1475
1476=item *
1477
5076a392
FC
1478C<Errno> has been upgraded from version 1.11 to 1.13.
1479
1480The implementation of C<Errno> has been refactored to use about 55% less memory.
5076a392
FC
1481
1482On some platforms with unusual header files, like Win32/gcc using mingw64
1483headers, some constants which weren't actually error numbers have been exposed
1484by C<Errno>. This has been fixed [perl #77416].
1485
1486=item *
1487
1488C<Exporter> has been upgraded from version 5.64_01 to 5.64_03.
1489
1490Exporter no longer overrides C<$SIG{__WARN__}> [perl #74472]
1491
1492=item *
1493
5076a392
FC
1494C<ExtUtils::Constant> has been upgraded from 0.22 to 0.23.
1495
1496The C<AUTOLOAD> helper code generated by C<ExtUtils::Constant::ProxySubs>
1497can now C<croak> for missing constants, or generate a complete C<AUTOLOAD>
1984204c
FC
1498subroutine in XS, allowing simplification of many modules that use it
1499(C<Fcntl>, C<File::Glob>, C<GDBM_File>, C<I18N::Langinfo>, C<POSIX>,
1500C<Socket>).
5076a392
FC
1501
1502C<ExtUtils::Constant::ProxySubs> can now optionally push the names of all
1984204c 1503constants onto the package's C<@EXPORT_OK>.
5076a392
FC
1504
1505=item *
1506
5076a392
FC
1507C<File::DosGlob> has been upgraded from version 1.01 to 1.03.
1508
1509It allows patterns containing literal parentheses (they no longer need to
1984204c
FC
1510be escaped). On Windows, it no longer
1511adds an extra F<./> to the file names
5076a392
FC
1512returned when the pattern is a relative glob with a drive specification,
1513like F<c:*.pl> [perl #71712].
1514
1515=item *
1516
1517C<File::Fetch> has been upgraded from version 0.24 to 0.32.
1518
1519C<HTTP::Lite> is now supported for 'http' scheme.
1520
1521The C<fetch> utility is supported on FreeBSD, NetBSD and
1522Dragonfly BSD for the C<http> and C<ftp> schemes.
1523
1524=item *
1525
1526C<File::Find> has been upgraded from version 1.15 to 1.18.
1527
1984204c 1528It improves handling of backslashes on Windows, so that paths like
5076a392
FC
1529F<c:\dir\/file> are no longer generated [perl #71710].
1530
1531=item *
1532
5076a392
FC
1533C<File::stat> has been upgraded from 1.02 to 1.04.
1534
1535The C<-x> and C<-X> file test operators now work correctly under the root
1536user.
1537
1538=item *
1539
5076a392
FC
1540C<GDBM_File> has been upgraded from 1.10 to 1.13.
1541
1542This fixes a memory leak when DBM filters are used.
1543
1544=item *
1545
1546C<Hash::Util> has been upgraded from 0.07 to 0.10.
1547
1984204c
FC
1548Hash::Util no longer emits spurious "uninitialized" warnings when
1549recursively locking hashes that have undefined values [perl #74280].
5076a392
FC
1550
1551=item *
1552
1553C<I18N::Langinfo> has been upgraded from version 0.03 to 0.07.
1554
1555C<langinfo()> now defaults to using C<$_> if there is no argument given, just
5334145a 1556as the documentation has always claimed.
5076a392
FC
1557
1558=item *
1559
1560C<IO::Select> has been upgraded from version 1.17 to 1.18.
1561
1562It now allows IO::Handle objects (and objects in derived classes) to be
1563removed from an IO::Select set even if the underlying file descriptor is
1564closed or invalid.
1565
1566=item *
1567
5076a392
FC
1568C<IPC::Cmd> has been upgraded from version 0.54 to 0.68.
1569
1984204c
FC
1570Resolves an issue with splitting Win32 command lines. An argument
1571consisting of the single character "0" used to be omitted (CPAN RT #62961).
5076a392
FC
1572
1573=item *
1574
1575C<IPC::Open3> has been upgraded from 1.05 to 1.08.
1576
4ed2cea4
FC
1577C<open3> now produces an error if the C<exec> call fails, allowing this
1578condition to be distinguished from a child process that exited with a
1579non-zero status [perl #72016].
1580
5076a392
FC
1581The internal C<xclose> routine now knows how to handle file descriptors, as
1582documented, so duplicating STDIN in a child process using its file
1583descriptor now works [perl #76474].
1584
1585=item *
1586
5076a392
FC
1587C<Locale::Maketext> has been upgraded from version 1.14 to 1.17.
1588
1984204c 1589Locale::Maketext now supports external caches.
5076a392 1590
1984204c
FC
1591This upgrade also fixes an infinite loop in
1592C<Locale::Maketext::Guts::_compile()> when
5076a392
FC
1593working with tainted values (CPAN RT #40727).
1594
1984204c 1595C<< ->maketext >> calls will now back up and restore C<$@> so that error
5076a392
FC
1596messages are not suppressed (CPAN RT #34182).
1597
1598=item *
1599
5076a392
FC
1600C<Math::BigInt> has been upgraded from version 1.89_01 to 1.994.
1601
1602This fixes, among other things, incorrect results when computing binomial
1603coefficients [perl #77640].
1604
1984204c 1605It also prevents C<sqrt($int)> from crashing under C<use bigrat;>
5076a392
FC
1606[perl #73534].
1607
1608=item *
1609
5076a392
FC
1610C<MIME::Base64> has been upgraded from 3.08 to 3.13.
1611
1612Includes new functions to calculate the length of encoded and decoded
1613base64 strings.
1614
1615Now provides C<encode_base64url> and C<decode_base64url> functions to process
1616the base64 scheme for "URL applications".
1617
1618=item *
1619
1620C<Module::Build> has been upgraded from version 0.3603 to 0.3800.
1621
1622A notable change is the deprecation of several modules.
1623Module::Build::Version has been deprecated and Module::Build now relies
1624directly upon L<version>. Module::Build::ModuleInfo has been deprecated in
1625favor of a standalone copy of it called L<Module::Metadata>.
1626Module::Build::YAML has been deprecated in favor of L<CPAN::Meta::YAML>.
1627
1628Module::Build now also generates META.json and MYMETA.json files
1629in accordance with version 2 of the CPAN distribution metadata specification,
1630L<CPAN::Meta::Spec>. The older format META.yml and MYMETA.yml files are
1631still generated, as well.
1632
1633=item *
1634
1635C<Module::CoreList> has been upgraded from version 2.29 to XXX.
1636
1637Besides listing the updated core modules of this release, it also stops listing
1984204c 1638the C<Filespec> module. That module never existed in core. The scripts
5076a392 1639generating C<Module::CoreList> confused it with C<VMS::Filespec>, which actually
1984204c 1640is a core module as of perl 5.8.7.
5076a392
FC
1641
1642=item *
1643
1984204c
FC
1644C<NDBM_File> and C<ODBM_File> have been upgraded from 1.08 to 1.11, and
1645from 1.08 to 1.09, respectively.
5076a392
FC
1646
1647This fixes a memory leak when DBM filters are used.
1648
1649=item *
1650
5076a392
FC
1651C<overload> has been upgraded from 1.11 to 1.12.
1652
1653C<overload::Method> can now handle subroutines that are themselves blessed
1654into overloaded classes [perl #71998].
1655
5076a392
FC
1656The documentation has greatly improved. See L</Documentation> below.
1657
1658=item *
1659
5076a392
FC
1660C<Parse::CPAN::Meta> has been upgraded from version 1.40 to 1.4401.
1661
1984204c 1662The latest Parse::CPAN::Meta can now read YAML and JSON files using
5076a392
FC
1663L<CPAN::Meta::YAML> and L<JSON::PP>, which are now part of the Perl core.
1664
1665=item *
1666
5076a392
FC
1667C<PerlIO::scalar> has been upgraded from 0.07 to 0.11.
1668
1669A C<read> after a C<seek> beyond the end of the string no longer thinks it
1670has data to read [perl #78716].
1671
1672=item *
1673
5076a392
FC
1674C<POSIX> has been upgraded from 1.19 to 1.23.
1675
1676It now includes constants for POSIX signal constants.
1677
1678=item *
1679
1984204c 1680C<re> has been upgraded from version 0.11 to 0.17.
5076a392
FC
1681
1682New C<use re "/flags"> pragma
1683
5076a392 1684The C<regmust> function used to crash when called on a regular expression
1984204c 1685belonging to a pluggable engine. Now it croaks instead.
5076a392
FC
1686
1687C<regmust> no longer leaks memory.
1688
1689=item *
1690
1691C<Safe> has been upgraded from version 2.25 to 2.29.
1692
1693This fixes a possible infinite loop when looking for coderefs.
1694
1695It adds C<&version::vxs::VCMP> to the default share.
1696
1697=item *
1698
5076a392
FC
1699C<SelfLoader> has been upgraded from 1.17 to 1.18.
1700
1701It now works in taint mode [perl #72062].
1702
1703=item *
1704
1705C<sigtrap> has been upgraded from version 1.04 to 1.05.
1706
1707It no longer tries to modify read-only arguments when generating a
1708backtrace [perl #72340].
1709
1710=item *
1711
1984204c 1712C<Socket> has been upgraded from version 1.87 to 1.94.
5076a392 1713
1984204c 1714See L</IPv6 support>, above.
5076a392
FC
1715
1716=item *
1717
1718C<Storable> has been upgraded from version 2.22 to 2.27.
1719
1720Includes performance improvement for overloaded classes.
1721
5076a392 1722This adds support for serialising code references that contain UTF-8 strings
1984204c
FC
1723correctly. The Storable minor version
1724number changed as a result, meaning that
5076a392
FC
1725Storable users who set C<$Storable::accept_future_minor> to a C<FALSE> value
1726will see errors (see L<Storable/FORWARD COMPATIBILITY> for more details).
1727
1728Freezing no longer gets confused if the Perl stack gets reallocated
1729during freezing [perl #80074].
1730
1731=item *
1732
5076a392
FC
1733C<Test::Simple> has been upgraded from version 0.94 to 0.98.
1734
1735Among many other things, subtests without a C<plan> or C<no_plan> now have an
1736implicit C<done_testing()> added to them.
1737
1738=item *
1739
5076a392
FC
1740C<Thread::Semaphore> has been upgraded from version 2.09 to 2.12.
1741
1984204c
FC
1742It provides two new methods that give more control over the decrementing of
1743semaphores: C<down_nb> and C<down_force>.
5076a392
FC
1744
1745=item *
1746
5076a392
FC
1747C<Tie::Hash> has been upgraded from version 1.03 to 1.04.
1748
1749Calling C<< Tie::Hash-E<gt>TIEHASH() >> used to loop forever. Now it C<croak>s.
1750
1751=item *
1752
5076a392
FC
1753C<Unicode::Collate> has been upgraded from version 0.52_01 to 0.73.
1754
1984204c 1755Unicode::Collate has been updated to use Unicode 6.0.0.
5076a392 1756
1984204c
FC
1757Unicode::Collate::Locale now supports a plethora of new locales: ar, be,
1758bg, de__phonebook, hu, hy, kk, mk, nso, om, tn, vi, hr, ig, ja, ko, ru, sq,
1759se, sr, to, uk, zh, zh__big5han, zh__gb2312han, zh__pinyin and zh__stroke.
5076a392
FC
1760
1761The following modules have been added:
1762
1763C<Unicode::Collate::CJK::Big5> for C<zh__big5han> which makes
1764tailoring of CJK Unified Ideographs in the order of CLDR's big5han ordering.
1765
1766C<Unicode::Collate::CJK::GB2312> for C<zh__gb2312han> which makes
1767tailoring of CJK Unified Ideographs in the order of CLDR's gb2312han ordering.
1768
1769C<Unicode::Collate::CJK::JISX0208> which makes tailoring of 6355 kanji
1770(CJK Unified Ideographs) in the JIS X 0208 order.
1771
1772C<Unicode::Collate::CJK::Korean> which makes tailoring of CJK Unified Ideographs
1773in the order of CLDR's Korean ordering.
1774
1775C<Unicode::Collate::CJK::Pinyin> for C<zh__pinyin> which makes
1776tailoring of CJK Unified Ideographs in the order of CLDR's pinyin ordering.
1777
1778C<Unicode::Collate::CJK::Stroke> for C<zh__stroke> which makes
1779tailoring of CJK Unified Ideographs in the order of CLDR's stroke ordering.
1780
5076a392
FC
1781This also sees the switch from using the pure-perl version of this
1782module to the XS version.
1783
1784=item *
1785
5076a392
FC
1786C<Unicode::UCD> has been upgraded from version 0.27 to 0.32.
1787
1984204c
FC
1788A new function, C<Unicode::UCD::num()>, has been added. This function
1789returns the numeric value of the string passed it or C<undef> if the string
1790in its entirety has no "safe" numeric value. (For more detail, and for the
1791definition of "safe", see L<Unicode::UCD/num>.)
5076a392 1792
1984204c 1793This upgrade also includes a number of bug fixes:
5076a392
FC
1794
1795=over 4
1796
1797=item charinfo()
1798
1799=over 4
1800
1801=item *
1802
1803It is now updated to Unicode Version 6 with Corrigendum #8, except,
1804as with Perl 5.14, the code point at U+1F514 has no name.
1805
1806=item *
1807
1808The Hangul syllable code points have the correct names, and their
1809decompositions are always output without requiring L<Lingua::KO::Hangul::Util>
1810to be installed.
1811
1812=item *
1813
54c7bb16
FC
1814The CJK (Chinese-Japanese-Korean) code points U+2A700 to U+2B734
1815and U+2B740 to U+2B81D are now properly handled.
5076a392
FC
1816
1817=item *
1818
1819The numeric values are now output for those CJK code points that have them.
1820
1821=item *
1822
1823The names that are output for code points with multiple aliases are now the
1824corrected ones.
1825
1826=back
1827
1828=item charscript()
1829
1830This now correctly returns "Unknown" instead of C<undef> for the script
1831of a code point that hasn't been assigned another one.
1832
1833=item charblock()
1834
1835This now correctly returns "No_Block" instead of C<undef> for the block
1836of a code point that hasn't been assigned to another one.
1837
1838=back
1839
5076a392
FC
1840=item *
1841
1842C<version> has been upgraded from 0.82 to 0.88.
1843
1984204c
FC
1844Due to a bug, now fixed, the C<is_strict> and C<is_lax> functions did not
1845work when exported.
5076a392
FC
1846
1847=item *
1848
1849C<warnings> and C<warnings::register> have been upgraded from version 1.09
1850to 1.11 and from version 1.01 to 1.02 respectively.
1851
1852Calling C<use warnings> without arguments is now significantly more efficient.
1853
1854It is now possible to register warning categories other than the names of
1855packages using C<warnings::register>. See L<perllexwarn> for more information.
1856
1857=item *
1858
1859C<VMS::DCLsym> has been upgraded from version 1.03 to 1.05.
1860
1861Two bugs have been fixed [perl #84086]:
1862
1863The symbol table name was lost when tying a hash, due to a thinko in
1864C<TIEHASH>. The result was that all tied hashes interacted with the
1865local symbol table.
1866
1867Unless a symbol table name had been explicitly specified in the call
1868to the constructor, querying the special key ':LOCAL' failed to
1869identify objects connected to the local symbol table.
1870
1871=item *
1872
1873C<Win32> has been upgraded from version 0.39 to 0.44.
1874
1984204c
FC
1875This release has several new functions: C<Win32::GetSystemMetrics>,
1876C<Win32::GetProductInfo>, C<Win32::GetOSDisplayName>.
5076a392 1877
1984204c
FC
1878The names returned by C<Win32::GetOSName> and C<Win32::GetOSDisplayName>
1879have been corrected.
5076a392 1880
5076a392
FC
1881=back
1882
5076a392
FC
1883=head2 Removed Modules and Pragmata
1884
1885The following modules have been removed from the core distribution, and if
1886needed should be installed from CPAN instead.
1887
1888=over
1889
1890=item C<Class::ISA>
1891
1892=item C<Pod::Plainer>
1893
1894=item C<Switch>
1895
1896=back
1897
1898The removal of C<Shell> has been deferred until after 5.14, as the
1899implementation of C<Shell> shipped with 5.12.0 did not correctly issue the
1900warning that it was to be removed from core.
1901
1902=head1 Documentation
1903
5076a392
FC
1904=head2 New Documentation
1905
41e29def 1906=head3 L<perlgpl>
5076a392
FC
1907
1908L<perlgpl> has been updated to contain GPL version 1, as is included in the
1909F<README> distributed with perl.
1910
41e29def 1911=head3 Perl 5.12.x delta files
5076a392 1912
41e29def
FC
1913The perldelta files for Perl 5.12.1 to 5.12.3 have been added from the
1914maintenance branch: L<perl5121delta>, L<perl5122delta>, L<perl5123delta>.
5076a392
FC
1915
1916=head3 L<perlpodstyle>
1917
1918New style guide for POD documentation,
1919split mostly from the NOTES section of the pod2man man page.
1920
41e29def
FC
1921=head3 L<perlsource>, L<perlinterp>, L<perlhacktut>, and L<perlhacktips>
1922
1923See L</L<perlhack> and perlrepository revamp>, below.
5076a392
FC
1924
1925=head2 Changes to Existing Documentation
1926
41e29def 1927=head3 L<perlmodlib> is now complete
4ed2cea4
FC
1928
1929The perlmodlib page that came with Perl 5.12.0 was missing a lot of
1930modules, due to a bug in the script that generates the list. This has been
1931fixed [perl #74332].
1932
41e29def 1933=head3 Replace wrong tr/// table in L<perlebcdic>
5076a392 1934
41e29def 1935L<perlebcdic> contains a helpful table to use in tr/// to convert
5076a392
FC
1936between EBCDIC and Latin1/ASCII. Unfortunately, the table was the
1937inverse of the one it describes, though the code that used the table
1938worked correctly for the specific example given.
1939
1940The table has been changed to its inverse, and the sample code changed
1941to correspond, as this is easier for the person trying to follow the
1942instructions since deriving the old table is somewhat more complicated.
1943
1944The table has also been changed to hex from octal, as that is more the norm
1945these days, and the recipes in the pod altered to print out leading
41e29def 1946zeros to make all the values the same length.
5076a392 1947
41e29def 1948=head3 Tricks for user-defined casing
5076a392 1949
41e29def
FC
1950L<perlunicode> now contains an explanation of how to override, mangle
1951and otherwise tweak the way perl handles upper-, lower- and other-case
1952conversions on Unicode data, and how to provide scoped changes to alter
1953one's own code's behaviour without stomping on anybody else.
5076a392
FC
1954
1955=head3 INSTALL explicitly states the requirement for C89
1956
41e29def 1957This was already true but it's now Officially Stated For The Record.
5076a392 1958
41e29def 1959=head3 Explanation of C<\xI<HH>> and C<\oI<OOO>> escapes
5076a392 1960
41e29def
FC
1961L<perlop> has been updated with more detailed explanation of these two
1962character escapes.
5076a392 1963
41e29def 1964=head3 C<-0I<NNN>> switch
5076a392 1965
41e29def
FC
1966In L<perlrun>, the behavior of the C<-0NNN> switch for C<-0400> or higher
1967has been clarified.
5076a392 1968
41e29def 1969=head3 Deprecation policy
5076a392 1970
41e29def
FC
1971L<perlpolicy> now contains the policy on compatibility and deprecation
1972along with definitions of terms like "deprecation"
5076a392 1973
41e29def 1974=head3 New descriptions in L<perldiag>
5076a392
FC
1975
1976The following existing diagnostics are now documented:
1977
1978=over 4
1979
1980=item *
1981
1982L<Ambiguous use of %c resolved as operator %c|perldiag/"Ambiguous use of %c resolved as operator %c">
1983
1984=item *
1985
1986L<Ambiguous use of %c{%s} resolved to %c%s|perldiag/"Ambiguous use of %c{%s} resolved to %c%s">
1987
1988=item *
1989
1990L<Ambiguous use of %c{%s%s} resolved to %c%s%s|perldiag/"Ambiguous use of %c{%s%s} resolved to %c%s%s">
1991
1992=item *
1993
1994L<Ambiguous use of -%s resolved as -&%s()|perldiag/"Ambiguous use of -%s resolved as -&%s()">
1995
1996=item *
1997
1998L<Invalid strict version format (%s)|perldiag/"Invalid strict version format (%s)">
1999
2000=item *
2001
2002L<Invalid version format (%s)|perldiag/"Invalid version format (%s)">
2003
2004=item *
2005
2006L<Invalid version object|perldiag/"Invalid version object">
2007
2008=back
2009
5076a392
FC
2010=head3 L<perlbook>
2011
41e29def 2012L<perlbook> has been expanded to cover many more popular books.
5076a392 2013
41e29def 2014=head3 C<SvTRUE> macro
5076a392 2015
41e29def
FC
2016The documentation for the C<SvTRUE> macro in
2017L<perlapi> was simply wrong in stating that
5076a392
FC
2018get-magic is not processed. It has been corrected.
2019
41e29def 2020=head3 L<perlvar> revamp
5076a392 2021
41e29def 2022L<perlvar> reorders the variables and groups them by topic. Each variable
5076a392 2023introduced after Perl 5.000 notes the first version in which it is
41e29def 2024available. L<perlvar> also has a new section for deprecated variables to
5076a392
FC
2025note when they were removed.
2026
41e29def 2027=head3 Array and hash slices in scalar context
5076a392 2028
41e29def 2029These are now documented in L<perldata>.
5076a392 2030
41e29def 2031=head3 C<use locale> and formats
5076a392
FC
2032
2033L<perlform> and L<perllocale> have been corrected to state that
2034C<use locale> affects formats.
2035
5076a392
FC
2036=head3 L<overload>
2037
5076a392
FC
2038L<overload>'s documentation has practically undergone a rewrite. It
2039is now much more straightforward and clear.
2040
41e29def 2041=head3 L<perlhack> and perlrepository revamp
5076a392
FC
2042
2043The L<perlhack> and perlrepository documents have been heavily edited and
2044split up into several new documents.
2045
2046The L<perlhack> document is now much shorter, and focuses on the Perl 5
2047development process and submitting patches to Perl. The technical content has
2048been moved to several new documents, L<perlsource>, L<perlinterp>,
2049L<perlhacktut>, and L<perlhacktips>. This technical content has only been
2050lightly edited.
2051
2052The perlrepository document has been renamed to L<perlgit>. This new document
2053is just a how-to on using git with the Perl source code. Any other content
2054that used to be in perlrepository has been moved to perlhack.
2055
41e29def 2056=head3 Time::Piece examples
5076a392
FC
2057
2058Examples in L<perlfaq4> have been updated to show the use of
41e29def 2059L<Time::Piece>.
5076a392
FC
2060
2061=head1 Diagnostics
2062
2063The following additions or changes have been made to diagnostic output,
2064including warnings and fatal error messages. For the complete list of
2065diagnostic messages, see L<perldiag>.
2066
2067=head2 New Diagnostics
2068
2069=over
2070
2071=item Parsing code internal error (%s)
2072
2073New fatal error produced when parsing code supplied by an extension violated the
2074parser's API in a detectable way.
2075
2076=item Use of qw(...) as parentheses is deprecated
2077
2078See L</"Use of qw(...) as parentheses"> for details.
2079
2080=item Using !~ with %s doesn't make sense
2081
2082This message was actually added in
20835.13.2, but was omitted from perldelta. It now applies also to the C<y///>
2084operator, and has been documented.
2085
2086=item Closure prototype called
2087
2088There is a new "Closure prototype called" error [perl #68560].
2089
2090=item Operation "%s" returns its argument for ...
2091
2092Performing an operation requiring Unicode semantics (such as case-folding)
2093on a Unicode surrogate or a non-Unicode character now triggers a warning:
2094'Operation "%s" returns its argument for ...'.
2095
2096=item "\b{" is deprecated; use "\b\{" instead
2097
2098=item "\B{" is deprecated; use "\B\{" instead
2099
2100Use of an unescaped "{" immediately following a C<\b> or C<\B> is now
2101deprecated so as to reserve its use for Perl itself in a future release.
2102
2103=item regcomp: Add warning if \p is used under locale. (fb2e24c)
2104
2105C<\p> implies Unicode matching rules, which are likely going to be
2106different than the locale's.
2107
2108=item panic: gp_free failed to free glob pointer - something is repeatedly re-creating entries
2109
2110This new error is triggered if a destructor called on an object in a
2111typeglob that is being freed creates a new typeglob entry containing an
2112object with a destructor that creates a new entry containing an object....
2113
2114=item refcnt: fd %d%s
2115
2116This new error only occurs if a internal consistency check fails when a
2117pipe is about to be closed.
2118
2119=item Regexp modifier "/%c" may not appear twice
2120
2121(F syntax) The regular expression pattern had one of the mutually exclusive
2122modifiers repeated. Remove all but one of the occurrences.
2123
2124=item Regexp modifiers "/%c" and "/%c" are mutually exclusive
2125
2126(F syntax) The regular expression pattern had more than one of the mutually
2127exclusive modifiers. Retain only the modifier that is supposed to be there.
2128
2129=item Insecure user-defined property %s
2130
2131(F) Perl detected tainted data when trying to compile a regular
2132expression that contains a call to a user-defined character property
2133function, i.e. C<\p{IsFoo}> or C<\p{InFoo}>.
2134See L<perlunicode/User-Defined Character Properties> and L<perlsec>.
2135
2136=back
2137
2138=head2 Changes to Existing Diagnostics
2139
2140=over 4
2141
2142=item *
2143
4ed2cea4
FC
2144The "Variable $foo is not imported" warning that precedes a
2145C<strict 'vars'> error has now been assigned the "misc" category, so that
2146C<no warnings> will suppress it [perl #73712].
2147
2148=item *
2149
5076a392
FC
2150C<warn> and C<die> now produce 'Wide character' warnings when fed a
2151character outside the byte range if STDERR is a byte-sized handle.
2152
2153=item *
2154
2155The 'Layer does not match this perl' error message has been replaced with
2156these more helpful messages:
2157
2158=over 4
2159
2160=item *
2161
2162PerlIO layer function table size (%d) does not match size expected by this
2163perl (%d)
2164
2165=item *
2166
2167PerlIO layer instance size (%d) does not match size expected by this perl
2168(%d)
2169
2170=back
2171
2172[perl #73754]
2173
2174=item *
2175
2176The "Found = in conditional" warning that is emitted when a constant is
2177assigned to a variable in a condition is now withheld if the constant is
2178actually a subroutine or one generated by C<use constant>, since the value
2179of the constant may not be known at the time the program is written
2180[perl #77762].
2181
2182=item *
2183
2184Previously, if none of the C<gethostbyaddr>, C<gethostbyname> and
2185C<gethostent> functions were implemented on a given platform, they would
2186all die with the message 'Unsupported socket function "gethostent" called',
2187with analogous messages for C<getnet*> and C<getserv*>. This has been
2188corrected.
2189
2190=item *
2191
2192The warning message about regex unrecognized escapes passed through is
2193changed to include any literal '{' following the 2-char escape. e.g.,
2194"\q{" will include the { in the message as part of the escape
2195(216bfc0).
2196
2197=item *
2198
2199C<binmode $fh, ':scalar'> no longer warns (8250589)
2200
2201Perl will now no longer produce this warning:
2202
2203 $ perl -we 'open my $f, ">", \my $x; binmode $f, "scalar"'
2204 Use of uninitialized value in binmode at -e line 1.
2205
2206=back
2207
2208=head1 Utility Changes
2209
2210=head3 L<perldb>
2211
2212=over
2213
2214=item *
2215
2216The remote terminal works after forking and spawns new sessions - one
2217for each forked process (11653f7)
2218
2219=item *
2220
2221Uses the less pager path from Config instead of searching for it (bf320d6)
2222
2223=back
2224
2225=head3 L<h2ph>
2226
2227=over 4
2228
2229=item *
2230
2231The use of a deprecated C<goto> construct has been removed [perl #74404].
2232
2233=back
2234
2235=head3 L<ptargrep>
2236
2237=over 4
2238
2239=item *
2240
2241L<ptargrep> is a utility to apply pattern matching to the contents of files
2242in a tar archive. It comes with C<Archive::Tar>.
2243
2244=back
2245
2246=head3 C<perlbug>
2247
2248=over 4
2249
2250=item *
2251
4ed2cea4
FC
2252C<perlbug> now looks in the EMAIL environment variable for a return address
2253if the REPLY-TO and REPLYTO variables are empty.
2254
2255=item *
2256
5076a392
FC
2257C<perlbug> did not previously generate a From: header, potentially
2258resulting in dropped mail. Now it does include that header.
2259
2260=back
2261
2262=head3 C<buildtoc>
2263
2264=over 4
2265
2266=item *
2267
2268F<pod/buildtoc> has been modernized and can now be used to test the
2269well-formedness of F<pod/perltoc.pod> automatically.
2270
2271=back
2272
2273=head3 L<perlbug>
2274
2275=over 4
2276
2277=item *
2278
2279[perl #82996] Use the user's from address as return-path in perlbug
2280
2281Many systems these days don't have a valid Internet domain name and
2282perlbug@perl.org does not accept email with a return-path that does
2283not resolve. Therefore pass the user's address to sendmail so it's
2284less likely to get stuck in a mail queue somewhere. (019cfd2)
2285
2286=back
2287
2288=head1 Configuration and Compilation
2289
61752d82
FC
2290See also L</"Naming fixes in Policy_sh.SH may invalidate Policy.sh">,
2291above.
2292
5076a392
FC
2293=over 4
2294
2295=item *
2296
2297Fix CCINCDIR and CCLIBDIR for mingw64 cross compiler to correctly be under
2298$(CCHOME)\mingw\include and \lib rather than immediately below $(CCHOME).
2299
2300=item *
2301
2302This means the 'incpath', 'libpth', 'ldflags', 'lddlflags' and
2303'ldflags_nolargefiles' values in Config.pm and Config_heavy.pl are now
2304set correctly (23ae7f).
2305
2306=item *
2307
2308Adjusted 'make test.valgrind' to account for cpan/dist/ext separation
2309(e07ce2e)
2310
2311=item *
2312
2313Compatibility with C<C++> compilers has been improved.
2314
2315=item *
2316
2317On compilers that support it, C<-Wwrite-strings> is now added to cflags by
2318default.
2319
2320=item *
2321
2322The C<Encode> module can now (once again) be included in a static Perl
2323build. The special-case handling for this situation got broken in Perl
23245.11.0, and has now been repaired.
2325
2326=back
2327
2328=head1 Testing
2329
2330XXX Any significant changes to the testing of a freshly built perl should be
2331listed here. Changes which create B<new> files in F<t/> go here as do any
2332large changes to the testing harness (e.g. when parallel testing was added).
2333Changes to existing files in F<t/> aren't worth summarising, although the bugs
2334that they represent may be covered elsewhere.
2335
2336=over 4
2337
2338=item *
2339
2340F<t/harness> clears PERL5LIB, PERLLIB, PERL5OPT as t/TEST does (a2d3de1)
2341
2342=item *
2343
2344Many common testing routines were refactored into t/lib/common.pl
2345
2346=item *
2347
2348Several test files have been modernized to use Test::More
2349
2350=item *
2351
2352F<t/op/print.t> has been added to test implicit printing of C<$_>.
2353
2354=item *
2355
2356F<t/io/errnosig.t> has been added to test for restoration of of C<$!> when
2357leaving signal handlers.
2358
2359=item *
2360
2361F<t/op/tie_fetch_count.t> has been added to see if C<FETCH> is only called once
2362on tied variables.
2363
2364=item *
2365
2366F<lib/Tie/ExtraHash.t> has been added to make sure the, previously untested,
2367L<Tie::ExtraHash> keeps working.
2368
2369=item *
2370
2371F<t/re/overload.t> has been added to test against string corruption in pattern
2372matches on overloaded objects. This is a TODO test.
2373
2374=item *
2375
2376The new F<t/lib/universal.t> script tests the Internal::* functions and other
2377things in F<universal.c>.
2378
2379=item *
2380
2381A rare race condition in F<t/op/while_readdir.t> has been fixed, stopping it
2382from failing randomly when running tests in parallel.
2383
2384=item *
2385
2386The new F<t/op/leaky-magic.t> script tests that magic applied to variables in
2387the main packages does not affect other packages.
2388
2389=item *
2390
2391The script F<t/op/threads-dirh.t> has been added, which tests interaction
2392of threads and directory handles.
2393
2394=item *
2395
2396The new F<t/mro/isa_aliases.t> has been added, which tests that
2397C<*Foo::ISA = *Bar::ISA> works properly.
2398
2399=item *
2400
2401F<t/mro/isarev.t> has been added, which tests that C<PL_isarev> (accessible
2402at the Perl level via C<mro::get_isarev>) is updated properly.
2403
2404=item *
2405
2406F<t/run/switchd-78586.t> has been added, which tests that [perl #78586]
2407has been fixed (related to line numbers in the debugger).
2408
2409=item *
2410
2411C<lib/File/DosGlob.t> has been modernized and now uses C<Test::More>.
2412
2413=item *
2414
2415A new test script, C<t/porting/filenames.t>, makes sure that filenames and
2416paths are reasonably portable.
2417
2418=item *
2419
2420C<t/porting/diag.t> is now several orders of magnitude faster.
2421
2422=item *
2423
2424C<t/porting/buildtoc.t> now tests that the documentation TOC file is current and well-formed.
2425
2426=item *
2427
2428C<t/base/while.t> now tests the basics of a while loop with minimal dependencies.
2429
2430=item *
2431
2432C<t/cmd/while.t> now uses F<test.pl> for better maintainability.
2433
2434=item *
2435
2436C<t/op/split.t> now tests calls to C<split> without any pattern specified.
2437
2438=item *
2439
2440F<porting/FindExt.t> now skips all tests on a static (-Uusedl) build
2441of perl.
2442
2443=item *
2444
2445F<porting/FindExt.t> now passes on non-Win32 platforms when some
2446extensions are built statically.
2447
2448=item *
2449
2450The tests for C<split /\s/> and Unicode have been moved from
2451F<t/op/split.t> to the new F<t/op/split_unicode.t>.
2452
2453=item *
2454
2455F<t/re/re.t> has been moved to F<ext/re/t/re_funcs_u.t>.
2456
2457=item *
2458
2459The tests for [perl #72922] have been moved from F<t/re/qr.t> to the new
2460F<t/re/qr-72922.t>.
2461
2462=item *
2463
2464F<t/re/reg_unsafe.t> has been deleted and its only test moved to
2465F<t/re/pat_advanced.t>.
2466
2467=back
2468
2469=head1 Platform Support
2470
2471XXX Any changes to platform support should be listed in the sections below.
2472
2473[ Within the sections, list each platform as a =item entry with specific
2474changes as paragraphs below it. ]
2475
2476=head2 New Platforms
2477
2478XXX List any platforms that this version of perl compiles on, that previous
2479versions did not. These will either be enabled by new files in the F<hints/>
2480directories, or new subdirectories and F<README> files at the top level of the
2481source tree.
2482
2483=over 4
2484
2485=item AIX
2486
2487Perl now builds on AIX 4.2.
2488
2489=back
2490
2491=head2 Discontinued Platforms
2492
2493=over 4
2494
2495=item MacOS Classic
2496
2497Support for MacOS Classic within ExtUtils::MakeMaker was removed from Perl in
2498December 2004. Vestigial MacOS Classic specific code has now been removed
2499from other core modules as well (8f8c2a4..c457df0)
2500
2501=item Apollo DomainOS
2502
2503The last vestiges of support for this platform have been excised from the
2504Perl distribution. It was officially discontinued in version 5.12.0. It had
2505not worked for years before that.
2506
2507=item MacOS Classic
2508
2509The last vestiges of support for this platform have been excised from the
2510Perl distribution. It was officially discontinued in an earlier version.
2511
2512=back
2513
2514=head2 Platform-Specific Notes
2515
2516=head3 Recent OpenBSDs now use perl's malloc
2517
2518OpenBSD E<gt> 3.7 has a new malloc implementation which is mmap based
2519and as such can release memory back to the OS; however for perl using
2520this malloc causes a substantial slowdown so we now default to using
2521perl's malloc instead (RT #75742) (9b58b5).
2522
2523=head3 VMS
2524
2525=over 4
2526
2527=item *
2528
2529Make C<PerlIOUnix_open> honour default permissions on VMS.
2530
2531When C<perlio> became the default and C<unixio> became the default bottom layer,
2532the most common path for creating files from Perl became C<PerlIOUnix_open>,
2533which has always explicitly used C<0666> as the permission mask.
2534
2535To avoid this, C<0777> is now passed as the permissions to C<open()>. In the
2536VMS CRTL, C<0777> has a special meaning over and above intersecting with the
2537current umask; specifically, it allows Unix syscalls to preserve native default
2538permissions.
2539
2540=back
2541
2542=head3 Win32
2543
2544t/io/openpid.t now uses the alarm() watchdog strategy for more
2545robustness (5732108)
2546
2547=over 4
2548
2549=item *
2550
2551Fixed a possible hang in F<t/op/readline.t>.
2552
2553=item *
2554
2555Fixed build process for SDK2003SP1 compilers.
2556
2557=item *
2558
2559When using old 32-bit compilers, the define C<_USE_32BIT_TIME_T> will now be set
2560in C<$Config{ccflags}>. This improves portability when compiling XS extensions
2561using new compilers, but for a perl compiled with old 32-bit compilers.
2562
2563=back
2564
2565XXX A bunch of entries that need conversion to =head2 format (unless the
2566entries above change to =items):
2567
2568=over
2569
2570=item IRIX
2571
2572Conversion of strings to floating-point numbers is now more accurate on
2573IRIX systems [perl #32380].
2574
2575=item Mac OS X
2576
2577Early versions of Mac OS X (Darwin) had buggy implementations of the
2578C<setregid>, C<setreuid>, C<setrgid> and C<setruid> functions, so perl
2579would pretend they did not exist.
2580
2581These functions are now recognised on Mac OS 10.5 (Leopard; Darwin 9) and
2582higher, as they have been fixed [perl #72990].
2583
2584=item OpenVOS
2585
2586perl now builds again with OpenVOS (formerly known as Stratus VOS)
2587[perl #78132].
2588
2589=item VMS
2590
2591The shortening of symbols longer than 31 characters in the C sources is
2592now done by the compiler rather than by xsubpp (which could only do so
2593for generated symbols in XS code).
2594
2595=item Windows
2596
2597C<$Config{gccversion}> is now set correctly when perl is built using the
2598mingw64 compiler from L<http://mingw64.org> [perl #73754].
2599
2600The build process proceeds more smoothly with mingw and dmake when
2601F<C:\MSYS\bin> is in the PATH, due to a C<Cwd> fix.
2602
2603=item Windows
2604
2605Directory handles are now properly cloned when threads are created. In perl
26065.13.6, child threads simply stopped inheriting directory handles. In
2607previous versions, threads would share handles, resulting in crashes.
2608
2609Support for building with Visual C++ 2010 is now underway, but is not yet
2610complete. See F<README.win32> for more details.
2611
2612=item VMS
2613
2614Record-oriented files (record format variable or variable with fixed control)
2615opened for write by the perlio layer will now be line buffered to prevent the
2616introduction of spurious line breaks whenever the perlio buffer fills up.
2617
2618=item NetBSD
2619
2620The NetBSD hints file has been changed to make the system's malloc the
2621default.
2622
2623=item Windows
2624
2625The option to use an externally-supplied C<crypt()>, or to build with no
2626C<crypt()> at all, has been removed. Perl supplies its own C<crypt()>
2627implementation for Windows, and the political situation that required
2628this part of the distribution to sometimes be omitted is long gone.
2629
2630=item Cygwin
2631
2632=over
2633
2634=item *
2635
2636Updated MakeMaker to build man pages on cygwin.
2637
2638=item *
2639
2640Improved rebase behaviour
2641
2642If a dll is updated on cygwin reuse the old imagebase address.
2643This solves most rebase errors, esp when updating on core dll's.
2644See L<http://www.tishler.net/jason/software/rebase/rebase-2.4.2.README> for more information.
2645
2646=item *
2647
2648Support the standard cyg dll prefix, which is e.g. needed for FFI's.
2649
2650=item *
2651
2652Updated build hints file
2653
2654=back
2655
2656
2657=item Solaris
2658
2659DTrace is now supported on Solaris. There used to be build failures, but
2660these have been fixed [perl #73630].
2661
2662=item Windows
2663
2664=over 4
2665
2666=item *
2667
2668The C<test-prep> build target now depends on F<pod/perltoc.pod> to allow the
2669F<t/porting/buildtoc.t> test to run successfully.
2670
2671=back
2672
2673=item MirBSD
2674
2675=over 4
2676
2677=item *
2678
2679[perl #82988] Skip hanging taint.t test on MirBSD 10 (1fb83d0)
2680
2681Skip a hanging test under MirBSD that was already being skipped under
2682OpenBSD.
2683
2684=item *
2685
2686Previously if you build perl with a shared libperl.so on MirBSD (the
2687default config), it will work up to the installation; however, once
2688installed, it will be unable to find libperl. Treat path handling
2689like in the other BSD dialects.
2690
2691=back
2692
2693=back
2694
2695=head1 Internal Changes
2696
aa81da68 2697See also L</New C APIs>, L</C API Changes> and L</Deprecated C APIs>, above.
f8e88449 2698
5076a392
FC
2699=over 4
2700
2701=item *
2702
2703The protocol for unwinding the C stack at the last stage of a C<die>
2704has changed how it identifies the target stack frame. This now uses
2705a separate variable C<PL_restartjmpenv>, where previously it relied on
2706the C<blk_eval.cur_top_env> pointer in the C<eval> context frame that
2707has nominally just been discarded. This change means that code running
2708during various stages of Perl-level unwinding no longer needs to take
2709care to avoid destroying the ghost frame.
2710
2711=item *
2712
2713The format of entries on the scope stack has been changed, resulting in a
2714reduction of memory usage of about 10%. In particular, the memory used by
2715the scope stack to record each active lexical variable has been halved.
2716
2717=item *
2718
2719Memory allocation for pointer tables has been changed. Previously
2720C<Perl_ptr_table_store> allocated memory from the same arena system as C<SV>
2721bodies and C<HE>s, with freed memory remaining bound to those arenas until
2722interpreter exit. Now it allocates memory from arenas private to the specific
2723pointer table, and that memory is returned to the system when
2724C<Perl_ptr_table_free> is called. Additionally, allocation and release are both
2725less CPU intensive.
2726
2727=item *
2728
2729A new function, Perl_magic_methcall has been added that wraps the setup needed
2730to call a magic method like FETCH (the existing S_magic_methcall function has
2731been renamed S_magic_methcall1).
2732
2733=item *
2734
2735The implementation of sv_dup_inc() has changed from a macro to a function.
2736
2737=item *
2738
2739The C<find_rundefsvoffset> function has been deprecated. It appeared that
2740its design was insufficient to reliably get the lexical C<$_> at run-time.
2741
2742Use the new C<find_rundefsv> function or the C<UNDERBAR> macro instead.
2743They directly return the right SV representing C<$_>, whether it's lexical
2744or dynamic (789bd8 .. 03d5bc).
2745
2746=item *
2747
2748The following new functions or macros have been added to the public API:
2749C<SvNV_nomg>, C<sv_2nv_flags>, C<find_rundefsv>.
2750
2751=item *
2752
2753The C<UNDERBAR> macro now calls C<find_rundefsv>. C<dUNDERBAR> is now a
2754noop but should still be used to ensure past and future compatibility.
2755
2756=item *
2757
2758The ibcmp_* functions have been renamed and are now called foldEQ,
2759foldEQ_locale and foldEQ_utf8 (e6226b).
2760
2761=item *
2762
2763Under some circumstances, the C<CvGV()> field of a CV is now reference
2764counted. To ensure consistent behaviour, direct assignment to it, for
2765example C<CvGV(cv) = gv> is now a compile-time error. A new macro,
2766C<CvGV_set(cv,gv)> has been introduced to perform this operation safely.
2767Note that modification of this field is not part of of the public API,
2768regardless of this new macro. This change caused some
2769L<issues|/"Known Problems"> in modules that used the private C<GvGV()>
2770field.
2771
2772=item *
2773
2774It is now possible for XS code to hook into Perl's lexical scope
2775mechanism at compile time, using the new C<Perl_blockhook_register>
2776function. See L<perlguts/"Compile-time scope hooks">.
2777
2778=item *
2779
2780Added C<Perl_croak_no_modify()> to implement
2781C<Perl_croak("%s", PL_no_modify)> (6ad8f25)
2782
2783=item *
2784
2785Added prototypes for C<tie()> and C<untie()> to allow overloading (RT#75902)
2786(1db4d19)
2787
2788=item *
2789
2790Adds C<my_[l]stat_flags()> to replace C<my_[l]stat()>. C<my_stat()> and
2791C<my_lstat()> call get magic on the stack arg, so create C<_flags()>
2792variants that allow us to control this. (0d7d409)
2793
2794=item *
2795
2796Removed C<PERL_POLLUTE>
2797
2798The option to define C<PERL_POLLUTE> to expose older 5.005 symbols for backwards
2799compatibility has been removed. It's use was always discouraged, and MakeMaker
2800contains a more specific escape hatch:
2801
2802 perl Makefile.PL POLLUTE=1
2803
2804This can be used for modules that have not been upgraded to 5.6 naming
2805conventions (and really should be completely obsolete by now).
2806
2807=item *
2808
2809Added C<PERL_STATIC_INLINE>
2810
2811The C<PERL_STATIC_INLINE> define has been added to provide the best-guess
2812incantation to use for static inline functions, if the C compiler supports
2813C99-style static inline. If it doesn't, it'll give a plain C<static>.
2814
2815C<HAS_STATIC_INLINE> can be used to check if the compiler actually supports
2816inline functions.
2817
2818=item *
2819
2820C<CALL_FPTR> and C<CPERLscope> have been deprecated.
2821
2822Those are left from an old implementation of C<MULTIPLICITY> using C++ objects,
2823which was removed in Perl 5.8. Nowadays these macros do exactly nothing, so
2824they shouldn't be used anymore.
2825
2826For compatibility, they are still defined for external C<XS> code. Only
2827extensions defining C<PERL_CORE> must be updated now.
2828
2829=item *
2830
2831C<lex_stuff_pvs()> has been added as a convenience macro wrapping
2832C<lex_stuff_pvn()> for literal strings.
2833
2834=item *
2835
2836The recursive part of the peephole optimizer is now hookable.
2837
2838In addition to C<PL_peepp>, for hooking into the toplevel peephole optimizer, a
2839C<PL_rpeepp> is now available to hook into the optimizer recursing into
2840side-chains of the optree.
2841
2842=item *
2843
2844See L</Regular expressions retain their localeness when interpolated>,
2845above.
2846
2847=item *
2848
2849The C<sv_cmp_flags>, C<sv_cmp_locale_flags>, C<sv_eq_flags> and
2850C<sv_collxfrm_flags> functions have been added. These are like their
2851non-_flags counterparts, but allow one to specify whether get-magic is
2852processed.
2853
2854The C<sv_cmp>, C<sv_cmp_locale>, C<sv_eq> and C<sv_collxfrm> functions have
2855been replaced with wrappers around the new functions.
2856
2857=item *
2858
2859A new C<sv_2bool_flags> function has been added.
2860
2861This is like C<sv_2bool>, but it lets the calling code decide whether
2862get-magic is handled. C<sv_2bool> is now a macro that calls the new
2863function.
2864
2865=item *
2866
2867A new macro, C<SvTRUE_nomg>, has been added.
2868
2869This is like C<SvTRUE>, except that it does not process magic. It uses the
2870new C<sv_2bool_flags> function.
2871
2872=item *
2873
2874C<sv_catsv_flags> no longer calls C<mg_get> on its second argument (the
2875source string) if the flags passed to it do not include SV_GMAGIC. So it
2876now matches the documentation.
2877
2878=item *
2879
2880A new interface has been added for custom check hooks on subroutines. See
2881L</Custom per-subroutine check hooks>, above.
2882
2883=item *
2884
2885List op building functions have been added to the
2886API. See L<op_append_elem|perlapi/op_append_elem>,
2887L<op_append_list|perlapi/op_append_list>, and
2888L<op_prepend_elem|perlapi/op_prepend_elem>.
2889
2890=item *
2891
2892The L<LINKLIST|perlapi/LINKLIST> macro, part of op building that
2893constructs the execution-order op chain, has been added to the API.
2894
2895=item *
2896
2897Many functions ending with pvn now have equivalent pv/pvs/sv versions.
2898
2899=item *
2900
2901The C<save_freeop>, C<save_op>, C<save_pushi32ptr> and C<save_pushptrptr>
2902functions have been added to the API.
2903
2904=item *
2905
2906The new API function C<parse_stmtseq()> parses a sequence of statements, up
2907to closing brace or EOF.
2908
2909=item *
2910
2911C<lex_start> has been added to the API, but is considered experimental.
2912
2913=item *
2914
2915A new C<parse_block> function has been added to the API [perl #78222].
2916
2917=item *
2918
2919A new, experimental API has been added for accessing the internal
2920structure that Perl uses for C<%^H>. See the functions beginning with
2921C<cophh_> in L<perlapi>.
2922
2923=item *
2924
2925A stash can now have a list of effective names in addition to its usual
2926name. The first effective name can be accessed via the C<HvENAME> macro,
2927which is now the recommended name to use in MRO linearisations (C<HvNAME>
2928being a fallback if there is no C<HvENAME>).
2929
2930These names are added and deleted via C<hv_ename_add> and
2931C<hv_ename_delete>. These two functions are I<not> part of the API.
2932
2933=item *
2934
2935The way the parser handles labels has been cleaned up and refactored. As a
2936result, the C<newFOROP()> constructor function no longer takes a parameter
2937stating what label is to go in the state op.
2938
2939=item *
2940
2941The C<newWHILEOP()> and C<newFOROP()> functions no longer accept a line
2942number as a parameter.
2943
2944=item *
2945
2946A new C<parse_barestmt()> function has been added, for parsing a statement
2947without a label.
2948
2949=item *
2950
2951A new C<parse_label()> function has been added, that parses a statement
2952label, separate from statements.
2953
2954=item *
2955
2956The C<CvSTASH()> macro can now only be used as an rvalue. C<CvSTASH_set()>
2957has been added to replace assignment to C<CvSTASH()>. This is to ensure
2958that backreferences are handled properly. These macros are not part of the
2959API.
2960
2961=item *
2962
2963The C<op_scope()> and C<op_lvalue()> functions have been added to the API,
2964but are considered experimental.
2965
2966=item *
2967
2968The L<C<mg_findext()>|perlapi/mg_findext> and
2969L<C<sv_unmagicext()>|perlapi/sv_unmagicext>
2970functions have been added to the API.
2971They allow extension authors to find and remove magic attached to
2972scalars based on both the magic type and the magic virtual table, similar to how
2973C<sv_magicext()> attaches magic of a certain type and with a given virtual table
2974to a scalar. This eliminates the need for extensions to walk the list of
2975C<MAGIC> pointers of an C<SV> to find the magic that belongs to them.
2976
2977=item *
2978
2979The
2980L<C<parse_fullexpr()>|perlapi/parse_fullexpr>,
2981L<C<parse_listexpr()>|perlapi/parse_listexpr>,
2982L<C<parse_termexpr()>|perlapi/parse_termexpr>, and
2983L<C<parse_arithexpr()>|perlapi/parse_arithexpr>
2984functions have been added to the API. They perform
2985recursive-descent parsing of expressions at various precedence levels.
2986They are expected to be used by syntax plugins.
2987
2988=item *
2989
2990The opcode bodies for C<chop> and C<chomp> and for C<schop> and C<schomp> have
2991been merged. The implementation functions C<Perl_do_chop()> and
2992C<Perl_do_chomp()>, never part of the public API, have been merged and moved to
2993a static function in F<pp.c>. This shrinks the perl binary slightly, and should
2994not affect any code outside the core (unless it is relying on the order of side
2995effects when C<chomp> is passed a I<list> of values).
2996
2997=item *
2998
2999Some of the flags parameters to the uvuni_to_utf8_flags() and
3000utf8n_to_uvuni() have changed. This is a result of Perl now allowing
3001internal storage and manipulation of code points that are problematic
3002in some situations. Hence, the default actions for these functions has
3003been complemented to allow these code points. The new flags are
3004documented in L<perlapi>. Code that requires the problematic code
3005points to be rejected needs to change to use these flags. Some flag
3006names are retained for backward source compatibility, though they do
3007nothing, as they are now the default. However the flags
3008C<UNICODE_ALLOW_FDD0>, C<UNICODE_ALLOW_FFFF>, C<UNICODE_ILLEGAL>, and
3009C<UNICODE_IS_ILLEGAL> have been removed, as they stem from a
3010fundamentally broken model of how the Unicode non-character code points
3011should be handled, which is now described in
3012L<perlunicode/Non-character code points>. See also L</Selected Bug Fixes>.
3013
3014=item *
3015
3016Certain shared flags in the C<pmop.op_pmflags> and C<regexp.extflags>
3017structures have been removed. These are: C<Rxf_Pmf_LOCALE>,
3018C<Rxf_Pmf_UNICODE>, and C<PMf_LOCALE>. Instead there are encodes and
3019three static in-line functions for accessing the information:
3020C<get_regex_charset()>, C<set_regex_charset()>, and C<get_regex_charset_name()>,
3021which are defined in the places where the original flags were.
3022
3023=item *
3024
3025A new option has been added to C<pv_escape> to dump all characters above
3026ASCII in hexadecimal. Before, one could get all characters as hexadecimal
3027or the Latin1 non-ASCII as octal
3028
3029
3030=item *
3031
3032Generate pp_* prototypes in pp_proto.h, and remove pp.sym
3033
3034Eliminate the #define pp_foo Perl_pp_foo(pTHX) macros, and update the 13
3035locations that relied on them.
3036
3037regen/opcode.pl now generates prototypes for the PP functions directly, into
3038pp_proto.h. It no longer writes pp.sym, and regen/embed.pl no longer reads
3039this, removing the only ordering dependency in the regen scripts. opcode.pl
3040is now responsible for prototypes for pp_* functions. (embed.pl remains
3041responsible for ck_* functions, reading from regen/opcodes)
3042
3043=item *
3044
3045Fix harmless invalid read in Perl_re_compile() (f6d9469)
3046
3047[perl #2460] described a case where electric fence reported an invalid
3048read. This could be reproduced under valgrind with blead and -e'/x/',
3049but only on a non-debugging build.
3050
3051This was because it was checking for certain pairs of nodes (e.g. BOL + END)
3052and wasn't allowing for EXACT nodes, which have the string at the next
3053node position when using a naive NEXTOPER(first). In the non-debugging
3054build, the nodes aren't initialised to zero, and a 1-char EXACT node isn't
3055long enough to spill into the type field of the "next node".
3056
3057Fix this by only using NEXTOPER(first) when we know the first node is
3058kosher.
3059
3060=item *
3061
3062Break out the generated function Perl_keywords() into F<keywords.c>, a new file. (26ea9e1)
3063
3064As it and Perl_yylex() both need FEATURE_IS_ENABLED, feature_is_enabled() is
3065no longer static, and the two macro definitions move from toke.c to perl.h
3066
3067Previously, one had to cut and paste the output of perl_keywords.pl into the
3068middle of toke.c, and it was not clear that it was generated code.
3069
3070=item *
3071
3072A lot of tests have been ported from Test to Test::More, e.g. in
30733842ad6.
3074
3075=item *
3076
3077Increase default PerlIO buffer size. (b83080d)
3078
3079The previous default size of a PerlIO buffer (4096 bytes) has been increased
3080to the larger of 8192 bytes and your local BUFSIZ. Benchmarks show that doubling
3081this decade-old default increases read and write performance in the neighborhood
3082of 25% to 50% when using the default layers of perlio on top of unix. To choose
3083a non-default size, such as to get back the old value or to obtain and even
3084larger value, configure with:
3085
3086 ./Configure -Accflags=-DPERLIOBUF_DEFAULT_BUFSIZ=N
3087
3088where N is the desired size in bytes; it should probably be a multiple of
3089your page size.
3090
3091=back
3092
3093=head1 Selected Bug Fixes
3094
3095=over 4
3096
3097=item *
3098
4ed2cea4
FC
3099C<when(scalar){...}> no longer crashes, but produces a syntax error
3100[perl #74114].
3101
3102=item *
3103
3104The C-level C<lex_stuff_pvn> function would sometimes cause a spurious
3105syntax error on the last line of the file if it lacked a final semicolon
3106[perl #74006].
3107
3108=item *
3109
3110The regular expression engine no longer loops when matching
3111C<"\N{LATIN SMALL LIGATURE FF}" =~ /f+/i> and similar expressions
3112[perl #72998].
3113
3114=item *
3115
3116A label right before a string eval (C<foo: eval $string>) no longer causes
3117the label to be associated also with the first statement inside the eval
3118[perl #74290] (5.12.1).
3119
3120=item *
3121
5076a392
FC
3122Naming a deprecated character in \N{...} will not leak memory.
3123
3124=item *
3125
3126FETCH is no longer called needlessly on some tied variables.
3127
3128=item *
3129
3130The trie runtime code should no longer allocate massive amounts of memory,
3131fixing #74484.
3132
3133=item *
3134
3135Timely cleanup of SVs that are cloned into a new thread but then
3136discovered to be orphaned (i.e. their owners are -not- cloned) (e42956)
3137
3138=item *
3139
3140Don't accidentally clone lexicals in scope within active stack frames in
3141the parent when creating a child thread (RT #73086) (05d04d).
3142
3143=item *
3144
3145Avoid loading feature.pm when 'no 5.13.2;' or similar is
3146encountered (faee19).
3147
3148=item *
3149
3150Trap invalid use of SvIVX on SVt_REGEXP when assertions are on
3151(e77da3)
3152
3153=item *
3154
3155Don't stamp on $DB::single, $DB::trace and $DB::signal if they
3156already have values when $^P is assigned to (RT #72422) (4c0f30).
3157
3158=item *
3159
3160chop now correctly handles perl's extended UTF-8 (RT #73246) (65ab92)
3161
3162=item *
3163
3164Defer signal handling when shared SV locks are held to avoid
3165deadlocks (RT #74868) (65c742).
3166
3167=item *
3168
3169glob() no longer crashes when %File::Glob:: is empty and
3170CORE::GLOBAL::glob isn't present (4984aa).
3171
3172=item *
3173
3174perlbug now always permits the sender address to be changed
3175before sending - if you were having trouble sending bug reports before
3176now, this should fix it, we hope (e6eb90).
3177
3178=item *
3179
3180Overloading now works properly in conjunction with tied
3181variables. What formerly happened was that most ops checked their
3182arguments for overloading I<before> checking for magic, so for example
3183an overloaded object returned by a tied array access would usually be
3184treated as not overloaded (RT #57012) (6f1401, ed3b9b, 6a5f8c .. 24328f).
3185
3186=item *
3187
3188Independently, a bug was fixed that prevented $tied-E<gt>() from
3189always calling FETCH correctly (RT #8438) (7c7501)
3190
3191=item *
3192
3193Some work has been done on the internal pointers that link between symbol
3194tables (stashes), typeglobs and subroutines. This has the effect that
3195various edge cases related to deleting stashes or stash entries (e.g.
3196<%FOO:: = ()>), and complex typeglob or code reference aliasing, will no
3197longer crash the interpreter.
3198
3199=item *
3200
3201Fixed readline() when interrupted by signals so it no longer returns
3202the "same thing" as before or random memory
3203
3204=item *
3205
3206Fixed a regression of kill() when a match variable is used for the
3207process ID to kill (RT#75812) (8af710e)
3208
3209=item *
3210
3211Fixed several subtle bugs in sort() when @_ is accessed within a subroutine
3212used for sorting (RT#72334) (8f443ca)
3213
3214=item *
3215
3216Catch yyparse() exceptions in C<< (?{...}) >> (RT#2353) (634d691)
3217
3218=item *
3219
3220Avoid UTF-8 cache panics with offsets beyond a string (RT #75898) (3e2d381)
3221
3222=item *
3223
3224Fixed POSIX::strftime memory leak (RT#73520) (c4bc4aa)
3225
3226=item *
3227
3228Doesn't set strict with C<no VERSION> if C<VERSION> is greater than 5.12
3229(da8fb5d)
3230
3231=item *
3232
3233Avoids multiple FETCH/stringify on filetest ops (40c852d)
3234
3235=item *
3236
3237Fixed issue with string C<eval> not detecting taint of overloaded/tied
3238arguments (RT #75716) (895b760)
3239
3240=item *
3241
3242Fix potential crashes of string C<eval> when evaluating a object with
3243overloaded stringification by creating a stringified copy when necessary
3244(3e5c018)
3245
3246=item *
3247
3248Fixed bug where overloaded stringification could remove tainting
3249(RT #75716) (a02ec77)
3250
3251=item *
3252
3253Plugs more memory leaks in vms.c. (9e2bec0)
3254
3255=item *
3256
3257Fix pthread include error for Time::Piece (e9f284c)
3258
3259=item *
3260
3261A possible memory leak when using L<caller()|perlfunc/"caller EXPR"> to set
3262C<@DB::args> has been fixed.
3263
3264=item *
3265
3266Several memory leaks when loading XS modules were fixed.
3267
3268=item *
3269
3270A panic in the regular expression optimizer has been fixed (RT#75762).
3271
3272=item *
3273
3274Assignments to lvalue subroutines now honor copy-on-write behavior again, which
3275has been broken since version 5.10.0 (RT#75656).
3276
3277=item *
3278
3279Assignments to glob copies now behave just like assignments to regular globs
3280(RT#1804).
3281
3282=item *
3283
3284Within signal handlers, C<$!> is now implicitly localized.
3285
3286=item *
3287
3288L<readline|perlfunc/"readline EXPR"> now honors C<< <> >> overloading on tied
3289arguments.
3290
3291=item *
3292
3293L<substr()|perlfunc/"substr EXPR,OFFSET,LENGTH,REPLACEMENT">,
3294L<pos()|perlfunc/"index STR,SUBSTR,POSITION">, L<keys()|perlfunc/"keys HASH">,
3295and L<vec()|perlfunc/"vec EXPR,OFFSET,BITS"> could, when used in combination
3296with lvalues, result in leaking the scalar value they operate on, and cause its
3297destruction to happen too late. This has now been fixed.
3298
3299=item *
3300
3301Building with C<PERL_GLOBAL_STRUCT>, which has been broken accidentally in
33025.13.3, now works again.
3303
3304=item *
3305
3306A regression introduced in Perl 5.12.0, making
3307C<< my $x = 3; $x = length(undef) >> result in C<$x> set to C<3> has been
3308fixed. C<$x> will now be C<undef>.
3309
3310=item *
3311
3312A fatal error in regular expressions when processing UTF-8 data has been fixed [perl #75680].
3313
3314=item *
3315
54c7bb16 3316An erroneous regular expression engine optimisation that caused regex verbs like
5076a392
FC
3317C<*COMMIT> to sometimes be ignored has been removed.
3318
3319=item *
3320
3321The Perl debugger now also works in taint mode [perl #76872].
3322
3323=item *
3324
3325Several memory leaks in cloning and freeing threaded Perl interpreters have been
3326fixed [perl #77352].
3327
3328=item *
3329
3330A possible string corruption when doing regular expression matches on overloaded
3331objects has been fixed [perl #77084].
3332
3333=item *
3334
3335Magic applied to variables in the main package no longer affects other packages.
3336See L</Magic variables outside the main package> above [perl #76138].
3337
3338=item *
3339
3340Opening a glob reference via C<< open $fh, "E<gt>", \*glob >> will no longer
3341cause the glob to be corrupted when the filehandle is printed to. This would
3342cause perl to crash whenever the glob's contents were accessed
3343[perl #77492].
3344
3345=item *
3346
3347The postincrement and postdecrement operators, C<++> and C<-->, used to cause
3348leaks when being used on references. This has now been fixed.
3349
3350=item *
3351
3352A bug when replacing the glob of a loop variable within the loop has been fixed
3353[perl #21469]. This
3354means the following code will no longer crash:
3355
3356 for $x (...) {
3357 *x = *y;
3358 }
3359
3360=item *
3361
3362Perl would segfault if the undocumented C<Internals> functions that used
3363reference prototypes were called with the C<&foo()> syntax, e.g.
3364C<&Internals::SvREADONLY(undef)> [perl #77776].
3365
3366These functions now call C<SvROK> on their arguments before dereferencing them
3367with C<SvRV>, and we test for this case in F<t/lib/universal.t>.
3368
3369=item *
3370
3371When assigning a list with duplicated keys to a hash, the assignment used to
3372return garbage and/or freed values:
3373
3374 @a = %h = (list with some duplicate keys);
3375
3376This has now been fixed [perl #31865].
3377
3378=item *
3379
3380An earlier release of the 5.13 series of Perl changed the semantics of opening a
3381reference to a copy of a glob:
3382
3383 my $var = *STDOUT;
3384 open my $fh, '>', \$var;
3385
3386This was a mistake, and the previous behaviour from Perl 5.10 and 5.12, which is
3387to treat \$var as a scalar reference, has now been restored.
3388
3389=item *
3390
3391The regular expression bracketed character class C<[\8\9]> was effectively the
3392same as C<[89\000]>, incorrectly matching a NULL character. It also gave
3393incorrect warnings that the C<8> and C<9> were ignored. Now C<[\8\9]> is the
3394same as C<[89]> and gives legitimate warnings that C<\8> and C<\9> are
3395unrecognized escape sequences, passed-through.
3396
3397=item *
3398
3399C<warn()> and C<die()> now respect utf8-encoded scalars [perl #45549].
3400
3401=item *
3402
3403A regular expression match in the right-hand side of a global substitution
3404(C<s///g>) that is in the same scope will no longer cause match variables
3405to have the wrong values on subsequent iterations. This can happen when an
3406array or hash subscript is interpolated in the right-hand side, as in
3407C<s|(.)|@a{ print($1), /./ }|g> [perl #19078].
3408
3409=item *
3410
3411Constant-folding used to cause
3412
3413 $text =~ ( 1 ? /phoo/ : /bear/)
3414
3415to turn into
3416
3417 $text =~ /phoo/
3418
3419at compile time. Now it correctly matches against C<$_> [perl #20444].
3420
3421=item *
3422
3423Parsing Perl code (either with string C<eval> or by loading modules) from
3424within a C<UNITCHECK> block no longer causes the interpreter to crash
3425[perl #70614].
3426
3427=item *
3428
3429When C<-d> is used on the shebang (C<#!>) line, the debugger now has access
3430to the lines of the main program. In the past, this sometimes worked and
3431sometimes did not, depending on what order things happened to be arranged
3432in memory [perl #71806].
3433
3434=item *
3435
3436The C<y///> or C<tr///> operator now calls get-magic (e.g., the C<FETCH>
3437method of a tie) on its left-hand side just once, not twice [perl #76814].
3438
3439=item *
3440
3441String comparison (C<eq>, C<ne>, C<lt>, C<gt>, C<le>, C<ge> and
3442C<cmp>) and logical not (C<not> and C<!>) operators no longer call magic
3443(e.g., tie methods) twice on their operands [perl #76814].
3444
3445This bug was introduced in an earlier 5.13 release, and does not affect
3446perl 5.12.
3447
3448=item *
3449
3450When a tied (or other magic) variable is used as, or in, a regular
3451expression, it no longer has its C<FETCH> method called twice
3452[perl #76814].
3453
3454This bug was introduced in an earlier 5.13 release, and does not affect
3455perl 5.12.
3456
3457=item *
3458
3459The C<-C> command line option can now be followed by other options
3460[perl #72434].
3461
3462=item *
3463
3464Assigning a glob to a PVLV used to convert it to a plain string. Now it
3465works correctly, and a PVLV can hold a glob. This would happen when a
3466nonexistent hash or array element was passed to a subroutine:
3467
3468 sub { $_[0] = *foo }->($hash{key});
3469 # $_[0] would have been the string "*main::foo"
3470
3471It also happened when a glob was assigned to, or returned from, an element
3472of a tied array or hash [perl #36051].
3473
3474=item *
44691e6f 3475
5076a392
FC
3476Creating a new thread when directory handles were open used to cause a
3477crash, because the handles were not cloned, but simply passed to the new
3478thread, resulting in a double free.
44691e6f 3479
5076a392
FC
3480Now directory handles are cloned properly, on systems that have a C<fchdir>
3481function. On other systems, new threads simply do not inherit directory
3482handles from their parent threads [perl #75154].
44691e6f 3483
5076a392 3484=item *
44691e6f 3485
5076a392
FC
3486The regular expression parser no longer hangs when parsing C<\18> and
3487C<\88>.
44691e6f 3488
5076a392
FC
3489This bug was introduced in version 5.13.5 and did not affect earlier
3490versions [perl #78058].
b7188eb5 3491
5076a392 3492=item *
b7188eb5 3493
5076a392 3494Subroutine redefinition works once more in the debugger [perl #48332].
44691e6f 3495
5076a392 3496=item *
658a9f31 3497
5076a392
FC
3498The C<&> C<|> C<^> bitwise operators no longer coerce read-only arguments
3499[perl #20661].
658a9f31 3500
5076a392 3501=item *
658a9f31 3502
5076a392
FC
3503Stringifying a scalar containing -0.0 no longer has the affect of turning
3504false into true [perl #45133].
b7188eb5 3505
5076a392 3506=item *
b7188eb5 3507
5076a392
FC
3508Aliasing packages by assigning to globs or deleting packages by deleting
3509their containing stash elements used to have erratic effects on method
3510resolution, because the internal 'isa' caches were not reset. This has been
3511fixed.
b7188eb5 3512
5076a392 3513=item *
3aa0ac5a 3514
5076a392
FC
3515C<sort> with a custom sort routine could crash if too many nested
3516subroutine calls occurred from within the sort routine [perl #77930].
3aa0ac5a 3517
5076a392
FC
3518This bug was introduced in an earlier 5.13 release, and did not affect
3519perl 5.12.
3aa0ac5a 3520
5076a392 3521=item *
3aa0ac5a 3522
5076a392
FC
3523The C<eval_sv> and C<eval_pv> C functions now set C<$@> correctly when
3524there is a syntax error and no C<G_KEEPERR> flag, and never set it if the
3525C<G_KEEPERR> flag is present [perl #3719].
270ca148 3526
5076a392 3527=item *
270ca148 3528
5076a392
FC
3529Nested C<map> and C<grep> blocks no longer leak memory when processing
3530large lists [perl #48004].
270ca148 3531
5076a392 3532=item *
44691e6f 3533
5076a392 3534Malformed C<version> objects no longer cause crashes [perl #78286].
44691e6f
AB
3535
3536=item *
3537
5076a392
FC
3538The interpreter no longer crashes when freeing deeply-nested arrays of
3539arrays. Hashes have not been fixed yet [perl #44225].
44691e6f 3540
5076a392 3541=item *
44691e6f 3542
5076a392
FC
3543The mechanism for freeing objects in globs used to leave dangling
3544pointers to freed SVs, meaning Perl users could see corrupted state
3545during destruction.
44691e6f 3546
5076a392
FC
3547Perl now only frees the affected slots of the GV, rather than freeing
3548the GV itself. This makes sure that there are no dangling refs or
3549corrupted state during destruction.
65484cb9 3550
5076a392 3551=item *
b7188eb5 3552
5076a392
FC
3553The typeglob C<*,>, which holds the scalar variable C<$,> (output field
3554separator), had the wrong reference count in child threads.
911a3729 3555
5076a392
FC
3556=item *
3557
3558C<splice> now calls set-magic. This means that, for instance, changes made
3559by C<splice @ISA> are respected by method calls [perl #78400].
452d0b70
DG
3560
3561=item *
3562
5076a392 3563C<use v5.8> no longer leaks memory [perl #78436].
911a3729 3564
5076a392 3565=item *
c8c13991 3566
5076a392
FC
3567The XS multicall API no longer causes subroutines to lose reference counts
3568if called via the multicall interface from within those very subroutines.
3569This affects modules like List::Util. Calling one of its functions with an
3570active subroutine as the first argument could cause a crash [perl #78070].
c8c13991 3571
5076a392
FC
3572=item *
3573
3574The C<parse_stmt> C function added in earlier in the 5.13.x series has been
3575fixed to work with statements ending with C<}> [perl #78222].
44691e6f 3576
f00d3350
BR
3577=item *
3578
5076a392
FC
3579The C<parse_fullstmt> C function added in 5.13.5 has been fixed to work
3580when called while an expression is being parsed.
fe3de278 3581
5076a392 3582=item *
35cdccfc 3583
5076a392
FC
3584Characters in the Latin-1 non-ASCII range (0x80 to 0xFF) used not to match
3585themselves if the string happened to be UTF8-encoded internally, the
3586regular expression was not, and the character in the regular expression was
3587inside a repeated group (e.g.,
3588C<Encode::decode_utf8("\303\200") =~ /(\xc0)+/>) [perl #78464].
35cdccfc 3589
5076a392
FC
3590=item *
3591
3592The C<(?d)> regular expression construct now overrides a previous C<(?u)>
3593or C<use feature "unicode_string"> [perl #78508].
f5c40488
CBW
3594
3595=item *
3596
5076a392
FC
3597A memory leak in C<do "file">, introduced in perl 5.13.6, has been fixed
3598[perl #78488].
b7188eb5 3599
5076a392 3600=item *
b7188eb5 3601
5076a392
FC
3602Various bugs related to typeglob dereferencing have been fixed. See
3603L</Dereferencing typeglobs>, above.
0bb35765 3604
5076a392 3605=item *
911a3729 3606
5076a392
FC
3607The C<SvPVbyte> function available to XS modules now calls magic before
3608downgrading the SV, to avoid warnings about wide characters [perl #72398].
911a3729 3609
5076a392 3610=item *
58f55cb3 3611
5076a392
FC
3612The C<=> operator used to ignore magic (e.g., tie methods) on its
3613right-hand side if the scalar happened to hold a typeglob. This could
3614happen if a typeglob was the last thing returned from or assigned to a tied
3615scalar [perl #77498].
58f55cb3 3616
5076a392 3617=item *
6b3df227 3618
5076a392
FC
3619C<sprintf> was ignoring locales when called with constant arguments
3620[perl #78632].
6b3df227 3621
5076a392 3622=item *
c9989a74 3623
5076a392
FC
3624A non-ASCII character in the Latin-1 range could match both a Posix
3625class, such as C<[[:alnum:]]>, and its inverse C<[[:^alnum:]]>. This is
3626now fixed for regular expressions compiled under the C<"u"> modifier.
3627See L</C<use feature "unicode_strings"> now applies to more regex matching>. [perl #18281].
c9989a74 3628
5076a392
FC
3629=item *
3630
3631Concatenating long strings under C<use encoding> no longer causes perl to
3632crash [perl #78674].
b7188eb5
FC
3633
3634=item *
3635
5076a392
FC
3636Typeglob assignments would crash if the glob's stash no longer existed, so
3637long as the glob assigned to was named 'ISA' or the glob on either side of
3638the assignment contained a subroutine.
911a3729 3639
5076a392 3640=item *
c8c13991 3641
5076a392
FC
3642Calling C<< ->import >> on a class lacking an import method could corrupt
3643the stack, resulting in strange behaviour. For instance,
c8c13991 3644
5076a392 3645 push @a, "foo", $b = bar->import;
f00d3350 3646
5076a392 3647would assign 'foo' to C<$b> [perl #63790].
c34a735e 3648
5076a392 3649=item *
b7188eb5 3650
5076a392
FC
3651Creating an alias to a package when that package had been detached from the
3652symbol table would result in corrupted isa caches [perl #77358].
b7188eb5 3653
5076a392 3654=item *
b7188eb5 3655
5076a392
FC
3656C<.=> followed by C<< <> >> or C<readline> would leak memory if C<$/>
3657contained characters beyond the octet range and the scalar assigned to
3658happened to be encoded as UTF8 internally [perl #72246].
c34a735e 3659
05dbc6f8
KW
3660=item *
3661
5076a392
FC
3662The C<recv> function could crash when called with the MSG_TRUNC flag
3663[perl #75082].
7b98b857 3664
5076a392 3665=item *
05dbc6f8 3666
5076a392
FC
3667Evaluating a simple glob (like C<*a>) was calling get-magic on the glob,
3668even when its contents were not being used [perl #78580].
05dbc6f8 3669
5076a392 3670This bug was introduced in 5.13.2 and did not affect earlier perl versions.
05dbc6f8 3671
5076a392
FC
3672=item *
3673
3674Matching a Unicode character against an alternation containing characters
3675that happened to match continuation bytes in the former's UTF8
3676representation (C<qq{\x{30ab}} =~ /\xab|\xa9/>) would cause erroneous
3677warnings [perl #70998].
05dbc6f8
KW
3678
3679=item *
3680
5076a392 3681C<s///r> (added in 5.13.2) no longer leaks.
05dbc6f8 3682
5076a392 3683=item *
05dbc6f8 3684
5076a392
FC
3685The trie optimisation was not taking empty groups into account, preventing
3686'foo' from matching C</\A(?:(?:)foo|bar|zot)\z/> [perl #78356].
05dbc6f8 3687
5076a392 3688=item *
05dbc6f8 3689
5076a392
FC
3690A pattern containing a C<+> inside a lookahead would sometimes cause an
3691incorrect match failure in a global match (e.g., C</(?=(\S+))/g>)
3692[perl #68564].
05dbc6f8 3693
5076a392 3694=item *
05dbc6f8 3695
5076a392
FC
3696Iterating with C<foreach> over an array returned by an lvalue sub now works
3697[perl #23790].
05dbc6f8
KW
3698
3699=item *
3700
5076a392
FC
3701C<$@> is now localised during calls to C<binmode> to prevent action at a
3702distance [perl #78844].
05dbc6f8 3703
5076a392 3704=item *
05dbc6f8 3705
5076a392
FC
3706C<PL_isarev>, which is accessible to Perl via C<mro::get_isarev> is now
3707updated properly when packages are deleted or removed from the C<@ISA> of
3708other classes. This allows many packages to be created and deleted without
3709causing a memory leak [perl #75176].
8079ad82 3710
5076a392 3711=item *
4d56cd4f 3712
5076a392
FC
3713C<undef *Foo::> and C<undef *Foo::ISA> and C<delete $package::{ISA}>
3714used not to update the internal isa caches if the
3715stash or C<@ISA> array had a reference elsewhere. In
3716fact, C<undef *Foo::ISA> would stop a new C<@Foo::ISA> array from updating
3717caches.
4d56cd4f 3718
5076a392
FC
3719=item *
3720
3721C<@ISA> arrays can now be shared between classes via
3722C<*Foo::ISA = \@Bar::ISA> or C<*Foo::ISA = *Bar::ISA> [perl #77238].
05dbc6f8 3723
911a3729
FC
3724=item *
3725
5076a392
FC
3726The parser no longer hangs when encountering certain Unicode characters,
3727such as U+387 [perl #74022].
911a3729 3728
5076a392 3729=item *
44691e6f 3730
5076a392
FC
3731C<formline> no longer crashes when passed a tainted format picture. It also
3732taints C<$^A> now if its arguments are tainted [perl #79138].
44691e6f 3733
5076a392 3734=item *
44691e6f 3735
5076a392
FC
3736A signal handler called within a signal handler could cause leaks or
3737double-frees. Now fixed. [perl #76248].
9dc513c5 3738
5076a392
FC
3739=item *
3740
3741When trying to report C<Use of uninitialized value $Foo::BAR>, crashes could
3742occur if the GLOB of the global variable causing the warning has been detached
3743from its original stash by, for example C<delete $::{'Foo::'}>. This has been
3744fixed by disabling the reporting of variable names in the warning in those
3745cases.
9dc513c5
DG
3746
3747=item *
3748
5076a392
FC
3749C<BEGIN {require 5.12.0}> now behaves as documented, rather than behaving
3750identically to C<use 5.12.0;>. Previously, C<require> in a C<BEGIN> block
3751was erroneously executing the C<use feature ':5.12.0'> and
3752C<use strict; use warnings;> behaviour, which only C<use> was documented to
3753provide [perl #69050].
9dc513c5 3754
5076a392 3755=item *
9dc513c5 3756
5076a392
FC
3757C<use 5.42> [perl #69050],
3758C<use 6> and C<no 5> no longer leak memory.
44691e6f 3759
5076a392 3760=item *
6d96b0fe 3761
5076a392 3762C<eval "BEGIN{die}"> no longer leaks memory on non-threaded builds.
6d96b0fe 3763
5076a392 3764=item *
6d96b0fe 3765
5076a392
FC
3766PerlIO no longer crashes when called recursively, e.g., from a signal
3767handler. Now it just leaks memory [perl #75556].
6d96b0fe 3768
5076a392 3769=item *
b7188eb5 3770
5076a392
FC
3771Defining a constant with the same name as one of perl's special blocks
3772(e.g., INIT) stopped working in 5.12.0, but has now been fixed
3773[perl #78634].
b7188eb5 3774
5076a392 3775=item *
b7188eb5 3776
5076a392
FC
3777A reference to a literal value used as a hash key (C<$hash{\"foo"}>) used
3778to be stringified, even if the hash was tied [perl #79178].
44691e6f 3779
5076a392 3780=item *
44691e6f 3781
5076a392
FC
3782A closure containing an C<if> statement followed by a constant or variable
3783is no longer treated as a constant [perl #63540].
44691e6f 3784
5076a392 3785=item *
44691e6f 3786
5076a392
FC
3787Calling a closure prototype (what is passed to an attribute handler for a
3788closure) now results in a "Closure prototype called" error message instead
3789of a crash [perl #68560].
44691e6f 3790
5076a392 3791=item *
b7188eb5 3792
5076a392
FC
3793A regular expression optimisation would sometimes cause a match with a
3794C<{n,m}> quantifier to fail when it should match [perl #79152].
b7188eb5 3795
5076a392 3796=item *
b7188eb5 3797
5076a392
FC
3798What has become known as the "Unicode Bug" is mostly resolved in this release.
3799Under C<use feature 'unicode_strings'>, the internal storage format of a
3800string no longer affects the external semantics. There are two known
3801exceptions. User-defined case changing functions, which are planned to
3802be deprecated in 5.14, require utf8-encoded strings to function; and the
3803character C<LATIN SMALL LETTER SHARP S> in regular expression
3804case-insensitive matching has a somewhat different set of bugs depending
3805on the internal storage format. Case-insensitive matching of all
3806characters that have multi-character matches, as this one does, is
3807problematical in Perl [perl #58182].
b7188eb5 3808
5076a392 3809=item *
44691e6f 3810
5076a392
FC
3811Mentioning a read-only lexical variable from the enclosing scope in a
3812string C<eval> no longer causes the variable to become writable
3813[perl #19135].
6c9cd4a1 3814
5076a392 3815=item *
6c9cd4a1 3816
5076a392
FC
3817C<state> can now be used with attributes. It used to mean the same thing as
3818C<my> if attributes were present [perl #68658].
44691e6f 3819
5076a392 3820=item *
44691e6f 3821
5076a392
FC
3822Expressions like C<< @$a > 3 >> no longer cause C<$a> to be mentioned in
3823the "Use of uninitialized value in numeric gt" warning when C<$a> is
3824undefined (since it is not part of the C<E<gt>> expression, but the operand
3825of the C<@>) [perl #72090].
44691e6f 3826
5076a392 3827=item *
44691e6f 3828
5076a392
FC
3829C<require> no longer causes C<caller> to return the wrong file name for
3830the scope that called C<require> and other scopes higher up that had the
3831same file name [perl #68712].
b7188eb5
FC
3832
3833=item *
3834
5076a392
FC
3835The ref types in the typemap for XS bindings now support magical variables
3836[perl #72684].
b7188eb5 3837
5076a392 3838=item *
b7188eb5 3839
5076a392
FC
3840Match variables (e.g., C<$1>) no longer persist between calls to a sort
3841subroutine [perl #76026].
b7188eb5 3842
5076a392 3843=item *
b7188eb5 3844
5076a392
FC
3845The C<B> module was returning C<B::OP>s instead of C<B::LOGOP>s for C<entertry> [perl #80622].
3846This was due to a bug in the perl core, not in C<B> itself.
b7188eb5 3847
5076a392
FC
3848=item *
3849
3850Some numeric operators were converting integers to floating point,
3851resulting in loss of precision on 64-bit platforms [perl #77456].
b7188eb5
FC
3852
3853=item *
3854
5076a392
FC
3855The fallback behaviour of overloading on binary operators was asymmetric
3856[perl #71286].
3857
3858=item *
3859
3860The handling of Unicode non-characters has changed.
3861Previously they were mostly considered illegal, except that only one of
3862the 66 of them was known about in places. The Unicode standard
3863considers them legal, but forbids the "open interchange" of them.
3864This is part of the change to allow the internal use of any code point
3865(see L</Core Enhancements>). Together, these changes resolve
3866[perl #38722], [perl #51918], [perl #51936], [perl #63446]
3867
3868=item *
3869
3870Sometimes magic (ties, tainted, etc.) attached to variables could cause an
3871object to last longer than it should, or cause a crash if a tied variable
3872were freed from within a tie method. These have been fixed [perl #81230].
3873
3874=item *
3875
3876Most I/O functions were not warning for unopened handles unless the
3877'closed' and 'unopened' warnings categories were both enabled. Now only
3878C<use warnings 'unopened'> is necessary to trigger these warnings (as was
3879always meant to be the case.
3880
3881=item *
3882
3883C<< E<lt>exprE<gt> >> always respects overloading now if the expression is
3884overloaded.
3885
3886Due to the way that 'E<lt>E<gt> as glob' was parsed differently from
3887'E<lt>E<gt> as filehandle' from 5.6 onwards, something like C<< E<lt>$foo[0]E<gt> >> did
3888not handle overloading, even if C<$foo[0]> was an overloaded object. This
3889was contrary to the documentation for overload, and meant that C<< E<lt>E<gt> >>
3890could not be used as a general overloaded iterator operator.
3891
3892=item *
3893
3894Destructors on objects were not called during global destruction on objects
3895that were not referenced by any scalars. This could happen if an array
3896element were blessed (e.g., C<bless \$a[0]>) or if a closure referenced a
3897blessed variable (C<bless \my @a; sub foo { @a }>).
3898
3899Now there is an extra pass during global destruction to fire destructors on
3900any objects that might be left after the usual passes that check for
3901objects referenced by scalars
3902[perl #36347].