This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
point out "corelist --diff" in perldelta
[perl5.git] / pod / perldelta.pod
CommitLineData
44691e6f
AB
1=encoding utf8
2
3=head1 NAME
4
05c8f9ed 5perldelta - what is new for perl v5.16.0
2630d42b 6
05c8f9ed
RS
7=head1 DESCRIPTION
8
9This document describes differences between the 5.14.0 release and
10the 5.16.0 release.
11
12If you are upgrading from an earlier release such as 5.12.0, first read
13L<perl5140delta>, which describes differences between 5.12.0 and
145.14.0.
15
16=head1 Notice
17
18As described in L<perlpolicy>, the release of Perl 5.16.0 marks the
19official end of support for Perl 5.12. Users of Perl 5.12 or earlier
20should consider upgrading to a more recent release of Perl.
21
22=head1 Core Enhancements
23
24=head2 C<use I<VERSION>>
25
26As of this release, version declarations like C<use v5.16> now disable
27all features before enabling the new feature bundle. This means that
28the following holds true:
29
30 use 5.016;
31 # only 5.16 features enabled here
32 use 5.014;
33 # only 5.14 features enabled here (not 5.16)
34
35C<use v5.12> and higher continue to enable strict, but explicit C<use
36strict> and C<no strict> now override the version declaration, even
37when they come first:
38
39 no strict;
40 use 5.012;
41 # no strict here
42
43There is a new ":default" feature bundle that represents the set of
44features enabled before any version declaration or C<use feature> has
45been seen. Version declarations below 5.10 now enable the ":default"
46feature set. This does not actually change the behaviour of C<use
47v5.8>, because features added to the ":default" set are those that were
48traditionally enabled by default, before they could be turned off.
49
50C<< no feature >> now resets to the default feature set. To disable all
51features (which is likely to be a pretty special-purpose request, since
52it presumably won't match any named set of semantics) you can now
53write C<< no feature ':all' >>.
54
55C<$[> is now disabled under C<use v5.16>. It is part of the default
56feature set and can be turned on or off explicitly with C<use feature
57'array_base'>.
58
59=head2 C<__SUB__>
60
61The new C<__SUB__> token, available under the C<current_sub> feature
62(see L<feature>) or C<use v5.16>, returns a reference to the current
63subroutine, making it easier to write recursive closures.
64
65=head2 New and Improved Built-ins
66
67=head3 More consistent C<eval>
68
69The C<eval> operator sometimes treats a string argument as a sequence of
70characters and sometimes as a sequence of bytes, depending on the
71internal encoding. The internal encoding is not supposed to make any
72difference, but there is code that relies on this inconsistency.
73
74The new C<unicode_eval> and C<evalbytes> features (enabled under C<use
755.16.0>) resolve this. The C<unicode_eval> feature causes C<eval
76$string> to treat the string always as Unicode. The C<evalbytes>
77features provides a function, itself called C<evalbytes>, which
78evaluates its argument always as a string of bytes.
79
80These features also fix oddities with source filters leaking to outer
81dynamic scopes.
82
83See L<feature> for more detail.
84
85=head3 C<substr> lvalue revamp
86
87=for comment Does this belong here, or under Incomptable Changes?
88
89When C<substr> is called in lvalue or potential lvalue context with two
90or three arguments, a special lvalue scalar is returned that modifies
91the original string (the first argument) when assigned to.
92
93Previously, the offsets (the second and third arguments) passed to
94C<substr> would be converted immediately to match the string, negative
95offsets being translated to positive and offsets beyond the end of the
96string being truncated.
97
98Now, the offsets are recorded without modification in the special
99lvalue scalar that is returned, and the original string is not even
100looked at by C<substr> itself, but only when the returned lvalue is
101read or modified.
102
103These changes result in an incompatible change:
104
105If the original string changes length after the call to C<substr> but
106before assignment to its return value, negative offsets will remember
107their position from the end of the string, affecting code like this:
108
109 my $string = "string";
110 my $lvalue = \substr $string, -4, 2;
111 print $lvalue, "\n"; # prints "ri"
112 $string = "bailing twine";
113 print $lvalue, "\n"; # prints "wi"; used to print "il"
114
115The same thing happens with an omitted third argument. The returned
116lvalue will always extend to the end of the string, even if the string
117becomes longer.
118
119Since this change also allowed many bugs to be fixed (see
120L</The C<substr> operator>), and since the behaviour
121of negative offsets has never been specified, so the
122change was deemed acceptable.
123
124=head3 Return value of C<tied>
125
126The value returned by C<tied> on a tied variable is now the actual
127scalar that holds the object to which the variable is tied. This
128allows ties to be weakened with C<Scalar::Util::weaken(tied
129$tied_variable)>.
130
131=head2 Unicode Support
132
133=head3 Supports (I<almost>) Unicode 6.1
134
135Besides the addition of whole new scripts, and new characters in
136existing scripts, this new version of Unicode, as always, makes some
137changes to existing characters. One change that may trip up some
138applications is that the General Category of two characters in the
139Latin-1 range, PILCROW SIGN and SECTION SIGN, has been changed from
140Other_Symbol to Other_Punctuation. The same change has been made for
141a character in each of Tibetan, Ethiopic, and Aegean.
142The code points U+3248..U+324F (CIRCLED NUMBER TEN ON BLACK SQUARE
143through CIRCLED NUMBER EIGHTY ON BLACK SQUARE) have had their General
144Category changed from Other_Symbol to Other_Numeric. The Line Break
145property has changes for Hebrew and Japanese; and as a consequence of
146other changes in 6.1, the Perl regular expression construct C<\X> now
147works differently for some characters in Thai and Lao.
148
149New aliases (synonyms) have been defined for many property values;
150these, along with the previously existing ones, are all cross-indexed in
151L<perluniprops>.
152
153The return value of C<charnames::viacode()> is affected by other
154changes:
155
156 Code point Old Name New Name
157 U+000A LINE FEED (LF) LINE FEED
158 U+000C FORM FEED (FF) FORM FEED
159 U+000D CARRIAGE RETURN (CR) CARRIAGE RETURN
160 U+0085 NEXT LINE (NEL) NEXT LINE
161 U+008E SINGLE-SHIFT 2 SINGLE-SHIFT-2
162 U+008F SINGLE-SHIFT 3 SINGLE-SHIFT-3
163 U+0091 PRIVATE USE 1 PRIVATE USE-1
164 U+0092 PRIVATE USE 2 PRIVATE USE-2
165 U+2118 SCRIPT CAPITAL P WEIERSTRASS ELLIPTIC FUNCTION
166
167Perl will accept any of these names as input, but
168C<charnames::viacode()> now returns the new name of each pair. The
169change for U+2118 is considered by Unicode to be a correction, that is
170the original name was a mistake (but again, it will remain forever valid
171to use it to refer to U+2118). But most of these changes are the
172fallout of the mistake Unicode 6.0 made in naming a character used in
173Japanese cell phones to be "BELL", which conflicts with the longstanding
174industry use of (and Unicode's recommendation to use) that name
175to mean the ASCII control character at U+0007. As a result, that name
176has been deprecated in Perl since v5.14; and any use of it will raise a
177warning message (unless turned off). The name "ALERT" is now the
178preferred name for this code point, with "BEL" being an acceptable short
179form. The name for the new cell phone character, at code point U+1F514,
180remains undefined in this version of Perl (hence we don't quite
181implement all of Unicode 6.1), but starting in v5.18, BELL will mean
182this character, and not U+0007.
183
184Unicode has taken steps to make sure that this sort of mistake does not
185happen again. The Standard now includes all the generally accepted
186names and abbreviations for control characters, whereas previously it
187didn't (though there were recommended names for most of them, which Perl
188used). This means that most of those recommended names are now
189officially in the Standard. Unicode did not recommend names for the
190four code points listed above between U+008E and U+008F, and in
191standardizing them Unicode subtly changed the names that Perl had
192previously given them, by replacing the final blank in each name by a
193hyphen. Unicode also officially accepts names that Perl had deprecated,
194such as FILE SEPARATOR. Now the only deprecated name is BELL.
195Finally, Perl now uses the new official names instead of the old
196(now considered obsolete) names for the first four code points in the
197list above (the ones which have the parentheses in them).
198
199Now that the names have been placed in the Unicode standard, these kinds
200of changes should not happen again, though corrections, such as to
201U+2118, are still possible.
202
203Unicode also added some name abbreviations, which Perl now accepts:
204SP for SPACE;
205TAB for CHARACTER TABULATION;
206NEW LINE, END OF LINE, NL, and EOL for LINE FEED;
207LOCKING-SHIFT ONE for SHIFT OUT;
208LOCKING-SHIFT ZERO for SHIFT IN;
209and ZWNBSP for ZERO WIDTH NO-BREAK SPACE.
210
211More details on this version of Unicode are provided in
212L<http://www.unicode.org/versions/Unicode6.1.0/>.
213
214=head3 C<use charnames> is no longer needed for C<\N{I<name>}>
215
216When C<\N{I<name>}> is encountered, the C<charnames> module is now
217automatically loaded when needed as if the C<:full> and C<:short>
218options had been specified. See L<charnames> for more information.
219
220=head3 C<\N{...}> can now have Unicode loose name matching
221
222This is described in the C<charnames> item in
223L</Updated Modules and Pragmata> below.
224
225=head3 Unicode Symbol Names
226
227Perl now has proper support for Unicode in symbol names. It used to be
228that C<*{$foo}> would ignore the internal UTF8 flag and use the bytes of
229the underlying representation to look up the symbol. That meant that
230C<*{"\x{100}"}> and C<*{"\xc4\x80"}> would return the same thing. All
231these parts of Perl have been fixed to account for Unicode:
232
233=over
234
235=item *
236
237Method names (including those passed to C<use overload>)
238
239=item *
240
241Typeglob names (including names of variables, subroutines and filehandles)
242
243=item *
244
245Package names
246
247=item *
248
249C<goto>
250
251=item *
252
253Symbolic dereferencing
254
255=item *
256
257Second argument to C<bless()> and C<tie()>
258
259=item *
260
261Return value of C<ref()>
262
263=item *
264
265Subroutine prototypes
266
267=item *
268
269Attributes
270
271=item *
272
273Various warnings and error messages that mention variable names or values,
274methods, etc.
275
276=back
277
278In addition, a parsing bug has been fixed that prevented C<*{é}> from
279implicitly quoting the name, but instead interpreted it as C<*{+é}>, which
280would cause a strict violation.
281
282C<*{"*a::b"}> automatically strips off the * if it is followed by an ASCII
283letter. That has been extended to all Unicode identifier characters.
284
285One-character non-ASCII non-punctuation variables (like C<$é>) are now
286subject to "Used only once" warnings. They used to be exempt, as they
287was treated as punctuation variables.
288
289Also, single-character Unicode punctuation variables (like C<$‰>) are now
290supported [perl #69032].
291
292=head3 Improved ability to mix locales and Unicode, including UTF-8 locales
293
294An optional parameter has been added to C<use locale>
295
296 use locale ':not_characters';
297
298which tells Perl to use all but the C<LC_CTYPE> and C<LC_COLLATE>
299portions of the current locale. Instead, the character set is assumed
300to be Unicode. This allows locales and Unicode to be seamlessly mixed,
301including the increasingly frequent UTF-8 locales. When using this
302hybrid form of locales, the C<:locale> layer to the L<open> pragma can
303be used to interface with the file system, and there are CPAN modules
304available for ARGV and environment variable conversions.
305
306Full details are in L<perllocale>.
307
308=head3 New function C<fc> and corresponding escape sequence C<\F> for Unicode foldcase
309
310Unicode foldcase is an extension to lowercase that gives better results
311when comparing two strings case-insensitively. It has long been used
312internally in regular expression C</i> matching. Now it is available
313explicitly through the new C<fc> function call (enabled by
314S<C<"use feature 'fc'">>, or C<use v5.16>, or explicitly callable via
315C<CORE::fc>) or through the new C<\F> sequence in double-quotish
316strings.
317
318Full details are in L<perlfunc/fc>.
319
320=head3 The Unicode C<Script_Extensions> property is now supported.
321
322New in Unicode 6.0, this is an improved C<Script> property. Details
323are in L<perlunicode/Scripts>.
324
325=head2 XS Changes
326
327=head3 Improved typemaps for Some Builtin Types
328
329Most XS authors will be aware that there is a longstanding bug in the
330OUTPUT typemap for T_AVREF (C<AV*>), T_HVREF (C<HV*>), T_CVREF (C<CV*>),
331and T_SVREF (C<SVREF> or C<\$foo>) that requires manually decrementing
332the reference count of the return value instead of the typemap taking
333care of this. For backwards-compatibility, this cannot be changed in the
334default typemaps. But we now provide additional typemaps
335C<T_AVREF_REFCOUNT_FIXED>, etc. that do not exhibit this bug. Using
336them in your extension is as simple as having one line in your
337C<TYPEMAP> section:
338
339 HV* T_HVREF_REFCOUNT_FIXED
340
341=head3 C<is_utf8_char()>
342
343The XS-callable function C<is_utf8_char()>, when presented with
344malformed UTF-8 input, can read up to 12 bytes beyond the end of the
345string. This cannot be fixed without changing its API. It is not
346called from CPAN. The documentation now describes how to use it
347safely.
348
349=head3 Added C<is_utf8_char_buf()>
350
351This function is designed to replace the deprecated L</is_utf8_char()>
352function. It includes an extra parameter to make sure it doesn't read
353past the end of the input buffer.
354
355=head3 Other C<is_utf8_foo()> functions, as well as C<utf8_to_foo()>, etc.
356
357Most of the other XS-callable functions that take UTF-8 encoded input
358implicitly assume that the UTF-8 is valid (not malformed) in regards to
359buffer length. Do not do things such as change a character's case or
360see if it is alphanumeric without first being sure that it is valid
361UTF-8. This can be safely done for a whole string by using one of the
362functions C<is_utf8_string()>, C<is_utf8_string_loc()>, and
363C<is_utf8_string_loclen()>.
364
365=head3 New Pad API
366
367Many new functions have been added to the API for manipulating lexical
368pads. See L<perlapi/Pad Data Structures> for more information.
369
370=head2 Changes to Special Variables
371
372=head3 C<$$> can be assigned to
373
374C<$$> was made read-only in Perl 5.8.0. But only sometimes: C<local $$>
375would make it writable again. Some CPAN modules were using C<local $$> or
376XS code to bypass the read-only check, so there is no reason to keep C<$$>
377read-only. (This change also allowed a bug to be fixed while maintaining
378backward compatibility.)
379
380=head3 C<$^X> converted to an absolute path on FreeBSD, OS X and Solaris
381
382C<$^X> is now converted to an absolute path on OS X, FreeBSD (without
383needing F</proc> mounted) and Solaris 10 and 11. This augments the
384previous approach of using F</proc> on Linux, FreeBSD and NetBSD
385(in all cases, where mounted).
386
387This makes relocatable perl installations more useful on these platforms.
388(See "Relocatable @INC" in F<INSTALL>)
389
390=head2 Debugger Changes
391
392=head3 Features inside the debugger
393
394The current Perl's L<feature> bundle is now enabled for commands entered
395in the interactive debugger.
396
397=head3 New option for the debugger's B<t> command
398
399The B<t> command in the debugger, which toggles tracing mode, now
400accepts a numeric argument that determines how many levels of subroutine
401calls to trace.
402
403=head3 C<enable> and C<disable>
404
405The debugger now has C<disable> and C<enable> commands for disabling
406existing breakpoints and re-enabling them. See L<perldebug>.
407
408=head3 Breakpoints with file names
409
410The debugger's "b" command for setting breakpoints now allows a line
411number to be prefixed with a file name. See
412L<perldebug/"b [file]:[line] [condition]">.
413
414=head2 The C<CORE> Namespace
415
416=head3 The C<CORE::> prefix
417
418The C<CORE::> prefix can now be used on keywords enabled by
419L<feature.pm|feature>, even outside the scope of C<use feature>.
420
421=head3 Subroutines in the C<CORE> namespace
422
423Many Perl keywords are now available as subroutines in the CORE namespace.
424This allows them to be aliased:
425
426 BEGIN { *entangle = \&CORE::tie }
427 entangle $variable, $package, @args;
428
429And for prototypes to be bypassed:
430
431 sub mytie(\[%$*@]$@) {
432 my ($ref, $pack, @args) = @_;
433 ... do something ...
434 goto &CORE::tie;
435 }
436
437Some of these cannot be called through references or via C<&foo> syntax,
438but must be called as barewords.
439
440See L<CORE> for details.
441
442=head2 Other Changes
443
444=head3 Anonymous handles
445
446Automatically generated file handles are now named __ANONIO__ when the
447variable name cannot be determined, rather than $__ANONIO__.
448
449=head3 Autoloaded sort Subroutines
450
451Custom sort subroutines can now be autoloaded [perl #30661]:
452
453 sub AUTOLOAD { ... }
454 @sorted = sort foo @list; # uses AUTOLOAD
455
456=head3 C<continue> no longer requires the "switch" feature
457
458The C<continue> keyword has two meanings. It can introduce a C<continue>
459block after a loop, or it can exit the current C<when> block. Up till now,
460the latter meaning was only valid with the "switch" feature enabled, and
461was a syntax error otherwise. Since the main purpose of feature.pm is to
462avoid conflicts with user-defined subroutines, there is no reason for
463C<continue> to depend on it.
464
465=head3 DTrace probes for interpreter phase change
466
467The C<phase-change> probes will fire when the interpreter's phase
468changes, which tracks the C<${^GLOBAL_PHASE}> variable. C<arg0> is
469the new phase name; C<arg1> is the old one. This is useful mostly
470for limiting your instrumentation to one or more of: compile time,
471run time, destruct time.
472
473=head3 C<__FILE__()> Syntax
474
475The C<__FILE__>, C<__LINE__> and C<__PACKAGE__> tokens can now be written
476with an empty pair of parentheses after them. This makes them parse the
477same way as C<time>, C<fork> and other built-in functions.
478
479=head3 The C<\$> prototype accepts any scalar lvalue
480
481The C<\$> and C<\[$]> subroutine prototypes now accept any scalar lvalue
482argument. Previously they only accepted scalars beginning with C<$> and
483hash and array elements. This change makes them consistent with the way
484the built-in C<read> and C<recv> functions (among others) parse their
485arguments. This means that one can override the built-in functions with
486custom subroutines that parse their arguments the same way.
487
488=head3 C<_> in subroutine prototypes
489
490The C<_> character in subroutine prototypes is now allowed before C<@> or
491C<%>.
492
493=head1 Security
494
495=head2 Use C<is_utf8_char_buf()> and not C<is_utf8_char()>
496
497The latter function is now deprecated because its API is insufficient to
498guarantee that it doesn't read (up to 12 bytes in the worst case) beyond
499the end of its input string. See
500L<is_utf8_char_buf()|/Added is_utf8_char_buf()>.
501
502=head2 Malformed UTF-8 input could cause attempts to read beyond the end of the buffer
503
504Two new XS-accessible functions, C<utf8_to_uvchr_buf()> and
505C<utf8_to_uvuni_buf()> are now available to prevent this, and the Perl
506core has been converted to use them.
507See L</Internal Changes>.
508
509=head2 C<File::Glob::bsd_glob()> memory error with GLOB_ALTDIRFUNC (CVE-2011-2728).
510
511Calling C<File::Glob::bsd_glob> with the unsupported flag
512GLOB_ALTDIRFUNC would cause an access violation / segfault. A Perl
513program that accepts a flags value from an external source could expose
514itself to denial of service or arbitrary code execution attacks. There
515are no known exploits in the wild. The problem has been corrected by
516explicitly disabling all unsupported flags and setting unused function
517pointers to null. Bug reported by Clément Lecigne.
518
519=head2 Privileges are now set correctly when assigning to C<$(>
520
521A hypothetical bug (probably non-exploitable in practice) due to the
522incorrect setting of the effective group ID while setting C<$(> has been
523fixed. The bug would only have affected systems that have C<setresgid()>
524but not C<setregid()>, but no such systems are known of.
525
526=head1 Deprecations
527
528=head2 Don't read the Unicode data base files in F<lib/unicore>
529
530It is now deprecated to directly read the Unicode data base files.
531These are stored in the F<lib/unicore> directory. Instead, you should
532use the new functions in L<Unicode::UCD>. These provide a stable API,
533and give complete information.
534
535Perl may at some point in the future change or remove the files. The
536file most likely for applications to have used is
537F<lib/unicore/ToDigit.pl>. L<Unicode::UCD/prop_invmap()> can be used to
538get at its data instead.
539
540=head2 XS functions C<is_utf8_char()>, C<utf8_to_uvchr()> and
541C<utf8_to_uvuni()>
542
543This function is deprecated because it could read beyond the end of the
544input string. Use the new L<is_utf8_char_buf()|/Added is_utf8_char_buf()>,
545C<utf8_to_uvchr_buf()> and C<utf8_to_uvuni_buf()> instead.
546
547=head1 Future Deprecations
548
549This section serves as a notice of features that are I<likely> to be
550removed or L<deprecated|perlpolicy/deprecated> in the next release of
551perl (5.18.0). If your code depends on these features, you should
552contact the Perl 5 Porters via the L<mailing
553list|http://lists.perl.org/list/perl5-porters.html> or L<perlbug> to
554explain your use case and inform the deprecation process.
555
556=head2 Core Modules
557
558These modules may be marked as deprecated I<from the core>. This only
559means that they will no longer be installed by default with the core
560distribution, but will remain available on the CPAN.
561
562=over
563
564=item *
565
566CPANPLUS
567
568=item *
569
570Filter::Simple
571
572=item *
573
574PerlIO::mmap
575
576=item *
577
578Pod::Parser, Pod::LaTeX
579
580=item *
581
582SelfLoader
583
584=item *
585
586Text::Soundex
587
588=item *
589
590Thread.pm
591
592=back
593
594=head2 Platforms with no supporting programmers:
595
596These platforms will probably have their
597special build support removed during the
5985.17.0 development series.
599
600=over
601
602=item *
603
604BeOS
605
606=item *
607
608djgpp
609
610=item *
611
612dgux
613
614=item *
615
616EPOC
617
618=item *
619
620MPE/iX
621
622=item *
623
624Rhapsody
625
626=item *
627
628UTS
629
630=item *
631
632VM/ESA
633
634=back
635
636=head2 Other Future Deprecations
637
638=over
639
640=item *
641
642Swapping of $< and $>
643
644For more information about this future deprecation, see L<the relevant RT
645ticket|https://rt.perl.org/rt3/Ticket/Display.html?id=96212>.
646
647=item *
648
649sfio, stdio
650
e57f4500
LT
651Perl supports being built without PerlIO proper, using a stdio or sfio
652wrapper instead. A perl build like this will not support IO layers and
653thus Unicode IO, making it rather handicapped.
654
655PerlIO supports a C<stdio> layer if stdio use is desired, and similarly a
656sfio layer could be produced.
657
05c8f9ed
RS
658=item *
659
660Unescaped literal C<< "{" >> in regular expressions.
661
662It is planned starting in v5.20 to require a literal C<"{"> to be
663escaped by, for example, preceding it with a backslash. In v5.18, a
664deprecated warning message will be emitted for all such uses. Note that
665this only affects patterns which are to match a literal C<"{">. Other
666uses of this character, such as part of a quantifier or sequence like in
667the ones below are completely unaffected:
668
669 /foo{3,5}/
670 /\p{Alphabetic}/
671 /\N{DIGIT ZERO}
672
673The removal of this will allow extensions to pattern syntax, and better
674error checking of existing syntax. See L<perlre/Quantifiers> for an
675example.
676
677=back
678
679=head1 Incompatible Changes
680
681=head2 Special blocks called in void context
682
683Special blocks (C<BEGIN>, C<CHECK>, C<INIT>, C<UNITCHECK>, C<END>) are now
684called in void context. This avoids wasteful copying of the result of the
685last statement [perl #108794].
686
687=head2 The C<overloading> pragma and regexp objects
688
689With C<no overloading>, regular expression objects returned by C<qr//> are
690now stringified as "Regexp=REGEXP(0xbe600d)" instead of the regular
691expression itself [perl #108780].
692
693=head2 Two XS typemap Entries removed
694
695Two presumably unused XS typemap entries have been removed from the
696core typemap: T_DATAUNIT and T_CALLBACK. If you are, against all odds,
697a user of these, please see the instructions on how to regain them
698in L<perlxstypemap>.
699
700=head2 Unicode 6.1 has incompatibilities with Unicode 6.0
701
702These are detailed in L</Supports (almost) Unicode 6.1> above.
703You can compile this version of Perl to use Unicode 6.0. See
704L<perlunicode/Hacking Perl to work on earlier Unicode versions (for very serious hackers only)>.
705
706=head2 Borland compiler
707
708All support for the Borland compiler has been dropped. The code had not
709worked for a long time anyway.
710
711=head2 Certain deprecated Unicode properties are no longer supported by default
712
713Perl should never have exposed certain Unicode properties that are used
714by Unicode internally and not meant to be publicly available. Use of
715these has generated deprecated warning messages since Perl 5.12. The
716removed properties are Other_Alphabetic,
717Other_Default_Ignorable_Code_Point, Other_Grapheme_Extend,
718Other_ID_Continue, Other_ID_Start, Other_Lowercase, Other_Math, and
719Other_Uppercase.
720
721Perl may be recompiled to include any or all of them; instructions are
722given in
723L<perluniprops/Unicode character properties that are NOT accepted by Perl>.
724
725=head2 Dereferencing IO thingies as typeglobs
726
727The C<*{...}> operator, when passed a reference to an IO thingy (as in
728C<*{*STDIN{IO}}>), creates a new typeglob containing just that IO object.
729Previously, it would stringify as an empty string, but some operators would
730treat it as undefined, producing an "uninitialized" warning.
731Now it stringifies as __ANONIO__ [perl #96326].
732
733=head2 User-defined case-changing operations
734
735This feature was deprecated in Perl 5.14, and has now been removed.
736The CPAN module L<Unicode::Casing> provides better functionality without
737the drawbacks that this feature had, as are detailed in the 5.14
738documentation:
739L<http://perldoc.perl.org/5.14.0/perlunicode.html#User-Defined-Case-Mappings-%28for-serious-hackers-only%29>
740
741=head2 XSUBs are now 'static'
742
743XSUB C functions are now 'static', that is, they are not visible from
744outside the compilation unit. Users can use the new C<XS_EXTERNAL(name)>
745and C<XS_INTERNAL(name)> macros to pick the desired linking behaviour.
746The ordinary C<XS(name)> declaration for XSUBs will continue to declare
747non-'static' XSUBs for compatibility, but the XS compiler,
748C<ExtUtils::ParseXS> (C<xsubpp>) will emit 'static' XSUBs by default.
749C<ExtUtils::ParseXS>'s behaviour can be reconfigured from XS using the
750C<EXPORT_XSUB_SYMBOLS> keyword. See L<perlxs> for details.
751
752=head2 Weakening read-only references
753
754Weakening read-only references is no longer permitted. It should never
755have worked anyway, and in some cases could result in crashes.
756
757=head2 Tying scalars that hold typeglobs
758
759Attempting to tie a scalar after a typeglob was assigned to it would
760instead tie the handle in the typeglob's IO slot. This meant that it was
761impossible to tie the scalar itself. Similar problems affected C<tied> and
762C<untie>: C<tied $scalar> would return false on a tied scalar if the last
763thing returned was a typeglob, and C<untie $scalar> on such a tied scalar
764would do nothing.
765
766We fixed this problem before Perl 5.14.0, but it caused problems with some
767CPAN modules, so we put in a deprecation cycle instead.
768
769Now the deprecation has been removed and this bug has been fixed. So
770C<tie $scalar> will always tie the scalar, not the handle it holds. To tie
771the handle, use C<tie *$scalar> (with an explicit asterisk). The same
772applies to C<tied *$scalar> and C<untie *$scalar>.
773
774=head2 IPC::Open3 no longer provides C<xfork()>, C<xclose_on_exec()>
775and C<xpipe_anon()>
776
777All three functions were private, undocumented and unexported. They do
778not appear to be used by any code on CPAN. Two have been inlined and one
779deleted entirely.
780
781=head2 C<$$> no longer caches PID
782
783Previously, if one called fork(3) from C, Perl's
784notion of C<$$> could go out of sync with what getpid() returns. By always
785fetching the value of C<$$> via getpid(), this potential bug is eliminated.
786Code that depends on the caching behavior will break. As described in
787L<Core Enhancements|/C<$$> can be assigned to>,
788C<$$> is now writable, but it will be reset during a
789fork.
790
791=head2 C<$$> and C<getppid()> no longer emulate POSIX semantics under LinuxThreads
792
793The POSIX emulation of C<$$> and C<getppid()> under the obsolete
794LinuxThreads implementation has been removed.
795This only impacts users of Linux 2.4 and
796users of Debian GNU/kFreeBSD up to and including 6.0, not the vast
797majority of Linux installations that use NPTL threads.
798
799This means that C<getppid()>, like C<$$>, is now always guaranteed to
800return the OS's idea of the current state of the process, not perl's
801cached version of it.
802
803See the documentation for L<$$|perlvar/$$> for details.
804
805=head2 C<< $< >>, C<< $> >>, C<$(> and C<$)> are no longer cached
806
807Similarly to the changes to C<$$> and C<getppid()>, the internal
808caching of C<< $< >>, C<< $> >>, C<$(> and C<$)> has been removed.
809
810When we cached these values our idea of what they were would drift out
811of sync with reality if someone (e.g., someone embedding perl) called
812C<sete?[ug]id()> without updating C<PL_e?[ug]id>. Having to deal with
813this complexity wasn't worth it given how cheap the C<gete?[ug]id()>
814system call is.
815
816This change will break a handful of CPAN modules that use the XS-level
817C<PL_uid>, C<PL_gid>, C<PL_euid> or C<PL_egid> variables.
818
819The fix for those breakages is to use C<PerlProc_gete?[ug]id()> to
820retrieve them (e.g. C<PerlProc_getuid()>), and not to assign to
821C<PL_e?[ug]id> if you change the UID/GID/EUID/EGID. There is no longer
822any need to do so since perl will always retrieve the up-to-date
823version of those values from the OS.
824
825=head2 Which Non-ASCII characters get quoted by C<quotemeta> and C<\Q> has changed
826
827This is unlikely to result in a real problem, as Perl does not attach
828special meaning to any non-ASCII character, so it is currently
829irrelevant which are quoted or not. This change fixes bug [perl #77654] and
830bring Perl's behavior more into line with Unicode's recommendations.
831See L<perlfunc/quotemeta>.
832
833=head1 Performance Enhancements
834
835=over
836
837=item *
838
839Improved performance for Unicode properties in regular expressions
840
841=for comment Can this be compacted some? -- rjbs, 2012-02-20
842
843Matching a code point against a Unicode property is now done via a
844binary search instead of linear. This means for example that the worst
845case for a 1000 item property is 10 probes instead of 1000. This
846inefficiency has been compensated for in the past by permanently storing
847in a hash the results of a given probe plus the results for the adjacent
84864 code points, under the theory that near-by code points are likely to
849be searched for. A separate hash was used for each mention of a Unicode
850property in each regular expression. Thus, C<qr/\p{foo}abc\p{foo}/>
851would generate two hashes. Any probes in one instance would be unknown
852to the other, and the hashes could expand separately to be quite large
853if the regular expression were used on many different widely-separated
854code points. This can lead to running out of memory in extreme cases.
855Now, however, there is just one hash shared by all instances of a given
856property. This means that if C<\p{foo}> is matched against "A" in one
857regular expression in a thread, the result will be known immediately to
858all regular expressions, and the relentless march of using up memory is
859slowed considerably.
860
861=item *
862
863Version declarations with the C<use> keyword (e.g., C<use 5.012>) are now
864faster, as they enable features without loading F<feature.pm>.
865
866=item *
867
868C<local $_> is faster now, as it no longer iterates through magic that it
869is not going to copy anyway.
870
871=item *
872
873Perl 5.12.0 sped up the destruction of objects whose classes define
874empty C<DESTROY> methods (to prevent autoloading), by simply not
875calling such empty methods. This release takes this optimisation a
876step further, by not calling any C<DESTROY> method that begins with a
877C<return> statement. This can be useful for destructors that are only
878used for debugging:
879
880 use constant DEBUG => 1;
881 sub DESTROY { return unless DEBUG; ... }
882
883Constant-folding will reduce the first statement to C<return;> if DEBUG
884is set to 0, triggering this optimisation.
885
886=item *
887
888Assigning to a variable that holds a typeglob or copy-on-write scalar
889is now much faster. Previously the typeglob would be stringified or
890the copy-on-write scalar would be copied before being clobbered.
891
892=item *
893
894Assignment to C<substr> in void context is now more than twice its
895previous speed. Instead of creating and returning a special lvalue
896scalar that is then assigned to, C<substr> modifies the original string
897itself.
898
899=item *
900
901C<substr> no longer calculates a value to return when called in void
902context.
903
904=item *
905
906Due to changes in L<File::Glob>, Perl's C<glob> function and its C<<
907<...> >> equivalent are now much faster. The splitting of the pattern
908into words has been rewritten in C, resulting in speed-ups of 20% in
909some cases.
910
911This does not affect C<glob> on VMS, as it does not use File::Glob.
912
913=item *
914
915The short-circuiting operators C<&&>, C<||>, and C<//>, when chained
916(such as C<$a || $b || $c>), are now considerably faster to short-circuit,
917due to reduced optree traversal.
918
919=item *
920
921The implementation of C<s///r> makes one fewer copy of the scalar's value.
922
923=item *
924
925C<study> is now a no-op.
926
927=item *
928
929Recursive calls to lvalue subroutines in lvalue scalar context use less
930memory.
931
932=back
933
934=head1 Modules and Pragmata
935
936=head2 Deprecated Modules
937
938=over
939
940=item L<Version::Requirements>
941
942Version::Requirements is now DEPRECATED, use L<CPAN::Meta::Requirements>,
943which is a drop-in replacement. It will be deleted from perl.git blead
944in v5.17.0.
945
946=back
947
948=head2 New Modules and Pragmata
949
950=over 4
951
952=item *
953
954L<arybase> -- this new module implements the C<$[> variable.
955
956=item *
957
958C<PerlIO::mmap> 0.010 has been added to the Perl core.
959
960The C<mmap> PerlIO layer is no longer implemented by perl itself, but has
961been moved out into the new L<PerlIO::mmap> module.
962
963=back
964
965=head2 Updated Modules and Pragmata
966
b7f87eaf
RS
967This is only an overview of selected module updates. For a complete list of
968updates, run:
969
970 $ corelist --diff 5.14.0 5.16.0
971
972You can substitute your favorite version in place of 5.14.0, too.
973
05c8f9ed
RS
974=over 4
975
976=item *
977
978L<XXX> has been upgraded from version 0.69 to version 0.70.
979
980=back
981
982=head2 Removed Modules and Pragmata
983
984As promised in Perl 5.14.0's release notes, the following modules have
985been removed from the core distribution, and if needed should be installed
986from CPAN instead.
987
988=over
989
990=item *
991
992C<Devel::DProf> has been removed from the Perl core. Prior version was
99320110228.00.
994
995=item *
996
997C<Shell> has been removed from the Perl core. Prior version was 0.72_01.
998
999=back
1000
1001=head1 Documentation
1002
1003=head2 New Documentation
1004
1005=head3 L<perldtrace>
1006
1007L<perldtrace> describes Perl's DTrace support, listing the provided probes
1008and gives examples of their use.
1009
1010=head3 L<perlexperiment>
1011
1012This document is intended to provide a list of experimental features in
1013Perl. It is still a work in progress.
1014
1015=head3 L<perlootut>
1016
1017This a new OO tutorial. It focuses on basic OO concepts, and then recommends
1018that readers choose an OO framework from CPAN.
1019
1020=head3 L<perlxstypemap>
1021
1022The new manual describes the XS typemapping mechanism in unprecedented
1023detail and combines new documentation with information extracted from
1024L<perlxs> and the previously unofficial list of all core typemaps.
1025
1026=head2 Changes to Existing Documentation
1027
1028=head3 L<perlapi>
1029
1030=over 4
1031
1032=item *
1033
1034The HV API has long accepted negative lengths to indicate that the key is
1035in UTF8. Now this is documented.
1036
1037=item *
1038
1039The C<boolSV()> macro is now documented.
1040
1041=back
1042
1043=head3 L<perlfunc>
1044
1045=over 4
1046
1047=item *
1048
1049C<dbmopen> treats a 0 mode as a special case, that prevents a nonexistent
1050file from being created. This has been the case since Perl 5.000, but was
1051never documented anywhere. Now the perlfunc entry mentions it
1052[perl #90064].
1053
1054=item *
1055
1056As an accident of history, C<open $fh, "<:", ...> applies the default
1057layers for the platform (C<:raw> on Unix, C<:crlf> on Windows), ignoring
1058whatever is declared by L<open.pm|open>. This seems such a useful feature
1059it has been documented in L<perlfunc|perlfunc/open> and L<open>.
1060
1061=item *
1062
1063The entry for C<split> has been rewritten. It is now far clearer than
1064before.
1065
1066=back
1067
1068=head3 L<perlguts>
1069
1070=over 4
1071
1072=item *
1073
1074A new section, L<Autoloading with XSUBs|perlguts/Autoloading with XSUBs>,
1075has been added, which explains the two APIs for accessing the name of the
1076autoloaded sub.
1077
1078=item *
1079
1080Some of the function descriptions in L<perlguts> were confusing, as it was
1081not clear whether they referred to the function above or below the
1082description. This has been clarified [perl #91790].
1083
1084=back
1085
1086=head3 L<perlobj>
1087
1088=over 4
1089
1090=item *
1091
1092This document has been rewritten from scratch, and its coverage of various OO
1093concepts has been expanded.
1094
1095=back
1096
1097=head3 L<perlop>
1098
1099=over 4
1100
1101=item *
1102
1103Documentation of the smartmatch operator has been reworked and moved from
1104perlsyn to perlop where it belongs.
1105
1106It has also been corrected for the case of C<undef> on the left-hand
1107side. The list of different smart match behaviours had an item in the
1108wrong place.
1109
1110=item *
1111
1112Documentation of the ellipsis statement (C<...>) has been reworked and
1113moved from perlop to perlsyn.
1114
1115=item *
1116
1117The explanation of bitwise operators has been expanded to explain how they
1118work on Unicode strings (5.14.1).
1119
1120=item *
1121
1122More examples for C<m//g> have been added (5.14.1).
1123
1124=item *
1125
1126The C<<< <<\FOO >>> here-doc syntax has been documented (5.14.1).
1127
1128=back
1129
1130=head3 L<perlpragma>
1131
1132=over 4
1133
1134=item *
1135
1136There is now a standard convention for naming keys in the C<%^H>,
1137documented under L<Key naming|perlpragma/Key naming>.
1138
1139=back
1140
1141=head3 L<perlsec/Laundering and Detecting Tainted Data>
1142
1143=over 4
1144
1145=item *
1146
1147The example function for checking for taintedness contained a subtle
1148error. C<$@> needs to be localized to prevent its changing this
1149global's value outside the function. The preferred method to check for
1150this remains L<Scalar::Util/tainted>.
1151
1152=back
1153
1154=head3 L<perllol>
1155
1156=over
1157
1158=item *
1159
1160L<perllol> has been expanded with examples using the new C<push $scalar>
1161syntax introduced in Perl 5.14.0 (5.14.1).
1162
1163=back
1164
1165=head3 L<perlmod>
1166
1167=over
1168
1169=item *
1170
1171L<perlmod> now states explicitly that some types of explicit symbol table
1172manipulation are not supported. This codifies what was effectively already
1173the case [perl #78074].
1174
1175=back
1176
1177=head3 L<perlpodstyle>
1178
1179=over 4
1180
1181=item *
1182
1183The tips on which formatting codes to use have been corrected and greatly
1184expanded.
1185
1186=item *
1187
1188There are now a couple of example one-liners for previewing POD files after
1189they have been edited.
1190
1191=back
1192
1193=head3 L<perlre>
1194
1195=over
1196
1197=item *
1198
1199The C<(*COMMIT)> directive is now listed in the right section
1200(L<Verbs without an argument|perlre/Verbs without an argument>).
1201
1202=back
1203
1204=head3 L<perlrun>
1205
1206=over
1207
1208=item *
1209
1210L<perlrun> has undergone a significant clean-up. Most notably, the
1211B<-0x...> form of the B<-0> flag has been clarified, and the final section
1212on environment variables has been corrected and expanded (5.14.1).
1213
1214=back
1215
1216=head3 L<perlsub>
1217
1218=over
1219
1220=item *
1221
1222The ($;) prototype syntax, which has existed for rather a long time, is now
1223documented in L<perlsub>. It allows a unary function to have the same
1224precedence as a list operator.
1225
1226=back
1227
1228=head3 L<perltie>
1229
1230=over
1231
1232=item *
1233
1234The required syntax for tying handles has been documented.
1235
1236=back
1237
1238=head3 L<perlvar>
1239
1240=over
1241
1242=item *
1243
1244The documentation for L<$!|perlvar/$!> has been corrected and clarified.
1245It used to state that $! could be C<undef>, which is not the case. It was
1246also unclear as to whether system calls set C's C<errno> or Perl's C<$!>
1247[perl #91614].
1248
1249=item *
1250
1251Documentation for L<$$|perlvar/$$> has been amended with additional
1252cautions regarding changing the process ID.
1253
1254=back
1255
1256=head3 Other Changes
1257
1258=over 4
1259
1260=item *
1261
1262L<perlxs> was extended with documentation on inline typemaps.
1263
1264=item *
1265
1266L<perlref> has a new L<Circular References|perlref/Circular References>
1267section explaining how circularities may not be freed and how to solve that
1268with weak references.
1269
1270=item *
1271
1272Parts of L<perlapi> were clarified, and Perl equivalents of some C
1273functions have been added as an additional mode of exposition.
1274
1275=item *
1276
1277A few parts of L<perlre> and L<perlrecharclass> were clarified.
1278
1279=back
1280
1281=head2 Removed Documentation
1282
1283=head3 Old OO Documentation
1284
1285All the old OO tutorials, perltoot, perltooc, and perlboot, have been
1286removed. The perlbot (bag of object tricks) document has been removed
1287as well.
1288
1289=head3 Development Deltas
1290
1291The perldelta files for development releases are no longer packaged with
1292perl. These can still be found in the perl source code repository.
1293
1294=head1 Diagnostics
1295
1296The following additions or changes have been made to diagnostic output,
1297including warnings and fatal error messages. For the complete list of
1298diagnostic messages, see L<perldiag>.
1299
1300=head2 New Diagnostics
1301
1302=head3 New Errors
1303
1304=over 4
1305
1306=item *
1307
1308L<Cannot set tied @DB::args|perldiag/"Cannot set tied @DB::args">
1309
1310This error occurs when C<caller> tries to set C<@DB::args> but finds it
1311tied. Before this error was added, it used to crash instead.
1312
1313=item *
1314
1315L<Cannot tie unreifiable array|perldiag/"Cannot tie unreifiable array">
1316
1317This error is part of a safety check that the C<tie> operator does before
1318tying a special array like C<@_>. You should never see this message.
1319
1320=item *
1321
1322L<&CORE::%s cannot be called directly|perldiag/"&CORE::%s cannot be called directly">
1323
1324This occurs when a subroutine in the C<CORE::> namespace is called
1325with C<&foo> syntax or through a reference. Some subroutines
1326in this package cannot yet be called that way, but must be
1327called as barewords. See L</Subroutines in the C<CORE> namespace>, above.
1328
1329=item *
1330
1331L<Source filters apply only to byte streams|perldiag/"Source filters apply only to byte streams">
1332
1333This new error occurs when you try to activate a source filter (usually by
1334loading a source filter module) within a string passed to C<eval> under the
1335C<unicode_eval> feature.
1336
1337=back
1338
1339=head3 New Warnings
1340
1341=over 4
1342
1343=item *
1344
1345L<defined(@array) is deprecated|perldiag/"defined(@array) is deprecated">
1346
1347The long-deprecated C<defined(@array)> now also warns for package variables.
1348Previously it only issued a warning for lexical variables.
1349
1350=item *
1351
1352L<length() used on %s|perldiag/length() used on %s>
1353
1354This new warning occurs when C<length> is used on an array or hash, instead
1355of C<scalar(@array)> or C<scalar(keys %hash)>.
1356
1357=item *
1358
1359L<lvalue attribute %s already-defined subroutine|perldiag/"lvalue attribute %s already-defined subroutine">
1360
1361L<attributes.pm|attributes> now emits this warning when the :lvalue
1362attribute is applied to a Perl subroutine that has already been defined, as
1363doing so can have unexpected side-effects.
1364
1365=item *
1366
1367L<overload arg '%s' is invalid|perldiag/"overload arg '%s' is invalid">
1368
1369This warning, in the "overload" category, is produced when the overload
1370pragma is given an argument it doesn't recognize, presumably a mistyped
1371operator.
1372
1373=item *
1374
1375L<$[ used in %s (did you mean $] ?)|perldiag/"$[ used in %s (did you mean $] ?)">
1376
1377This new warning exists to catch the mistaken use of C<$[> in version
1378checks. C<$]>, not C<$[>, contains the version number.
1379
1380=item *
1381
1382L<Useless assignment to a temporary|perldiag/"Useless assignment to a temporary">
1383
1384Assigning to a temporary scalar returned
1385from an lvalue subroutine now produces this
1386warning [perl #31946].
1387
1388=item *
1389
1390L<Useless use of \E|perldiag/"Useless use of \E">
1391
1392C<\E> does nothing unless preceded by C<\Q>, C<\L> or C<\U>.
1393
1394=back
1395
1396=head2 Removed Errors
1397
1398=over
1399
1400=item *
1401
1402"sort is now a reserved word"
1403
1404This error used to occur when C<sort> was called without arguments,
1405followed by C<;> or C<)>. (E.g., C<sort;> would die, but C<{sort}> was
1406OK.) This error message was added in Perl 3 to catch code like
1407C<close(sort)> which would no longer work. More than two decades later,
1408this message is no longer appropriate. Now C<sort> without arguments is
1409always allowed, and returns an empty list, as it did in those cases
1410where it was already allowed [perl #90030].
1411
1412=back
1413
1414=head2 Changes to Existing Diagnostics
1415
1416=over 4
1417
1418=item *
1419
1420The "Applying pattern match..." or similar warning produced when an
1421array or hash is on the left-hand side of the C<=~> operator now
1422mentions the name of the variable.
1423
1424=item *
1425
1426The "Attempt to free non-existent shared string" has had the spelling
1427of "non-existent" corrected to "nonexistent". It was already listed
1428with the correct spelling in L<perldiag>.
1429
1430=item *
1431
1432The error messages for using C<default> and C<when> outside of a
1433topicalizer have been standardised to match the messages for C<continue>
1434and loop controls. They now read 'Can't "default" outside a
1435topicalizer' and 'Can't "when" outside a topicalizer'. They both used
1436to be 'Can't use when() outside a topicalizer' [perl #91514].
1437
1438=item *
1439
1440The message, "Code point 0x%X is not Unicode, no properties match it;
1441all inverse properties do" has been changed to "Code point 0x%X is not
1442Unicode, all \p{} matches fail; all \P{} matches succeed".
1443
1444=item *
1445
1446Redefinition warnings for constant subroutines used to be mandatory,
1447even occurring under C<no warnings>. Now they respect the L<warnings>
1448pragma.
1449
1450=item *
1451
1452The "glob failed" warning message is now suppressible via C<no warnings>
1453[perl #111656].
1454
1455=item *
1456
1457The L<Invalid version format|perldiag/"Invalid version format (%s)">
1458error message now says "negative version number" within the parentheses,
1459rather than "non-numeric data", for negative numbers.
1460
1461=item *
1462
1463The two warnings
1464L<Possible attempt to put comments in qw() list|perldiag/"Possible attempt to put comments in qw() list">
1465and
1466L<Possible attempt to separate words with commas|perldiag/"Possible attempt to separate words with commas">
1467are no longer mutually exclusive: the same C<qw> construct may produce
1468both.
1469
1470=item *
1471
1472The uninitialized warning for C<y///r> when C<$_> is implicit and
1473undefined now mentions the variable name, just like the non-/r variation
1474of the operator.
1475
1476=item *
1477
1478The 'Use of "foo" without parentheses is ambiguous' warning has been
1479extended to apply also to user-defined subroutines with a (;$)
1480prototype, and not just to built-in functions.
1481
1482=item *
1483
1484Warnings that mention the names of lexical (C<my>) variables with
1485Unicode characters in them now respect the presence or absence of the
1486C<:utf8> layer on the output handle, instead of outputting UTF8
1487regardless. Also, the correct names are included in the strings passed
1488to C<$SIG{__WARN__}> handlers, rather than the raw UTF8 bytes.
1489
1490=back
1491
1492=head1 Utility Changes
1493
1494=head3 L<h2ph>
1495
1496=over 4
1497
1498=item *
1499
1500L<h2ph> used to generate code of the form
1501
1502 unless(defined(&FOO)) {
1503 sub FOO () {42;}
1504 }
1505
1506But the subroutine is a compile-time declaration, and is hence unaffected
1507by the condition. It has now been corrected to emit a string C<eval>
1508around the subroutine [perl #99368].
1509
1510=back
1511
1512=head3 L<splain>
1513
1514=over 4
1515
1516=item *
1517
1518F<splain> no longer emits backtraces with the first line number repeated.
1519
1520This:
1521
1522 Uncaught exception from user code:
1523 Cannot fwiddle the fwuddle at -e line 1.
1524 at -e line 1
1525 main::baz() called at -e line 1
1526 main::bar() called at -e line 1
1527 main::foo() called at -e line 1
1528
1529has become this:
1530
1531 Uncaught exception from user code:
1532 Cannot fwiddle the fwuddle at -e line 1.
1533 main::baz() called at -e line 1
1534 main::bar() called at -e line 1
1535 main::foo() called at -e line 1
1536
1537=item *
1538
1539Some error messages consist of multiple lines that are listed as separate
1540entries in L<perldiag>. splain has been taught to find the separate
1541entries in these cases, instead of simply failing to find the message.
1542
1543=back
1544
1545=head3 L<zipdetails>
1546
1547=over 4
1548
1549=item *
1550
1551This is a new utility, included as part of an
1552L<IO::Compress::Base> upgrade.
1553
1554L<zipdetails> displays information about the internal record structure
1555of the zip file. It is not concerned with displaying any details of
1556the compressed data stored in the zip file.
1557
1558=back
1559
1560=head1 Configuration and Compilation
1561
1562=over 4
1563
1564=item *
1565
1566F<regexp.h> has been modified for compatibility with GCC's B<-Werror>
1567option, as used by some projects that include perl's header files (5.14.1).
1568
1569=item *
1570
1571C<USE_LOCALE{,_COLLATE,_CTYPE,_NUMERIC}> have been added the output of perl -V
1572as they have affect the behaviour of the interpreter binary (albeit only
1573in a small area).
1574
1575=item *
1576
1577The code and tests for L<IPC::Open2> have been moved from F<ext/IPC-Open2>
1578into F<ext/IPC-Open3>, as C<IPC::Open2::open2()> is implemented as a thin
1579wrapper around C<IPC::Open3::_open3()>, and hence is very tightly coupled to
1580it.
1581
1582=item *
1583
1584The magic types and magic vtables are now generated from data in a new script
1585F<regen/mg_vtable.pl>, instead of being maintained by hand. As different
1586EBCDIC variants can't agree on the code point for '~', the character to code
1587point conversion is done at build time by F<generate_uudmap> to a new generated
1588header F<mg_data.h>. C<PL_vtbl_bm> and C<PL_vtbl_fm> are now defined by the
1589pre-processor as C<PL_vtbl_regexp>, instead of being distinct C variables.
1590C<PL_vtbl_sig> has been removed.
1591
1592=item *
1593
1594Building with C<-DPERL_GLOBAL_STRUCT> works again. This configuration is not
1595generally used.
1596
1597=item *
1598
1599Perl configured with I<MAD> now correctly frees C<MADPROP> structures when
1600OPs are freed. C<MADPROP>s are now allocated with C<PerlMemShared_malloc()>
1601
1602=item *
1603
1604F<makedef.pl> has been refactored. This should have no noticeable affect on
1605any of the platforms that use it as part of their build (AIX, VMS, Win32).
1606
1607=item *
1608
1609C<useperlio> can no longer be disabled.
1610
1611=item *
1612
1613The file F<global.sym> is no longer needed, and has been removed. It
1614contained a list of all exported functions, one of the files generated by
1615F<regen/embed.pl> from data in F<embed.fnc> and F<regen/opcodes>. The code
1616has been refactored so that the only user of F<global.sym>, F<makedef.pl>,
1617now reads F<embed.fnc> and F<regen/opcodes> directly, removing the need to
1618store the list of exported functions in an intermediate file.
1619
1620As F<global.sym> was never installed, this change should not be visible
1621outside the build process.
1622
1623=item *
1624
1625F<pod/buildtoc>, used by the build process to build L<perltoc>, has been
1626refactored and simplified. It now only contains code to build L<perltoc>;
1627the code to regenerate Makefiles has been moved to F<Porting/pod_rules.pl>.
1628It's a bug if this change has any material effect on the build process.
1629
1630=item *
1631
1632F<pod/roffitall> is now built by F<pod/buildtoc>, instead of being
1633shipped with the distribution. Its list of manpages is now generated
1634(and therefore current). See also RT #103202 for an unresolved related
1635issue.
1636
1637=item *
1638
1639The man page for C<XS::Typemap> is no longer installed. C<XS::Typemap>
1640is a test module which is not installed, hence installing its
1641documentation makes no sense.
1642
1643=item *
1644
1645The -Dusesitecustomize and -Duserelocatableinc options now work
1646together properly.
1647
1648=back
1649
1650=head1 Platform Support
1651
1652=head2 Platform-Specific Notes
1653
1654=head3 Cygwin
1655
1656=over 4
1657
1658=item *
1659
1660Since version 1.7, Cygwin supports native UTF-8 paths. If Perl is built
1661under that environment, directory and filenames will be UTF-8 encoded.
1662
1663Cygwin does not initialize all original Win32 environment variables. See
1664F<README.cygwin> for a discussion of the newly-added
1665C<Cygwin::sync_winenv()> function [perl #110190] and for
1666further links.
1667
1668=back
1669
1670=head3 HP-UX
1671
1672=over 4
1673
1674=item *
1675
1676HP-UX PA-RISC/64 now supports gcc-4.x
1677
1678A fix to correct the socketsize now makes the test suite pass on HP-UX
1679PA-RISC for 64bitall builds.
1680
1681=back
1682
1683=head3 VMS
1684
1685=over 4
1686
1687=item *
1688
1689Remove unnecessary includes, fix miscellaneous compiler warnings and
1690close some unclosed comments on F<vms/vms.c>.
1691
1692Remove sockadapt layer from the VMS build.
1693
1694=item *
1695
1696Explicit support for VMS versions prior to v7.0 and DEC C versions
1697prior to v6.0 has been removed.
1698
1699=item *
1700
1701Since Perl 5.10.1, the home-grown C<stat> wrapper has been unable to
1702distinguish between a directory name containing an underscore and an
1703otherwise-identical filename containing a dot in the same position
1704(e.g., t/test_pl as a directory and t/test.pl as a file). This problem
1705has been corrected.
1706
1707=item *
1708
1709The build on VMS now allows names of the resulting symbols in C code for
1710Perl longer than 31 characters. Symbols like
1711C<Perl__it_was_the_best_of_times_it_was_the_worst_of_times> can now be
1712created freely without causing the VMS linker to seize up.
1713
1714=back
1715
1716=head3 GNU/Hurd
1717
1718Numerous build and test failures on GNU/Hurd have been resolved with hints
1719for building DBM modules, detection of the library search path, and enabling
1720of large file support.
1721
1722=head3 OpenVOS
1723
1724Perl is now built with dynamic linking on OpenVOS, the minimum supported
1725version of which is now Release 17.1.0.
1726
1727=head3 SunOS
1728
1729The CC workshop C++ compiler is now detected and used on systems that ship
1730without cc.
1731
1732=head1 Internal Changes
1733
1734=over 4
1735
1736=item *
1737
1738The compiled representation of formats is now stored via the C<mg_ptr> of
1739their C<PERL_MAGIC_fm>. Previously it was stored in the string buffer,
1740beyond C<SvLEN()>, the regular end of the string. C<SvCOMPILED()> and
1741C<SvCOMPILED_{on,off}()> now exist solely for compatibility for XS code.
1742The first is always 0, the other two now no-ops. (5.14.1)
1743
1744=item *
1745
1746Some global variables have been marked C<const>, members in the interpreter
1747structure have been re-ordered, and the opcodes have been re-ordered. The
1748op C<OP_AELEMFAST> has been split into C<OP_AELEMFAST> and C<OP_AELEMFAST_LEX>.
1749
1750=item *
1751
1752When empting a hash of its elements (e.g. via undef(%h), or %h=()), HvARRAY
1753field is no longer temporarily zeroed. Any destructors called on the freed
1754elements see the remaining elements. Thus, %h=() becomes more like
1755C<delete $h{$_} for keys %h>.
1756
1757=item *
1758
1759Boyer-Moore compiled scalars are now PVMGs, and the Boyer-Moore tables are now
1760stored via the mg_ptr of their C<PERL_MAGIC_bm>.
1761Previously they were PVGVs, with the tables stored in
1762the string buffer, beyond C<SvLEN()>. This eliminates
1763the last place where the core stores data beyond C<SvLEN()>.
1764
1765=item *
1766
1767Simplified logic in C<Perl_sv_magic()> introduces a small change of
1768behaviour for error cases involving unknown magic types. Previously, if
1769C<Perl_sv_magic()> was passed a magic type unknown to it, it would
1770
1771=over
1772
1773=item 1.
1774
1775Croak "Modification of a read-only value attempted" if read only
1776
1777=item 2.
1778
1779Return without error if the SV happened to already have this magic
1780
1781=item 3.
1782
1783otherwise croak "Don't know how to handle magic of type \\%o"
1784
1785=back
1786
1787Now it will always croak "Don't know how to handle magic of type \\%o", even
1788on read only values, or SVs which already have the unknown magic type.
1789
1790=item *
1791
1792The experimental C<fetch_cop_label> function has been renamed to
1793C<cop_fetch_label>.
1794
1795=item *
1796
1797The C<cop_store_label> function has been added to the API, but is
1798experimental.
1799
1800=item *
1801
1802F<embedvar.h> has been simplified, and one level of macro indirection for
1803PL_* variables has been removed for the default (non-multiplicity)
1804configuration. PERLVAR*() macros now directly expand their arguments to
1805tokens such as C<PL_defgv>, instead of expanding to C<PL_Idefgv>, with
1806F<embedvar.h> defining a macro to map C<PL_Idefgv> to C<PL_defgv>. XS code
1807which has unwarranted chumminess with the implementation may need updating.
1808
1809=item *
1810
1061b56a
FC
1811A C<coreargs> opcode has been added, to be used by C<&CORE::foo> subs to sort
1812out C<@_>.
1813
1814=item *
1815
05c8f9ed
RS
1816An API has been added to explicitly choose whether or not to export XSUB
1817symbols. More detail can be found in the comments for commit e64345f8.
1818
1819=item *
1820
1821The C<is_gv_magical_sv> function has been eliminated and merged with
1822C<gv_fetchpvn_flags>. It used to be called to determine whether a GV
1823should be autovivified in rvalue context. Now it has been replaced with a
1824new C<GV_ADDMG> flag (not part of the API).
1825
1826=item *
1827
1828The returned code point from the function C<utf8n_to_uvuni()>
449d5120
RS
1829when the input is malformed UTF-8, malformations are allowed, and
1830C<utf8> warnings are off is now the Unicode REPLACEMENT CHARACTER
1831whenever the malformation is such that no well-defined code point can be
1832computed. Previously the returned value was essentially garbage. The
1833only malformations that have well-defined values are a zero-length
1834string (0 is the return), and overlong UTF-8 sequences.
1835
1836=item *
1837
1838The returned code point from the function C<utf8n_to_uvuni()>
05c8f9ed
RS
1839when the input is malformed UTF-8, malformations are allowed, and
1840C<utf8> warnings are off is now the Unicode REPLACEMENT CHARACTER
1841whenever the malformation is such that no well-defined code point can be
1842computed. Previously the returned value was essentially garbage. The
1843only malformations that have well-defined values are a zero-length
1844string (0 is the return), and overlong UTF-8 sequences.
1845
1846=item *
1847
1848Padlists are now marked C<AvREAL>; i.e., reference-counted. They have
1849always been reference-counted, but were not marked real, because F<pad.c>
1850did its own clean-up, instead of using the usual clean-up code in F<sv.c>.
1851That caused problems in thread cloning, so now the C<AvREAL> flag is on,
1852but is turned off in F<pad.c> right before the padlist is freed (after
1853F<pad.c> has done its custom freeing of the pads).
1854
1855=item *
1856
1857All the C files that make up the Perl core have been converted to UTF-8.
1858
1859=item *
1860
1861These new functions have been added as part of the work on Unicode symbols:
1862
1863 HvNAMELEN
1864 HvNAMEUTF8
1865 HvENAMELEN
1866 HvENAMEUTF8
1867 gv_init_pv
1868 gv_init_pvn
1869 gv_init_pvsv
1870 gv_fetchmeth_pv
1871 gv_fetchmeth_pvn
1872 gv_fetchmeth_sv
1873 gv_fetchmeth_pv_autoload
1874 gv_fetchmeth_pvn_autoload
1875 gv_fetchmeth_sv_autoload
1876 gv_fetchmethod_pv_flags
1877 gv_fetchmethod_pvn_flags
1878 gv_fetchmethod_sv_flags
1879 gv_autoload_pv
1880 gv_autoload_pvn
1881 gv_autoload_sv
1882 newGVgen_flags
1883 sv_derived_from_pv
1884 sv_derived_from_pvn
1885 sv_derived_from_sv
1886 sv_does_pv
1887 sv_does_pvn
1888 sv_does_sv
1889 whichsig_pv
1890 whichsig_pvn
1891 whichsig_sv
1892 newCONSTSUB_flags
1893
1894The gv_fetchmethod_*_flags functions, like gv_fetchmethod_flags, are
1895experimental and may change in a future release.
1896
1897=item *
1898
1899The following functions were added. These are I<not> part of the API:
1900
1901 GvNAMEUTF8
1902 GvENAMELEN
1903 GvENAME_HEK
1904 CopSTASH_flags
1905 CopSTASH_flags_set
1906 PmopSTASH_flags
1907 PmopSTASH_flags_set
1908 sv_sethek
1909 HEKfARG
1910
1911There is also a C<HEKf> macro corresponding to C<SVf>, for
1912interpolating HEKs in formatted strings.
1913
1914=item *
1915
1916C<sv_catpvn_flags> takes a couple of new internal-only flags,
1917C<SV_CATBYTES> and C<SV_CATUTF8>, which tell it whether the char array to
1918be concatenated is UTF8. This allows for more efficient concatenation than
1919creating temporary SVs to pass to C<sv_catsv>.
1920
1921=item *
1922
1923For XS AUTOLOAD subs, $AUTOLOAD is set once more, as it was in 5.6.0. This
1924is in addition to setting C<SvPVX(cv)>, for compatibility with 5.8 to 5.14.
1925See L<perlguts/Autoloading with XSUBs>.
1926
1927=item *
1928
1929Perl now checks whether the array (the linearised isa) returned by a MRO
1930plugin begins with the name of the class itself, for which the array was
1931created, instead of assuming that it does. This prevents the first element
1932from being skipped during method lookup. It also means that
1933C<mro::get_linear_isa> may return an array with one more element than the
1934MRO plugin provided [perl #94306].
1935
1936=item *
1937
1938C<PL_curstash> is now reference-counted.
1939
1940=item *
1941
1942There are now feature bundle hints in C<PL_hints> (C<$^H>) that version
1943declarations use, to avoid having to load F<feature.pm>. One setting of
1944the hint bits indicates a "custom" feature bundle, which means that the
1945entries in C<%^H> still apply. F<feature.pm> uses that.
1946
1947The C<HINT_FEATURE_MASK> macro is defined in F<perl.h> along with other
1948hints. Other macros for setting and testing features and bundles are in
1949the new F<feature.h>. C<FEATURE_IS_ENABLED> (which has moved to
1950F<feature.h>) is no longer used throughout the codebase, but more specific
1951macros, e.g., C<FEATURE_SAY_IS_ENABLED>, that are defined in F<feature.h>.
1952
1953=item *
1954
1955F<lib/feature.pm> is now a generated file, created by the new
1956F<regen/feature.pl> script, which also generates F<feature.h>.
1957
1958=item *
1959
1960Tied arrays are now always C<AvREAL>. If C<@_> or C<DB::args> is tied, it
1961is reified first, to make sure this is always the case.
1962
1963=item *
1964
1965Two new functions C<utf8_to_uvchr_buf()> and C<utf8_to_uvuni_buf()> have
1966been added. These are the same as C<utf8_to_uvchr> and
1967C<utf8_to_uvuni> (which are now deprecated), but take an extra parameter
1968that is used to guard against reading beyond the end of the input
1969string.
1970See L<perlapi/utf8_to_uvchr_buf> and L<perlapi/utf8_to_uvuni_buf>.
1971
1972=item *
1973
1974The regular expression engine now does TRIE case insensitive matches
1975under Unicode. This may change the output of C<< use re 'debug'; >>,
1976and will speed up various things.
1977
1978=item *
1979
1980There is a new C<wrap_op_checker()> function, which provides a thread-safe
1981alternative to writing to C<PL_check> directly.
1982
1983=back
1984
1985=head1 Selected Bug Fixes
1986
1987=head2 Array and hash
1988
1989=over
1990
1991=item *
1992
1993A bug has been fixed that would cause a "Use of freed value in iteration"
1994error if the next two hash elements that would be iterated over are
1995deleted [perl #85026]. (5.14.1)
1996
1997=item *
1998
1999Deleting the current hash iterator (the hash element that would be returend
2000by the next call to C<each>) in void context used not to free it
2001[perl #85026].
2002
2003=item *
2004
2005Deletion of methods via C<delete $Class::{method}> syntax used to update
2006method caches if called in void context, but not scalar or list context.
2007
2008=item *
2009
2010When hash elements are deleted in void context, the internal hash entry is
2011now freed before the value is freed, to prevent destructors called by that
2012latter freeing from seeing the hash in an inconsistent state. It was
2013possible to cause double-frees if the destructor freed the hash itself
2014[perl #100340].
2015
2016=item *
2017
2018A C<keys> optimisation in Perl 5.12.0 to make it faster on empty hashes
2019caused C<each> not to reset the iterator if called after the last element
2020was deleted.
2021
2022=item *
2023
2024Freeing deeply nested hashes no longer crashes [perl #44225].
2025
2026=item *
2027
2028It is possible from XS code to create hashes with elements that have no
2029values. The hash element and slice operators used to crash
2030when handling these in lvalue context. They now
2031produce a "Modification of non-creatable hash value attempted" error
2032message.
2033
2034=item *
2035
2036If list assignment to a hash or array triggered destructors that freed the
2037hash or array itself, a crash would ensue. This is no longer the case
2038[perl #107440].
2039
2040=item *
2041
2042It used to be possible to free the typeglob of a localised array or hash
2043(e.g., C<local @{"x"}; delete $::{x}>), resulting in a crash on scope exit.
2044
2045=item *
2046
2047Some core bugs affecting L<Hash::Util> have been fixed: locking a hash
2048element that is a glob copy no longer causes subsequent assignment to it to
2049corrupt the glob, and unlocking a hash element that holds a copy-on-write
2050scalar no longer causes modifications to that scalar to modify other
2051scalars that were sharing the same string buffer.
2052
2053=back
2054
2055=head2 C API fixes
2056
2057=over
2058
2059=item *
2060
2061The C<newHVhv> XS function now works on tied hashes, instead of crashing or
2062returning an empty hash.
2063
2064=item *
2065
2066The C<SvIsCOW> C macro now returns false for read-only copies of typeglobs,
2067such as those created by:
2068
2069 $hash{elem} = *foo;
2070 Hash::Util::lock_value %hash, 'elem';
2071
2072It used to return true.
2073
2074=item *
2075
2076The C<SvPVutf8> C function no longer tries to modify its argument,
2077resulting in errors [perl #108994].
2078
2079=item *
2080
2081C<SvPVutf8> now works properly with magical variables.
2082
2083=item *
2084
2085C<SvPVbyte> now works properly non-PVs.
2086
2087=item *
2088
2089When presented with malformed UTF-8 input, the XS-callable functions
2090C<is_utf8_string()>, C<is_utf8_string_loc()>, and
2091C<is_utf8_string_loclen()> could read beyond the end of the input
2092string by up to 12 bytes. This no longer happens. [perl #32080].
2093However, currently, C<is_utf8_char()> still has this defect, see
2094L</is_utf8_char()> above.
2095
2096=item *
2097
2098The C-level C<pregcomp> function could become confused as to whether the
2099pattern was in UTF8 if the pattern was an overloaded, tied, or otherwise
2100magical scalar [perl #101940].
2101
2102=back
2103
2104=head2 Compile-time hints
2105
2106=over
2107
2108=item *
2109
2110Tying C<%^H> no longer causes perl to crash or ignore the contents of
2111C<%^H> when entering a compilation scope [perl #106282].
2112
2113=item *
2114
2115C<eval $string> and C<require> used not to
2116localise C<%^H> during compilation if it
2117was empty at the time the C<eval> call itself was compiled. This could
2118lead to scary side effects, like C<use re "/m"> enabling other flags that
2119the surrounding code was trying to enable for its caller [perl #68750].
2120
2121=item *
2122
2123C<eval $string> and C<require> no longer localise hints (C<$^H> and C<%^H>)
2124at run time, but only during compilation of the $string or required file.
2125This makes C<BEGIN { $^H{foo}=7 }> equivalent to
2126C<BEGIN { eval '$^H{foo}=7' }> [perl #70151].
2127
2128=item *
2129
2130Creating a BEGIN block from XS code (via C<newXS> or C<newATTRSUB>) would,
2131on completion, make the hints of the current compiling code the current
2132hints. This could cause warnings to occur in a non-warning scope.
2133
2134=back
2135
2136=head2 Copy-on-write scalars
2137
2138Copy-on-write or shared hash key scalars
2139were introduced in 5.8.0, but most Perl code
2140did not encounter them (they were used mostly internally). Perl
21415.10.0 extended them, such that assigning C<__PACKAGE__> or a
2142hash key to a scalar would make it copy-on-write. Several parts
2143of Perl were not updated to account for them, but have now been fixed.
2144
2145=over
2146
2147=item *
2148
2149C<utf8::decode> had a nasty bug that would modify copy-on-write scalars'
2150string buffers in place (i.e., skipping the copy). This could result in
2151hashes having two elements with the same key [perl #91834].
2152
2153=item *
2154
2155Lvalue subroutines were not allowing COW scalars to be returned. This was
2156fixed for lvalue scalar context in Perl 5.12.3 and 5.14.0, but list context
2157was not fixed until this release.
2158
2159=item *
2160
2161Elements of restricted hashes (see the L<fields> pragma) containing
2162copy-on-write values couldn't be deleted, nor could such hashes be cleared
2163(C<%hash = ()>).
2164
2165=item *
2166
2167Localising a tied variable used to make it read-only if it contained a
2168copy-on-write string.
2169
2170=item *
2171
2172Assigning a copy-on-write string to a stash
2173element no longer causes a double free. Regardless of this change, the
2174results of such assignments are still undefined.
2175
2176=item *
2177
2178Assigning a copy-on-write string to a tied variable no longer stops that
2179variable from being tied if it happens to be a PVMG or PVLV internally.
2180
2181=item *
2182
2183Doing a substitution on a tied variable returning a copy-on-write
2184scalar used to cause an assertion failure or an "Attempt to free
2185nonexistent shared string" warning.
2186
2187=item *
2188
2189This one is a regression from 5.12: In 5.14.0, the bitwise assignment
2190operators C<|=>, C<^=> and C<&=> started leaving the left-hand side
2191undefined if it happened to be a copy-on-write string [perl #108480].
2192
2193=item *
2194
2195L<Storable>, L<Devel::Peek> and L<PerlIO::scalar> had similar problems.
2196See L</Updated Modules and Pragmata>, above.
2197
2198=back
2199
2200=head2 The debugger
2201
2202=over
2203
2204=item *
2205
2206F<dumpvar.pl>, and consequently the C<x> command in the debugger, have been
2207fixed to handle objects blessed into classes whose names contain "=". The
2208contents of such objects used not to be dumped [perl #101814].
2209
2210=item *
2211
2212The "R" command for restarting a debugger session has been fixed to work on
2213Windows, or any other system lacking a C<POSIX::_SC_OPEN_MAX> constant
2214[perl #87740].
2215
2216=item *
2217
2218The C<#line 42 foo> directive used not to update the arrays of lines used
2219by the debugger if it occurred in a string eval. This was partially fixed
2220in 5.14, but it only worked for a single C<#line 42 foo> in each eval. Now
2221it works for multiple.
2222
2223=item *
2224
2225When subroutine calls are intercepted by the debugger, the name of the
2226subroutine or a reference to it is stored in C<$DB::sub>, for the debugger
2227to access. In some cases (such as C<$foo = *bar; undef *bar; &$foo>)
2228C<$DB::sub> would be set to a name that could not be used to find the
2229subroutine, and so the debugger's attempt to call it would fail. Now the
2230check to see whether a reference is needed is more robust, so those
2231problems should not happen anymore [rt.cpan.org #69862].
2232
2233=item *
2234
2235Every subroutine has a filename associated with it that the debugger uses.
2236The one associated with constant subroutines used to be misallocated when
2237cloned under threads. Consequently, debugging threaded applications could
2238result in memory corruption [perl #96126].
2239
2240=back
2241
2242=head2 Dereferencing operators
2243
2244=over
2245
2246=item *
2247
2248C<defined(${"..."})>, C<defined(*{"..."})>, etc., used to
2249return true for most, but not all built-in variables, if
2250they had not been used yet. This bug affected C<${^GLOBAL_PHASE}> and
2251C<${^UTF8CACHE}>, among others. It also used to return false if the
2252package name was given as well (C<${"::!"}>) [perl #97978, #97492].
2253
2254=item *
2255
2256Perl 5.10.0 introduced a similar bug: C<defined(*{"foo"})> where "foo"
2257represents the name of a built-in global variable used to return false if
2258the variable had never been used before, but only on the I<first> call.
2259This, too, has been fixed.
2260
2261=item *
2262
2263Since 5.6.0, C<*{ ... }> has been inconsistent in how it treats undefined
2264values. It would die in strict mode or lvalue context for most undefined
2265values, but would be treated as the empty string (with a warning) for the
2266specific scalar return by C<undef()> (C<&PL_sv_undef> internally). This
2267has been corrected. C<undef()> is now treated like other undefined
2268scalars, as in Perl 5.005.
2269
2270=back
2271
2272=head2 Filehandle, last-accessed
2273
2274Perl has an internal variable that stores the last filehandle to be
2275accessed. It is used by C<$.> and by C<tell> and C<eof> without
2276arguments.
2277
2278=over
2279
2280=item *
2281
2282It used to be possible to set this internal variable to a glob copy and
2283then modify that glob copy to be something other than a glob, and still
2284have the last-accessed filehandle associated with the variable after
2285assigning a glob to it again:
2286
2287 my $foo = *STDOUT; # $foo is a glob copy
2288 <$foo>; # $foo is now the last-accessed handle
2289 $foo = 3; # no longer a glob
2290 $foo = *STDERR; # still the last-accessed handle
2291
2292Now the C<$foo = 3> assignment unsets that internal variable, so there
2293is no last-accessed filehandle, just as if C<< <$foo> >> had never
2294happened.
2295
2296This also prevents some unrelated handle from becoming the last-accessed
2297handle if $foo falls out of scope and the same internal SV gets used for
2298another handle [perl #97988].
2299
2300=item *
2301
2302A regression in 5.14 caused these statements not to set that internal
2303variable:
2304
2305 my $fh = *STDOUT;
2306 tell $fh;
2307 eof $fh;
2308 seek $fh, 0,0;
2309 tell *$fh;
2310 eof *$fh;
2311 seek *$fh, 0,0;
2312 readline *$fh;
2313
2314This is now fixed, but C<tell *{ *$fh }> still has the problem, and it
2315is not clear how to fix it [perl #106536].
2316
2317=back
2318
2319=head2 Filetests and C<stat>
2320
2321The term "filetests" refers to the operators that consist of a hyphen
2322followed by a single letter: C<-r>, C<-x>, C<-M>, etc. The term "stacked"
2323when applied to filetests means followed by another filetest operator
2324sharing the same operand, as in C<-r -x -w $fooo>.
2325
2326=over
2327
2328=item *
2329
2330C<stat> produces more consistent warnings. It no longer warns for "_"
2331[perl #71002] and no longer skips the warning at times for other unopened
2332handles. It no longer warns about an unopened handle when the operating
2333system's C<fstat> function fails.
2334
2335=item *
2336
2337C<stat> would sometimes return negative numbers for large inode numbers,
2338because it was using the wrong internal C type. [perl #84590]
2339
2340=item *
2341
2342C<lstat> is documented to fall back to C<stat> (with a warning) when given
2343a filehandle. When passed an IO reference, it was actually doing the
2344equivalent of S<C<stat _>> and ignoring the handle.
2345
2346=item *
2347
2348C<-T _> with no preceding C<stat> used to produce a
2349confusing "uninitialized" warning, even though there
2350is no visible uninitialized value to speak of.
2351
2352=item *
2353
2354C<-T>, C<-B>, C<-l> and C<-t> now work
2355when stacked with other filetest operators
2356[perl #77388].
2357
2358=item *
2359
2360In 5.14.0, filetest ops (C<-r>, C<-x>, etc.) started calling FETCH on a
2361tied argument belonging to the previous argument to a list operator, if
2362called with a bareword argument or no argument at all. This has been
2363fixed, so C<push @foo, $tied, -r> no longer calls FETCH on C<$tied>.
2364
2365=item *
2366
2367In Perl 5.6, C<-l> followed by anything other than a bareword would treat
2368its argument as a file name. That was changed in 5.8 for glob references
2369(C<\*foo>), but not for globs themselves (C<*foo>). C<-l> started
2370returning C<undef> for glob references without setting the last
2371stat buffer that the "_" handle uses, but only if warnings
2372were turned on. With warnings off, it was the same as 5.6.
2373In other words, it was simply buggy and inconsistent. Now the 5.6
2374behaviour has been restored.
2375
2376=item *
2377
2378C<-l> followed by a bareword no longer "eats" the previous argument to
2379the list operator in whose argument list it resides. Hence,
2380C<print "bar", -l foo> now actually prints "bar", because C<-l>
2381on longer eats it.
2382
2383=item *
2384
2385Perl keeps several internal variables to keep track of the last stat
2386buffer, from which file(handle) it originated, what type it was, and
2387whether the last stat succeeded.
2388
2389There were various cases where these could get out of synch, resulting in
2390inconsistent or erratic behaviour in edge cases (every mention of C<-T>
2391applies to C<-B> as well):
2392
2393=over
2394
2395=item *
2396
2397C<-T I<HANDLE>>, even though it does a C<stat>, was not resetting the last
2398stat type, so an C<lstat _> following it would merrily return the wrong
2399results. Also, it was not setting the success status.
2400
2401=item *
2402
2403Freeing the handle last used by C<stat> or a filetest could result in
2404S<C<-T _>> using an unrelated handle.
2405
2406=item *
2407
2408C<stat> with an IO reference would not reset the stat type or record the
2409filehandle for S<C<-T _>> to use.
2410
2411=item *
2412
2413Fatal warnings could cause the stat buffer not to be reset
2414for a filetest operator on an unopened filehandle or C<-l> on any handle.
2415Fatal warnings also stopped C<-T> from setting C<$!>.
2416
2417=item *
2418
2419When the last stat was on an unreadable file, C<-T _> is supposed to
2420return C<undef>, leaving the last stat buffer unchanged. But it was
2421setting the stat type, causing C<lstat _> to stop working.
2422
2423=item *
2424
2425C<-T I<FILENAME>> was not resetting the internal stat buffers for
2426unreadable files.
2427
2428=back
2429
2430These have all been fixed.
2431
2432=back
2433
2434=head2 Formats
2435
2436=over
2437
2438=item *
2439
2440A number of edge cases have been fixed with formats and C<formline>;
2441in particular, where the format itself is potentially variable (such as
2442with ties and overloading), and where the format and data differ in their
2443encoding. In both these cases, it used to possible for the output to be
2444corrupted [perl #91032].
2445
2446=item *
2447
2448C<formline> no longer converts its argument into a string in-place. So
2449passing a reference to C<formline> no longer destroys the reference
2450[perl #79532].
2451
2452=item *
2453
2454Assignment to C<$^A> (the format output accumulator) now recalculates
2455the number of lines output.
2456
2457=back
2458
2459=head2 C<given> and C<when>
2460
2461=over
2462
2463=item *
2464
2465C<given> was not scoping its implicit $_ properly, resulting in memory
2466leaks or "Variable is not available" warnings [perl #94682].
2467
2468=item *
2469
2470C<given> was not calling set-magic on the implicit lexical C<$_> that it
2471uses. This meant, for example, that C<pos> would be remembered from one
2472execution of the same C<given> block to the next, even if the input were a
2473different variable [perl #84526].
2474
2475=item *
2476
2477C<when> blocks are now capable of returning variables declared inside the
2478enclosing C<given> block [perl #93548].
2479
2480=back
2481
2482=head2 The C<glob> operator
2483
2484=over
2485
2486=item *
2487
2488On OSes other than VMS, Perl's C<glob> operator (and the C<< <...> >> form)
2489use L<File::Glob> underneath. L<File::Glob> splits the pattern into words,
2490before feeding each word to its C<bsd_glob> function.
2491
2492There were several inconsistencies in the way the split was done. Now
2493quotation marks (' and ") are always treated as shell-style word delimiters
2494(that allow whitespace as part of a word) and backslashes are always
2495preserved, unless they exist to escape quotation marks. Before, those
2496would only sometimes be the case, depending on whether the pattern
2497contained whitespace. Also, escaped whitespace at the end of the pattern
2498is no longer stripped [perl #40470].
2499
2500=item *
2501
2502C<CORE::glob> now works as a way to call the default globbing function. It
2503used to respect overrides, despite the C<CORE::> prefix.
2504
2505=item *
2506
2507Under miniperl (used to configure modules when perl itself is built),
2508C<glob> now clears %ENV before calling csh, since the latter croaks on some
2509systems if it does not like the contents of the LS_COLORS enviroment
2510variable [perl #98662].
2511
2512=back
2513
2514=head2 Lvalue subroutines
2515
2516=over
2517
2518=item *
2519
2520Explicit return now returns the actual argument passed to return, instead
2521of copying it [perl #72724, #72706].
2522
2523=item *
2524
2525Lvalue subroutines used to enforce lvalue syntax (i.e., whatever can go on
2526the left-hand side of C<=>) for the last statement and the arguments to
2527return. Since lvalue subroutines are not always called in lvalue context,
2528this restriction has been lifted.
2529
2530=item *
2531
2532Lvalue subroutines are less restrictive as to what values can be returned.
2533It used to croak on values returned by C<shift> and C<delete> and from
2534other subroutines, but no longer does so [perl #71172].
2535
2536=item *
2537
2538Empty lvalue subroutines (C<sub :lvalue {}>) used to return C<@_> in list
2539context. In fact, all subroutines used to, but regular subs were fixed in
2540Perl 5.8.2. Now lvalue subroutines have been likewise fixed.
2541
2542=item *
2543
2544Autovivification now works on values returned from lvalue subroutines
2545[perl #7946], as does returning C<keys> in lvalue context.
2546
2547=item *
2548
2549Lvalue subroutines used to copy their return values in rvalue context. Not
2550only was this a waste of CPU cycles, but it also caused bugs. A C<($)>
2551prototype would cause an lvalue sub to copy its return value [perl #51408],
2552and C<while(lvalue_sub() =~ m/.../g) { ... }> would loop endlessly
2553[perl #78680].
2554
2555=item *
2556
2557When called in potential lvalue context
2558(e.g., subroutine arguments or a list
2559passed to C<for>), lvalue subroutines used to copy
2560any read-only value that was returned. E.g., C< sub :lvalue { $] } >
2561would not return C<$]>, but a copy of it.
2562
2563=item *
2564
2565When called in potential lvalue context, an lvalue subroutine returning
2566arrays or hashes used to bind the arrays or hashes to scalar variables,
2567resulting in bugs. This was fixed in 5.14.0 if an array were the first
2568thing returned from the subroutine (but not for C<$scalar, @array> or
2569hashes being returned). Now a more general fix has been applied
2570[perl #23790].
2571
2572=item *
2573
2574Method calls whose arguments were all surrounded with C<my()> or C<our()>
2575(as in C<< $object->method(my($a,$b)) >>) used to force lvalue context on
2576the subroutine. This would prevent lvalue methods from returning certain
2577values.
2578
2579=item *
2580
2581Lvalue sub calls that are not determined to be such at compile time
2582(C<&$name> or &{"name"}) are no longer exempt from strict refs if they
2583occur in the last statement of an lvalue subroutine [perl #102486].
2584
2585=item *
2586
2587Sub calls whose subs are not visible at compile time, if
2588they occurred in the last statement of an lvalue subroutine,
2589would reject non-lvalue subroutines and die with "Can't modify non-lvalue
2590subroutine call" [perl #102486].
2591
2592Non-lvalue sub calls whose subs I<are> visible at compile time exhibited
2593the opposite bug. If the call occurred in the last statement of an lvalue
2594subroutine, there would be no error when the lvalue sub was called in
2595lvalue context. Perl would blindly assign to the temporary value returned
2596by the non-lvalue subroutine.
2597
2598=item *
2599
2600C<AUTOLOAD> routines used to take precedence over the actual sub being
2601called (i.e., when autoloading wasn't needed), for sub calls in lvalue or
2602potential lvalue context, if the subroutine was not visible at compile
2603time.
2604
2605=item *
2606
2607Applying the C<:lvalue> attribute to an XSUB or to an aliased subroutine
2608stub with C<< sub foo :lvalue; >> syntax stopped working in Perl 5.12.
2609This has been fixed.
2610
2611=item *
2612
2613Applying the :lvalue attribute to subroutine that is already defined does
2614not work properly, as the attribute changes the way the sub is compiled.
2615Hence, Perl 5.12 began warning when an attempt is made to apply the
2616attribute to an already defined sub. In such cases, the attribute is
2617discarded.
2618
2619But the change in 5.12 missed the case where custom attributes are also
2620present: that case still silently and ineffectively applied the attribute.
2621That omission has now been corrected. C<sub foo :lvalue :Whatever> (when
2622C<foo> is already defined) now warns about the :lvalue attribute, and does
2623not apply it.
2624
2625=item *
2626
2627A bug affecting lvalue context propagation through nested lvalue subroutine
2628calls has been fixed. Previously, returning a value in nested rvalue
2629context would be treated as lvalue context by the inner subroutine call,
2630resulting in some values (such as read-only values) being rejected.
2631
2632=back
2633
2634=head2 Overloading
2635
2636=over
2637
2638=item *
2639
2640Arithmetic assignment (C<$left += $right>) involving overloaded objects
2641that rely on the 'nomethod' override no longer segfault when the left
2642operand is not overloaded.
2643
2644=item *
2645
2646Errors that occur when methods cannot be found during overloading now
2647mention the correct package name, as they did in 5.8.x, instead of
2648erroneously mentioning the "overload" package, as they have since 5.10.0.
2649
2650=item *
2651
2652Undefining C<%overload::> no longer causes a crash.
2653
2654=back
2655
2656=head2 Prototypes of built-in keywords
2657
2658=over
2659
2660=item *
2661
2662The C<prototype> function no longer dies for the C<__FILE__>, C<__LINE__>
2663and C<__PACKAGE__> directives. It now returns an empty-string prototype
2664for them, because they are syntactically indistinguishable from nullary
2665functions like C<time>.
2666
2667=item *
2668
2669C<prototype> now returns C<undef> for all overridable infix operators,
2670such as C<eq>, which are not callable in any way resembling functions.
2671It used to return incorrect prototypes for some and die for others
2672[perl #94984].
2673
2674=item *
2675
2676The prototypes of several built-in functions--C<getprotobynumber>, C<lock>,
2677C<not> and C<select>--have been corrected, or at least are now closer to
2678reality than before.
2679
2680=back
2681
2682=head2 Regular expressions
2683
2684=for comment Is it possible to merge some of these items?
2685
2686=over 4
2687
2688=item *
2689
2690C</[[:ascii:]]/> and C</[[:blank:]]/> now use locale rules under
2691C<use locale> when the platform supports that. Previously, they used
2692the platform's native character set.
2693
2694=item *
2695
2696C<m/[[:ascii:]]/i> and C</\p{ASCII}/i> now match identically (when not
2697under a differing locale). This fixes a regression introduced in 5.14
2698in which the first expression could match characters outside of ASCII,
2699such as the KELVIN SIGN.
2700
2701=item *
2702
2703C</.*/g> would sometimes refuse to match at the end of a string that ends
2704with "\n". This has been fixed [perl #109206].
2705
2706=item *
2707
2708Starting with 5.12.0, Perl used to get its internal bookkeeping muddled up
2709after assigning C<${ qr// }> to a hash element and locking it with
2710L<Hash::Util>. This could result in double frees, crashes or erratic
2711behaviour.
2712
2713=item *
2714
2715The new (in 5.14.0) regular expression modifier C</a> when repeated like
2716C</aa> forbids the characters outside the ASCII range that match
2717characters inside that range from matching under C</i>. This did not
2718work under some circumstances, all involving alternation, such as:
2719
2720 "\N{KELVIN SIGN}" =~ /k|foo/iaa;
2721
2722succeeded inappropriately. This is now fixed.
2723
2724=item *
2725
27265.14.0 introduced some memory leaks in regular expression character
2727classes such as C<[\w\s]>, which have now been fixed. (5.14.1)
2728
2729=item *
2730
2731An edge case in regular expression matching could potentially loop.
2732This happened only under C</i> in bracketed character classes that have
2733characters with multi-character folds, and the target string to match
2734against includes the first portion of the fold, followed by another
2735character that has a multi-character fold that begins with the remaining
2736portion of the fold, plus some more.
2737
2738 "s\N{U+DF}" =~ /[\x{DF}foo]/i
2739
2740is one such case. C<\xDF> folds to C<"ss">. (5.14.1)
2741
2742=item *
2743
2744A few characters in regular expression pattern matches did not
2745match correctly in some circumstances, all involving C</i>. The
2746affected characters are:
2747COMBINING GREEK YPOGEGRAMMENI,
2748GREEK CAPITAL LETTER IOTA,
2749GREEK CAPITAL LETTER UPSILON,
2750GREEK PROSGEGRAMMENI,
2751GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA,
2752GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS,
2753GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA,
2754GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS,
2755LATIN SMALL LETTER LONG S,
2756LATIN SMALL LIGATURE LONG S T,
2757and
2758LATIN SMALL LIGATURE ST.
2759
2760=item *
2761
2762A memory leak regression in regular expression compilation
2763under threading has been fixed.
2764
2765=item *
2766
2767A regression introduced in 5.13.6 has
2768been fixed. This involved an inverted
2769bracketed character class in a regular expression that consisted solely
2770of a Unicode property. That property wasn't getting inverted outside the
2771Latin1 range.
2772
2773=item *
2774
2775Three problematic Unicode characters now work better in regex pattern matching under C</i>
2776
2777In the past, three Unicode characters:
2778LATIN SMALL LETTER SHARP S,
2779GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS,
2780and
2781GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS,
2782along with the sequences that they fold to
2783(including "ss" in the case of LATIN SMALL LETTER SHARP S),
2784did not properly match under C</i>. 5.14.0 fixed some of these cases,
2785but introduced others, including a panic when one of the characters or
2786sequences was used in the C<(?(DEFINE)> regular expression predicate.
2787The known bugs that were introduced in 5.14 have now been fixed; as well
2788as some other edge cases that have never worked until now. All these
2789involve using the characters and sequences outside bracketed character
2790classes under C</i>. This closes [perl #98546].
2791
2792There remain known problems when using certain characters with
2793multi-character folds inside bracketed character classes, including such
2794constructs as C<qr/[\N{LATIN SMALL LETTER SHARP}a-z]/i>. These
2795remaining bugs are addressed in [perl #89774].
2796
2797=item *
2798
2799RT #78266: The regex engine has been leaking memory when accessing
2800named captures that weren't matched as part of a regex ever since 5.10
2801when they were introduced, e.g. this would consume over a hundred MB of
2802memory:
2803
2804 for (1..10_000_000) {
2805 if ("foo" =~ /(foo|(?<capture>bar))?/) {
2806 my $capture = $+{capture}
2807 }
2808 }
2809 system "ps -o rss $$"'
2810
2811=item *
2812
2813In 5.14, C</[[:lower:]]/i> and C</[[:upper:]]/i> no longer matched the
2814opposite case. This has been fixed [perl #101970].
2815
2816=item *
2817
2818A regular expression match with an overloaded object on the right-hand side
2819would in some cases stringify the object too many times.
2820
2821=item *
2822
2823A regression has been fixed that was introduced in 5.14, in C</i>
2824regular expression matching, in which a match improperly fails if the
2825pattern is in UTF-8, the target string is not, and a Latin-1 character
2826precedes a character in the string that should match the pattern.
2827[perl #101710]
2828
2829=item *
2830
2831In case-insensitive regular expression pattern matching, no longer on
2832UTF-8 encoded strings does the scan for the start of match only look at
2833the first possible position. This caused matches such as
2834C<"f\x{FB00}" =~ /ff/i> to fail.
2835
2836=item *
2837
2838The regexp optimiser no longer crashes on debugging builds when merging
2839fixed-string nodes with inconvenient contents.
2840
2841=item *
2842
2843A panic involving the combination of the regular expression modifiers
2844C</aa> and the C<\b> escape sequence introduced in 5.14.0 has been
2845fixed [perl #95964].
2846
2847=item *
2848
2849The combination of the regular expression modifiers C</aa> and the C<\b>
2850and C<\B> escape sequences did not work properly on UTF-8 encoded
2851strings. All non-ASCII characters under C</aa> should be treated as
2852non-word characters, but what was happening was that Unicode rules were
2853used to determine wordness/non-wordness for non-ASCII characters. This
2854is now fixed [perl #95968].
2855
2856=item *
2857
2858C<< (?foo: ...) >> no longer loses passed in character set.
2859
2860=item *
2861
2862The trie optimisation used to have problems with alternations containing
2863an empty C<(?:)>, causing C<< "x" =~ /\A(?>(?:(?:)A|B|C?x))\z/ >> not to
2864match, whereas it should [perl #111842].
2865
2866=item *
2867
2868Use of lexical (C<my>) variables in code blocks embedded in regular
2869expressions will no longer result in memory corruption or crashes.
2870
2871Nevertheless, these code blocks are still experimental, as there are still
2872problems with the wrong variables being closed over (in loops for instance)
2873and with abnormal exiting (e.g., C<die>) causing memory corruption.
2874
2875=item *
2876
2877The C<\h>, C<\H>, C<\v> and C<\V> regular expression metacharacters used to
2878cause a panic error message when attempting to match at the end of the
2879string [perl #96354].
2880
2881=item *
2882
2883The abbreviations for four C1 control characters C<MW> C<PM>, C<RI>, and
2884C<ST> were previously unrecognized by C<\N{}>, vianame(), and
2885string_vianame().
2886
2887=item *
2888
2889Mentioning a variable named "&" other than C<$&> (i.e., C<@&> or C<%&>) no
2890longer stops C<$&> from working. The same applies to variables named "'"
2891and "`" [perl #24237].
2892
2893=item *
2894
2895Creating a C<UNIVERSAL::AUTOLOAD> sub no longer stops C<%+>, C<%-> and
2896C<%!> from working some of the time [perl #105024].
2897
2898=back
2899
2900=head2 Smartmatching
2901
2902=over
2903
2904=item *
2905
2906C<~~> now correctly handles the precedence of Any~~Object, and is not tricked
2907by an overloaded object on the left-hand side.
2908
2909=item *
2910
2911In Perl 5.14.0, C<$tainted ~~ @array> stopped working properly. Sometimes
2912it would erroneously fail (when C<$tainted> contained a string that occurs
2913in the array I<after> the first element) or erroneously succeed (when
2914C<undef> occurred after the first element) [perl #93590].
2915
2916=back
2917
2918=head2 The C<sort> operator
2919
2920=over
2921
2922=item *
2923
2924C<sort> was not treating C<sub {}> and C<sub {()}> as equivalent when
2925such a sub was provided as the comparison routine. It used to croak on
2926C<sub {()}>.
2927
2928=item *
2929
2930C<sort> now works once more with custom sort routines that are XSUBs. It
2931stopped working in 5.10.0.
2932
2933=item *
2934
2935C<sort> with a constant for a custom sort routine, although it produces
2936unsorted results, no longer crashes. It started crashing in 5.10.0.
2937
2938=item *
2939
2940Warnings emitted by C<sort> when a custom comparison routine returns a
2941non-numeric value now contain "in sort" and show the line number of the
2942C<sort> operator, rather than the last line of the comparison routine. The
2943warnings also occur now only if warnings are enabled in the scope where
2944C<sort> occurs. Previously the warnings would occur if enabled in the
2945comparison routine's scope.
2946
2947=item *
2948
2949C<< sort { $a <=> $b } >>, which is optimised internally, now produces
2950"uninitialized" warnings for NaNs (not-a-number values), since C<< <=> >>
2951returns C<undef> for those. This brings it in line with
2952S<C<< sort { 1; $a <=> $b } >>> and other more complex cases, which are not
2953optimised [perl #94390].
2954
2955=back
2956
2957=head2 The C<substr> operator
2958
2959=over
2960
2961=item *
88c5c971 2962
05c8f9ed
RS
2963Tied (and otherwise magical) variables are no longer exempt from the
2964"Attempt to use reference as lvalue in substr" warning.
8f12b018 2965
05c8f9ed 2966=item *
8f12b018 2967
05c8f9ed
RS
2968That warning now occurs when the returned lvalue is assigned to, not
2969when C<substr> itself is called. This only makes a difference if the
2970return value of C<substr> is referenced and assigned to later.
26afcec5 2971
05c8f9ed 2972=item *
8f12b018 2973
05c8f9ed
RS
2974Passing a substring of a read-only value or a typeglob to a function
2975(potential lvalue context) no longer causes an immediate "Can't coerce"
2976or "Modification of a read-only value" error. That error only occurs
2977if and when the value passed is assigned to.
d7fbd56d 2978
05c8f9ed
RS
2979The same thing happens with the "substr outside of string" error. If
2980the lvalue is only read, not written to, it is now just a warning, as
2981with rvalue C<substr>.
d7fbd56d 2982
05c8f9ed 2983=item *
d5dc7001 2984
05c8f9ed
RS
2985C<substr> assignments no longer call FETCH twice if the first argument
2986is a tied variable, just once.
d5dc7001 2987
05c8f9ed 2988=back
711a3903 2989
05c8f9ed 2990=head2 Support for embedded nulls
977c1d31 2991
05c8f9ed
RS
2992Some parts of Perl did not work correctly with nulls (C<chr 0>) embedded in
2993strings. That meant that, for instance, C<< $m = "a\0b"; foo->$m >> would
2994call the "a" method, instead of the actual method name contained in $m.
2995These parts of perl have been fixed to support nulls:
27f00e3d 2996
05c8f9ed 2997=over
6ba817f3 2998
05c8f9ed 2999=item *
2630d42b 3000
05c8f9ed 3001Method names
7620cb10 3002
05c8f9ed 3003=item *
d7c042c9 3004
05c8f9ed 3005Typeglob names (including filehandle and subroutine names)
d7c042c9 3006
05c8f9ed 3007=item *
d7c042c9 3008
05c8f9ed 3009Package names, including the return value of C<ref()>
985213f2 3010
05c8f9ed 3011=item *
977c1d31 3012
05c8f9ed 3013Typeglob elements (C<*foo{"THING\0stuff"}>)
977c1d31 3014
05c8f9ed 3015=item *
985213f2 3016
05c8f9ed 3017Signal names
985213f2 3018
204b72a4 3019=item *
2e2b2571 3020
05c8f9ed
RS
3021Various warnings and error messages that mention variable names or values,
3022methods, etc.
2e2b2571 3023
204b72a4 3024=back
b240fc0f 3025
05c8f9ed
RS
3026One side effect of these changes is that blessing into "\0" no longer
3027causes C<ref()> to return false.
27f00e3d 3028
05c8f9ed 3029=head2 Threading bugs
27f00e3d 3030
05c8f9ed 3031=over
cadced9f 3032
05c8f9ed 3033=item *
cadced9f 3034
05c8f9ed
RS
3035Typeglobs returned from threads are no longer cloned if the parent thread
3036already has a glob with the same name. This means that returned
3037subroutines will now assign to the right package variables [perl #107366].
3038
3039=item *
3040
3041Some cases of threads crashing due to memory allocation during cloning have
3042been fixed [perl #90006].
632c5d30
NC
3043
3044=item *
3045
05c8f9ed
RS
3046Thread joining would sometimes emit "Attempt to free unreferenced scalar"
3047warnings if C<caller> had been used from the C<DB> package prior to thread
3048creation [perl #98092].
3049
3050=item *
3051
3052Locking a subroutine (via C<lock &sub>) is no longer a compile-time error
3053for regular subs. For lvalue subroutines, it no longer tries to return the
3054sub as a scalar, resulting in strange side effects like C<ref \$_>
3055returning "CODE" in some instances.
3056
3057C<lock &sub> is now a run-time error if L<threads::shared> is loaded (a
3058no-op otherwise), but that may be rectified in a future version.
95ce428c 3059
2630d42b 3060=back
95ce428c 3061
05c8f9ed 3062=head2 Tied variables
4e6e9b23 3063
05c8f9ed 3064=over
4e6e9b23 3065
c88a046d 3066=item *
4e6e9b23 3067
05c8f9ed
RS
3068Various cases in which FETCH was being ignored or called too many times
3069have been fixed:
1887da8c 3070
05c8f9ed 3071=over
58856662 3072
05c8f9ed 3073=item *
c88a046d 3074
05c8f9ed 3075C<PerlIO::get_layers> [perl #97956]
58856662
NC
3076
3077=item *
3078
05c8f9ed
RS
3079C<$tied =~ y/a/b/>, C<chop $tied> and C<chomp $tied> when $tied holds a
3080reference.
d333a655 3081
05c8f9ed 3082=item *
589c1691 3083
05c8f9ed 3084When calling C<local $_> [perl #105912]
fae9e8f4 3085
05c8f9ed 3086=item *
fae9e8f4 3087
05c8f9ed 3088Four-argument C<select>
58856662 3089
05c8f9ed
RS
3090=item *
3091
3092A tied buffer passed to C<sysread>
c11980ad 3093
05c8f9ed 3094=item *
c11980ad 3095
05c8f9ed 3096C<< $tied .= <> >>
c88a046d 3097
05c8f9ed 3098=item *
c88a046d 3099
05c8f9ed
RS
3100Three-argument C<open>, the third being a tied file handle
3101(as in C<< open $fh, ">&", $tied >>)
2630d42b 3102
05c8f9ed 3103=item *
c88a046d 3104
05c8f9ed 3105C<sort> with a reference to a tied glob for the comparison routine.
c88a046d
A
3106
3107=item *
3108
05c8f9ed 3109C<..> and C<...> in list context [perl #53554].
c88a046d 3110
05c8f9ed 3111=item *
c88a046d 3112
05c8f9ed
RS
3113C<${$tied}>, C<@{$tied}>, C<%{$tied}> and C<*{$tied}> where the tied
3114variable returns a string (C<&{}> was unaffected)
c88a046d 3115
05c8f9ed 3116=item *
c88a046d 3117
05c8f9ed
RS
3118C<defined ${ $tied_variable }>
3119
3120=item *
c88a046d 3121
05c8f9ed
RS
3122Various functions that take a filehandle argument in rvalue context
3123(C<close>, C<readline>, etc.) [perl #97482]
c88a046d 3124
05c8f9ed 3125=item *
c11980ad 3126
05c8f9ed
RS
3127Some cases of dereferencing a complex expression, such as
3128C<${ (), $tied } = 1>, used to call C<FETCH> multiple times, but now call
3129it once.
c11980ad 3130
05c8f9ed 3131=item *
c88a046d 3132
05c8f9ed
RS
3133C<$tied-E<gt>method> where $tied returns a package name--even resulting in
3134a failure to call the method, due to memory corruption
6c69e197 3135
05c8f9ed 3136=item *
c88a046d 3137
05c8f9ed 3138Assignments like C<*$tied = \&{"..."}> and C<*glob = $tied>
c88a046d
A
3139
3140=item *
3141
05c8f9ed
RS
3142C<chdir>, C<chmod>, C<chown>, C<utime>, C<truncate>, C<stat>, C<lstat> and
3143the filetest ops (C<-r>, C<-x>, etc.)
c88a046d 3144
2630d42b 3145=back
c88a046d 3146
05c8f9ed 3147=item *
2630d42b 3148
05c8f9ed
RS
3149C<caller> sets C<@DB::args> to the subroutine arguments when called from
3150the DB package. It used to crash when doing so if C<@DB::args> happened to
3151be tied. Now it croaks instead.
84ecb73f 3152
fae9e8f4
A
3153=item *
3154
05c8f9ed
RS
3155Tying an element of %ENV or C<%^H> and then deleting that element would
3156result in a call to the tie object's DELETE method, even though tying the
3157element itself is supposed to be equivalent to tying a scalar (the element
3158is, of course, a scalar) [perl #67490].
fae9e8f4 3159
05c8f9ed 3160=item *
a3cc0403 3161
05c8f9ed
RS
3162When Perl autovivifies an element of a tied array or hash (which entails
3163calling STORE with a new reference), it now calls FETCH immediately after
3164the STORE, instead of assuming that FETCH would have returned the same
3165reference. This can make it easier to implement tied objects [perl #35865, #43011].
c88a046d 3166
05c8f9ed 3167=item *
75ff5956 3168
05c8f9ed
RS
3169Four-argument C<select> no longer produces its "Non-string passed as
3170bitmask" warning on tied or tainted variables that are strings.
3171
3172=item *
3173
3174Localising a tied scalar that returns a typeglob no longer stops it from
3175being tied till the end of the scope.
3176
3177=item *
3178
3179Attempting to C<goto> out of a tied handle method used to cause memory
3180corruption or crashes. Now it produces an error message instead
3181[perl #8611].
75ff5956 3182
2630d42b 3183=item *
c11980ad 3184
05c8f9ed
RS
3185A bug has been fixed that occurs when a tied variable is used as a
3186subroutine reference: if the last thing assigned to or returned from the
3187variable was a reference or typeglob, the C<\&$tied> could either crash or
3188return the wrong subroutine. The reference case is a regression introduced
3189in Perl 5.10.0. For typeglobs, it has probably never worked till now.
843331c7 3190
2630d42b 3191=back
c11980ad 3192
05c8f9ed 3193=head2 Version objects and vstrings
2a7afa74 3194
05c8f9ed 3195=over
ecd144ea 3196
05c8f9ed 3197=item *
c11980ad 3198
05c8f9ed
RS
3199The bitwise complement operator (and possibly other operators, too) when
3200passed a vstring would leave vstring magic attached to the return value,
3201even though the string had changed. This meant that
3202C<< version->new(~v1.2.3) >> would create a version looking like "v1.2.3"
3203even though the string passed to C<< version->new >> was actually
3204"\376\375\374". This also caused L<B::Deparse> to deparse C<~v1.2.3>
3205incorrectly, without the C<~> [perl #29070].
c11980ad 3206
05c8f9ed
RS
3207=item *
3208
3209Assigning a vstring to a magic (e.g., tied, C<$!>) variable and then
3210assigning something else used to blow away all the magic. This meant that
3211tied variables would come undone, C<$!> would stop getting updated on
3212failed system calls, C<$|> would stop setting autoflush, and other
3213mischief would take place. This has been fixed.
3214
3215=item *
3216
3217C<< version->new("version") >> and C<printf "%vd", "version"> no longer
3218crash [perl #102586].
ecd144ea
FC
3219
3220=item *
3221
05c8f9ed
RS
3222Version comparisons, such as those that happen implicitly with C<use
3223v5.43>, no longer cause locale settings to change [perl #105784].
3224
3225=item *
3226
3227Version objects no longer cause memory leaks in boolean context
3228[perl #109762].
9dea6244 3229
204b72a4 3230=back
9dea6244 3231
05c8f9ed 3232=head2 Warnings, redefinition
c11980ad 3233
05c8f9ed 3234=over
2a7afa74 3235
05c8f9ed 3236=item *
e9e4ee62 3237
05c8f9ed
RS
3238Subroutines from the C<autouse> namespace are once more exempt from
3239redefinition warnings. This used to work in 5.005, but was broken in
32405.6 for most subroutines. For subs created via XS that redefine
3241subroutines from the C<autouse> package, this stopped working in 5.10.
937a45d0 3242
ef337e16
CBW
3243=item *
3244
05c8f9ed
RS
3245New XSUBs now produce redefinition warnings if they overwrite existing
3246subs, as they did in 5.8.x. (The C<autouse> logic was reversed in
32475.10-14. Only subroutines from the C<autouse> namespace would warn
3248when clobbered.)
ef337e16 3249
05c8f9ed 3250=item *
679b54e7 3251
05c8f9ed
RS
3252C<newCONSTSUB> used to use compile-time warning hints, instead of
3253run-time hints. The following code should never produce a redefinition
3254warning, but it used to, if C<newCONSTSUB> redefined an existing
3255subroutine:
39de7394 3256
05c8f9ed
RS
3257 use warnings;
3258 BEGIN {
3259 no warnings;
3260 some_XS_function_that_calls_new_CONSTSUB();
3261 }
2630d42b 3262
05c8f9ed 3263=item *
2630d42b 3264
05c8f9ed
RS
3265Redefinition warnings for constant subroutines are on by default (what
3266are known as severe warnings in L<perldiag>). This was only the case
3267when it was a glob assignment or declaration of a Perl subroutine that
3268caused the warning. If the creation of XSUBs triggered the warning, it
3269was not a default warning. This has been corrected.
52272450 3270
84ecb73f
S
3271=item *
3272
05c8f9ed
RS
3273The internal check to see whether a redefinition warning should occur
3274used to emit "uninitialized" warnings in cases like this:
3275
3276 use warnings "uninitialized";
3277 use constant {u => undef, v => undef};
3278 sub foo(){u}
3279 sub foo(){v}
84ecb73f 3280
52deee2e 3281=back
5dd80d85 3282
05c8f9ed 3283=head2 Warnings, "Uninitialized"
52272450 3284
05c8f9ed 3285=over
249950d7 3286
05c8f9ed
RS
3287=item *
3288
3289Various functions that take a filehandle argument in rvalue context
3290(C<close>, C<readline>, etc.) used to warn twice for an undefined handle
3291[perl #97482].
a1d95121 3292
05c8f9ed 3293=item *
977c1d31 3294
05c8f9ed
RS
3295C<dbmopen> now only warns once, rather than three times, if the mode
3296argument is C<undef> [perl #90064].
977c1d31 3297
05c8f9ed
RS
3298=item *
3299
3300The C<+=> operator does not usually warn when the left-hand side is
3301C<undef>, but it was doing so for tied variables. This has been fixed
3302[perl #44895].
3303
3304=item *
977c1d31 3305
05c8f9ed
RS
3306A bug fix in Perl 5.14 introduced a new bug, causing "uninitialized"
3307warnings to report the wrong variable if the operator in question had
3308two operands and one was C<%{...}> or C<@{...}>. This has been fixed
3309[perl #103766].
39ea6a4b 3310
05c8f9ed
RS
3311=item *
3312
3313C<..> and C<...> in list context now mention the name of the variable in
3314"uninitialized" warnings for string (as opposed to numeric) ranges.
39ea6a4b 3315
977c1d31 3316=back
ea317ccb 3317
05c8f9ed 3318=head2 Weak references
a7bff800 3319
05c8f9ed 3320=over
0aae26c1 3321
05c8f9ed
RS
3322=item *
3323
3324Weakening the first argument to an automatically-invoked C<DESTROY> method
3325could result in erroneous "DESTROY created new reference" errors or
3326crashes. Now it is an error to weaken a read-only reference.
3327
3328=item *
3329
3330Weak references to lexical hashes going out of scope were not going stale
3331(becoming undefined), but continued to point to the hash.
0aae26c1 3332
05c8f9ed
RS
3333=item *
3334
3335Weak references to lexical variables going out of scope are now broken
3336before any magical methods (e.g., DESTROY on a tie object) are called.
3337This prevents such methods from modifying the variable that will be seen
3338the next time the scope is entered.
3339
3340=item *
d5dc7001 3341
05c8f9ed
RS
3342Creating a weak reference to an @ISA array or accessing the array index
3343(C<$#ISA>) could result in confused internal bookkeeping for elements
3344subsequently added to the @ISA array. For instance, creating a weak
3345reference to the element itself could push that weak reference on to @ISA;
3346and elements added after use of C<$#ISA> would be ignored by method lookup
3347[perl #85670].
d5dc7001 3348
2630d42b 3349=back
d5dc7001 3350
05c8f9ed 3351=head2 Other notable fixes
d5dc7001 3352
05c8f9ed 3353=over
d5dc7001 3354
05c8f9ed 3355=item *
d5dc7001 3356
05c8f9ed
RS
3357C<quotemeta> now quotes consistently the same non-ASCII characters under
3358C<use feature 'unicode_strings'>, regardless of whether the string is
3359encoded in UTF-8 or not, hence fixing the last vestiges (we hope) of the
3360infamous L<perlunicode/The "Unicode Bug">. [perl #77654].
d5dc7001 3361
05c8f9ed
RS
3362Which of these code points is quoted has changed, based on Unicode's
3363recommendations. See L<perlfunc/quotemeta> for details.
d5dc7001 3364
05c8f9ed 3365=item *
d5dc7001 3366
05c8f9ed
RS
3367When one writes C<open foo || die>, which used to work in Perl 4, a
3368"Precedence problem" warning is produced. This warning used erroneously to
3369apply to fully-qualified bareword handle names not followed by C<||>. This
3370has been corrected.
d5dc7001 3371
05c8f9ed 3372=item *
d5dc7001 3373
05c8f9ed
RS
3374After package aliasing (C<*foo:: = *bar::>), C<select> with 0 or 1 argument
3375would sometimes return a name that could not be used to refer to the
3376filehandle, or sometimes it would return C<undef> even when a filehandle
3377was selected. Now it returns a typeglob reference in such cases.
d5dc7001 3378
05c8f9ed
RS
3379=item *
3380
3381C<PerlIO::get_layers> no longer ignores some arguments that it thinks are
3382numeric, while treating others as filehandle names. It is now consistent
3383for flat scalars (i.e., not references).
d5dc7001
A
3384
3385=item *
3386
05c8f9ed 3387Unrecognised switches on C<#!> line
0aae26c1 3388
05c8f9ed
RS
3389If a switch, such as B<-x>, that cannot occur on the C<#!> line is used
3390there, perl dies with "Can't emulate...".
0aae26c1 3391
05c8f9ed
RS
3392It used to produce the same message for switches that perl did not
3393recognise at all, whether on the command line or the C<#!> line.
e2e06450 3394
05c8f9ed 3395Now it produces the "Unrecognized switch" error message [perl #104288].
ccfdda5c 3396
05c8f9ed 3397=item *
e2e06450 3398
05c8f9ed
RS
3399C<system> now temporarily blocks the SIGCHLD signal handler, to prevent the
3400signal handler from stealing the exit status [perl #105700].
3401
3402=item *
3403
3404The %n formatting code for C<printf> and C<sprintf>, which causes the number
3405of characters to be assigned to the next argument, now actually
3406assigns the number of characters, instead of the number of bytes.
3407
3408It also works now with special lvalue functions like C<substr> and with
3409nonexistent hash and array elements [perl #3471, #103492].
3410
3411=item *
3412
3413Perl skips copying values returned from a subroutine, for the sake of
3414speed, if doing so would make no observable difference. Due to faulty
3415logic, this would happen with the
3416result of C<delete>, C<shift> or C<splice>, even if the result was
3417referenced elsewhere. It also did so with tied variables about to be freed
3418[perl #91844, #95548].
3419
3420=item *
3421
3422C<utf8::decode> now refuses to modify read-only scalars [perl #91850].
3423
3424=item *
3425
3426Freeing $_ inside a C<grep> or C<map> block, a code block embedded in a
3427regular expression, or an @INC filter (a subroutine returned by a
3428subroutine in @INC) used to result in double frees or crashes
3429[perl #91880, #92254, #92256].
3430
3431=item *
3432
3433C<eval> returns C<undef> in scalar context or an empty list in list
3434context when there is a run-time error. When C<eval> was passed a
3435string in list context and a syntax error occurred, it used to return a
3436list containing a single undefined element. Now it returns an empty
3437list in list context for all errors [perl #80630].
3438
3439=item *
3440
3441C<goto &func> no longer crashes, but produces an error message, when
3442the unwinding of the current subroutine's scope fires a destructor that
3443undefines the subroutine being "goneto" [perl #99850].
3444
3445=item *
3446
3447Perl now holds an extra reference count on the package that code is
3448currently compiling in. This means that the following code no longer
3449crashes [perl #101486]:
3450
3451 package Foo;
3452 BEGIN {*Foo:: = *Bar::}
3453 sub foo;
3454
3455=item *
3456
3457The C<x> repetition operator no longer crashes on 64-bit builds with large
3458repeat counts [perl #94560].
3459
3460=item *
3461
3462Calling C<require> on an implicit C<$_> when C<*CORE::GLOBAL::require> has
3463been overridden does not segfault anymore, and C<$_> is now passed to the
3464overriding subroutine [perl #78260].
3465
3466=item *
3467
3468C<use> and C<require> are no longer affected by the I/O layers active in
3469the caller's scope (enabled by L<open.pm|open>) [perl #96008].
3470
3471=item *
3472
3473C<our $::é; $é> (which is invalid) no longer produces the "Compilation
3474error at lib/utf8_heavy.pl..." error message, which it started emitting in
34755.10.0 [perl #99984].
3476
3477=item *
3478
3479On 64-bit systems, C<read()> now understands large string offsets beyond
3480the 32-bit range.
3481
3482=item *
3483
3484Errors that occur when processing subroutine attributes no longer cause the
3485subroutine's op tree to leak.
3486
3487=item *
3488
3489Passing the same constant subroutine to both C<index> and C<formline> no
3490longer causes one or the other to fail [perl #89218]. (5.14.1)
3491
3492=item *
3493
3494List assignment to lexical variables declared with attributes in the same
3495statement (C<my ($x,@y) : blimp = (72,94)>) stopped working in Perl 5.8.0.
3496It has now been fixed.
3497
3498=item *
3499
3500Perl 5.10.0 introduced some faulty logic that made "U*" in the middle of
3501a pack template equivalent to "U0" if the input string was empty. This has
3502been fixed [perl #90160].
3503
3504=item *
3505
3506Destructors on objects were not called during global destruction on objects
3507that were not referenced by any scalars. This could happen if an array
3508element were blessed (e.g., C<bless \$a[0]>) or if a closure referenced a
3509blessed variable (C<bless \my @a; sub foo { @a }>).
3510
3511Now there is an extra pass during global destruction to fire destructors on
3512any objects that might be left after the usual passes that check for
3513objects referenced by scalars [perl #36347].
3514
3515=item *
3516
3517Fixed a case where it was possible that a freed buffer may have been read
3518from when parsing a here document [perl #90128]. (5.14.1)
3519
3520=item *
3521
3522C<each(I<ARRAY>)> is now wrapped in C<defined(...)>, like C<each(I<HASH>)>,
3523inside a C<while> condition [perl #90888].
3524
3525=item *
3526
3527A problem with context propagation when a C<do> block is an argument to
3528C<return> has been fixed. It used to cause C<undef> to be returned in
3529some cases of a C<return> inside an C<if> block which itself is followed by
3530another C<return>.
3531
3532=item *
3533
3534Calling C<index> with a tainted constant no longer causes constants in
3535subsequently compiled code to become tainted [perl #64804].
3536
3537=item *
3538
3539Infinite loops like C<1 while 1> used to stop C<strict 'subs'> mode from
3540working for the rest of the block.t
3541
3542=item *
3543
3544For list assignments like C<($a,$b) = ($b,$a)>, Perl has to make a copy of
3545the items on the right-hand side before assignment them to the left. For
3546efficiency's sake, it assigns the values on the right straight to the items
3547on the left if no one variable is mentioned on both sides, as in C<($a,$b) =
3548($c,$d)>. The logic for determining when it can cheat was faulty, in that
3549C<&&> and C<||> on the right-hand side could fool it. So C<($a,$b) =
3550$some_true_value && ($b,$a)> would end up assigning the value of C<$b> to
3551both scalars.
3552
3553=item *
3554
3555Perl no longer tries to apply lvalue context to the string in
3556C<("string", $variable) ||= 1> (which used to be an error). Since the
3557left-hand side of C<||=> is evaluated in scalar context, that's a scalar
3558comma operator, which gives all but the last item void context. There is
3559no such thing as void lvalue context, so it was a mistake for Perl to try
3560to force it [perl #96942].
3561
3562=item *
3563
3564C<caller> no longer leaks memory when called from the DB package if
3565C<@DB::args> was assigned to after the first call to C<caller>. L<Carp>
3566was triggering this bug [perl #97010].
3567
3568=item *
3569
3570C<close> and similar filehandle functions, when called on built-in global
3571variables (like C<$+>), used to die if the variable happened to hold the
3572undefined value, instead of producing the usual "Use of uninitialized
3573value" warning.
3574
3575=item *
3576
3577When autovivified file handles were introduced in Perl 5.6.0, C<readline>
3578was inadvertently made to autovivify when called as C<readline($foo)> (but
3579not as C<E<lt>$fooE<gt>>). It has now been fixed never to autovivify.
3580
3581=item *
3582
3583Calling an undefined anonymous subroutine (e.g., what $x holds after
3584C<undef &{$x = sub{}}>) used to cause a "Not a CODE reference" error, which
3585has been corrected to "Undefined subroutine called" [perl #71154].
3586
3587=item *
3588
3589Causing C<@DB::args> to be freed between uses of C<caller> no longer
3590results in a crash [perl #93320].
3591
3592=item *
3593
3594C<setpgrp($foo)> used to be equivalent to C<($foo, setpgrp)>, because
3595C<setpgrp> was ignoring its argument if there was just one. Now it is
3596equivalent to C<setpgrp($foo,0)>.
3597
3598=item *
3599
3600C<shmread> was not setting the scalar flags correctly when reading from
3601shared memory, causing the existing cached numeric representation in the
3602scalar to persist [perl #98480].
3603
3604=item *
3605
3606C<++> and C<--> now work on copies of globs, instead of dying.
3607
3608=item *
3609
3610C<splice()> doesn't warn when truncating
3611
3612You can now limit the size of an array using C<splice(@a,MAX_LEN)> without
3613worrying about warnings.
3614
3615=item *
3616
3617C<< $$ >> is no longer tainted. Since this value comes directly from
3618C<< getpid() >>, it is always safe.
e2e06450 3619
2630d42b 3620=item *
e2e06450 3621
05c8f9ed
RS
3622The parser no longer leaks a filehandle if STDIN was closed before parsing
3623started [perl #37033].
3624
3625=item *
3626
3627C<< die; >> with a non-reference, non-string, or magical (e.g., tainted)
3628value in $@ now properly propagates that value [perl #111654].
e2e06450 3629
2630d42b 3630=back
e2e06450 3631
2630d42b 3632=head1 Known Problems
e2e06450 3633
05c8f9ed
RS
3634=over 4
3635
3636=item *
2e2b2571 3637
05c8f9ed 3638On Solaris, we have two kinds of failure.
2e2b2571 3639
05c8f9ed
RS
3640If F<make> is Sun's F<make≥>, we get an error about a badly formed macro
3641assignment in the F<Makefile>. That happens when F<./Configure> tries to
3642make depends. F<Configure> then exits 0, but further F<make>-ing fails.
e2e06450 3643
05c8f9ed
RS
3644If F<make> is F<gmake>, F<Configure> completes, then we get errors related
3645to F</usr/include/stdbool.h>
e2e06450 3646
2630d42b 3647=item *
ea88c40c 3648
05c8f9ed
RS
3649The following CPAN modules have test failures with perl 5.16. Patches have
3650been submitted for all of these, so hopefully there will be new releases
3651soon:
18af289e 3652
05c8f9ed
RS
3653=over
3654
3655=item *
3656
3657L<Date::Pcalc> version 6.1
3658
3659=item *
3660
3661L<Module::CPANTS::Analyse> version 0.85
3662
3663This fails due to problems in L<Module::Find> 0.10 and L<File::MMagic>
36641.27.
3665
3666=item *
3667
3668L<PerlIO::Util> version 0.72
c0154fe2 3669
05c8f9ed 3670=back
d5dc7001 3671
05c8f9ed 3672=back
d5dc7001 3673
2630d42b 3674=head1 Acknowledgements
d5dc7001 3675
c73d2bdd
RS
3676Perl 5.16.0 represents approximately 12 months of development since Perl
36775.14.0 and contains approximately 590,000 lines of changes across 2,500
3678files from 137 authors.
3679
3680Perl continues to flourish into its third decade thanks to a vibrant
3681community of users and developers. The following people are known to
3682have contributed the improvements that became Perl 5.14.1:
3683
3684Aaron Crane, Abhijit Menon-Sen, Abigail, Alan Haggai Alavi, Alberto
3685Simões, Alexandr Ciornii, Andreas König, Andy Dougherty, Aristotle
3686Pagaltzis, Bo Johansson, Bo Lindbergh, brian d foy, Brian Fraser, Brian
3687Greenfield, Carl Hayter, Chas. Owens, Chia-liang Kao, Chip Salzenberg,
3688Chris 'BinGOs' Williams, Christian Hansen, Christopher J. Madsen,
3689chromatic, Claes Jacobsson, Claudio Ramirez, Craig A. Berry, Damian
3690Conway, Daniel Kahn Gillmor, Darin McBride, Dave Rolsky, David Cantrell,
3691David Golden, David Leadbeater, David Mitchell, Dee Newcum, Dennis
3692Kaarsemaker, Dominic Hargreaves, Douglas Christopher Wilson, Eric Brine,
3693Father Chrysostomos, Florian Ragwitz, Frederic Briere, George Greer,
3694Gerard Goossen, Gisle Aas, H.Merijn Brand, Hojung Youn, Ian Goodacre,
3695James E Keenan, Jan Dubois, Jerry D. Hedden, Jesse Luehrs, Jesse
3696Vincent, Jilles Tjoelker, Jim Cromie, Jim Meyering, Joel Berger, Johan
3697Vromans, Johannes Plunien, John Hawkinson, John P. Linderman, John
3698Peacock, Joshua ben Jore, Juerd Waalboer, Karl Williamson, Karthik
3699Rajagopalan, Keith Thompson, Kevin J. Woolley, Kevin Ryde, Laurent
3700Dami, Leo Lapworth, Leon Brocard, Leon Timmermans, Louis Strous, Lukas
3701Mai, Marc Green, Marcel Grünauer, Mark A. Stratman, Mark Dootson, Mark
3702Jason Dominus, Martin Hasch, Matthew Horsfall, Max Maischein, Michael G
3703Schwern, Michael Witten, Mike Sheldrake, Moritz Lenz, Nicholas Clark,
3704Niko Tyni, Nuno Carvalho, Pau Amma, Paul Evans, Paul Green, Paul
3705Johnson, Perlover, Peter John Acklam, Peter Martini, Peter Scott, Phil
3706Monsen, Pino Toscano, Rafael Garcia-Suarez, Rainer Tammer, Reini Urban,
3707Ricardo Signes, Robin Barker, Rodolfo Carvalho, Salvador Fandiño, Sam
3708Kimbrel, Samuel Thibault, Shawn M Moore, Shigeya Suzuki, Shlomi Fish,
3709Sisyphus, Slaven Rezic, Spiros Denaxas, Steffen Müller, Steffen
3710Schwigon, Stephen Bennett, Stephen Oberholtzer, Stevan Little, Steve
3711Hay, Steve Peters, Thomas Sibley, Thorsten Glaser, Timothe Litt, Todd
3712Rinaldo, Tom Christiansen, Tom Hukins, Tony Cook, Vadim Konovalov,
3713Vincent Pit, Vladimir Timofeev, Walt Mankowski, Yves Orton, Zefram,
3714Zsbán Ambrus, Ævar Arnfjörð Bjarmason.
3715
3716The list above is almost certainly incomplete as it is automatically
3717generated from version control history. In particular, it does not
3718include the names of the (very much appreciated) contributors who
3719reported issues to the Perl bug tracker.
3720
3721Many of the changes included in this version originated in the CPAN
3722modules included in Perl's core. We're grateful to the entire CPAN
3723community for helping Perl to flourish.
3724
3725For a more complete list of all of Perl's historical contributors,
3726please see the F<AUTHORS> file in the Perl source distribution.
29cf780c 3727
44691e6f
AB
3728=head1 Reporting Bugs
3729
3730If you find what you think is a bug, you might check the articles
52deee2e 3731recently posted to the comp.lang.perl.misc newsgroup and the perl
05c8f9ed
RS
3732bug database at L<http://rt.perl.org/perlbug/>. There may also be
3733information at L<http://www.perl.org/>, the Perl Home Page.
44691e6f
AB
3734
3735If you believe you have an unreported bug, please run the L<perlbug>
52deee2e
DR
3736program included with your release. Be sure to trim your bug down
3737to a tiny but sufficient test case. Your bug report, along with the
3738output of C<perl -V>, will be sent off to perlbug@perl.org to be
3739analysed by the Perl porting team.
44691e6f
AB
3740
3741If the bug you are reporting has security implications, which make it
05c8f9ed
RS
3742inappropriate to send to a publicly archived mailing list, then please
3743send it to perl5-security-report@perl.org. This points to a closed
3744subscription unarchived mailing list, which includes all the core
3745committers, who will be able to help assess the impact of issues, figure
3746out a resolution, and help co-ordinate the release of patches to
3747mitigate or fix the problem across all platforms on which Perl is
3748supported. Please only use this address for security issues in the Perl
3749core, not for modules independently distributed on CPAN.
44691e6f
AB
3750
3751=head1 SEE ALSO
3752
52deee2e
DR
3753The F<Changes> file for an explanation of how to view exhaustive details
3754on what changed.
44691e6f
AB
3755
3756The F<INSTALL> file for how to build Perl.
3757
3758The F<README> file for general stuff.
3759
3760The F<Artistic> and F<Copying> files for copyright information.
3761
3762=cut