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