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