This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Merge branch 'drolsky/release-5.15.6' into blead
[perl5.git] / pod / perldelta.pod
CommitLineData
44691e6f
AB
1=encoding utf8
2
3=head1 NAME
4
0aaeb177 5perldelta - what is new for perl v5.15.6
062678b2 6
0aaeb177 7=head1 DESCRIPTION
ad32999b 8
a29933a3
DR
9This document describes differences between the 5.15.5 release and the
105.15.6 release.
ad32999b 11
0aaeb177
SH
12If you are upgrading from an earlier release such as 5.15.4, first read
13L<perl5155delta>, which describes differences between 5.15.4 and
145.15.5.
ad32999b 15
0aaeb177 16=head1 Core Enhancements
a3f52e2e 17
61f966e7
FC
18=head2 C<__SUB__>
19
a29933a3
DR
20The new C<__SUB__> token, available under the "current_sub" feature
21(see L<feature>) or C<use v5.15>, returns a reference to the current
22subroutine, making it easier to write recursive closures.
61f966e7 23
d1fb015b
FC
24=head2 New option for the debugger's B<t> command
25
a29933a3 26The B<t> command in the debugger, which toggles tracing mode, now
be9a5e16 27accepts a numeric argument that determines how many levels of
a29933a3 28subroutine calls to trace.
d1fb015b 29
7e7629fa
FC
30=head2 Return value of C<tied>
31
a29933a3
DR
32The value returned by C<tied> on a tied variable is now the actual
33scalar that holds the object to which the variable is tied. This
34allows ties to be weakened with C<Scalar::Util::weaken(tied
35$tied_variable)>.
7e7629fa 36
e3c71926 37=head1 Security
6d110ad0 38
6d91e957
KW
39=head2 C<is_utf8_char()>
40
be9a5e16
DR
41The XS-callable function C<is_utf8_char()>, when presented with
42malformed UTF-8 input, can read up to 12 bytes beyond the end of the
a29933a3 43string. This cannot be fixed without changing its API. It is not
be9a5e16 44called from CPAN. The documentation now describes how to use it
a29933a3 45safely.
6d91e957
KW
46
47=head2 Other C<is_utf8_foo()> functions, as well as C<utf8_to_foo()>, etc.
48
49Most of the other XS-callable functions that take UTF-8 encoded input
50implicitly assume that the UTF-8 is valid (not malformed) in regards to
51buffer length. Do not do things such as change a character's case or
52see if it is alphanumeric without first being sure that it is valid
53UTF-8. This can be safely done for a whole string by using one of the
54functions C<is_utf8_string()>, C<is_utf8_string_loc()>, and
55C<is_utf8_string_loclen()>.
6d110ad0 56
7f28d7ed
DR
57=head2 C<use I<VERSION>>
58
a29933a3
DR
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:
7f28d7ed
DR
62
63 use 5.016;
64 # 5.16 features enabled here
65 use 5.014;
66 # 5.16 features disabled here
67
a29933a3
DR
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
7f28d7ed
DR
70when they come first:
71
72 no strict;
73 use 5.012;
74 # no strict here
75
be9a5e16 76There is a new ":default" feature bundle that represents the set of
a29933a3
DR
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.
7f28d7ed
DR
82
83C<$[> is now disabled under C<use v5.16>. It is part of the default
a29933a3
DR
84feature set and can be turned on or off explicitly with C<use feature
85'array_base'>.
7f28d7ed
DR
86
87=head2 C<UNIVERSAL::VERSION>
88
a29933a3
DR
89The change to C<UNIVERSAL::VERSION> in 5.15.2 has been reverted. It
90now returns a stringified version object once more.
7f28d7ed 91
66008486
FC
92=head2 C<substr> lvalue revamp
93
a29933a3
DR
94When C<substr> is called in lvalue or potential lvalue context with two
95or three arguments, a special lvalue scalar is returned that modifies
96the original string (the first argument) when assigned to.
66008486
FC
97
98Previously, the offsets (the second and third arguments) passed to
99C<substr> would be converted immediately to match the string, negative
100offsets being translated to positive and offsets beyond the end of the
101string being truncated.
102
a29933a3
DR
103Now, the offsets are recorded without modification in the special
104lvalue scalar that is returned, and the original string is not even
105looked at by C<substr> itself, but only when the returned lvalue is
106read or modified.
66008486
FC
107
108These changes result in several incompatible changes and bug fixes:
109
110=over
111
112=item *
113
114If the original string changes length after the call to C<substr> but
115before assignment to its return value, negative offsets will remember
116their position from the end of the string, affecting code like this:
117
118 my $string = "string";
119 my $lvalue = \substr $string, -4, 2;
120 print $lvalue, "\n"; # prints "ri"
121 $string = "bailing twine";
122 print $lvalue, "\n"; # prints "wi"; used to print "il"
123
a29933a3
DR
124The same thing happens with an omitted third argument. The returned
125lvalue will always extend to the end of the string, even if the string
126becomes longer.
66008486
FC
127
128=item *
129
130Tied (and otherwise magical) variables are no longer exempt from the
be9a5e16 131"Attempt to use reference as lvalue in substr" warning.
66008486
FC
132
133=item *
134
a29933a3
DR
135That warning now occurs when the returned lvalue is assigned to, not
136when C<substr> itself is called. This only makes a difference if the
137return value of C<substr> is referenced and assigned to later.
66008486
FC
138
139=item *
140
141The order in which "uninitialized" warnings occur for arguments to
142C<substr> has changed.
143
144=item *
145
a29933a3
DR
146Passing a substring of a read-only value or a typeglob to a function
147(potential lvalue context) no longer causes an immediate "Can't coerce"
148or "Modification of a read-only value" error. That error only occurs
149if and when the value passed is assigned to.
66008486 150
a29933a3
DR
151The same thing happens with the "substr outside of string" error. If
152the lvalue is only read, not written to, it is now just a warning, as
153with rvalue C<substr>.
66008486
FC
154
155=item *
156
a29933a3 157C<substr> assignments no longer call FETCH twice if the first argument
be9a5e16 158is a tied variable, just once.
66008486
FC
159
160=back
161
a29933a3
DR
162It was impossible to fix all the bugs without an incompatible change,
163and the behaviour of negative offsets was never specified, so the
164change was deemed acceptable.
66008486 165
d6b99bf4
FC
166=head2 Return value of C<eval>
167
a29933a3 168C<eval> returns C<undef> in scalar context or an empty list in list
be9a5e16
DR
169context when there is a run-time error. When C<eval> was passed a
170string in list context and a syntax error occurred, it used to return a
171list containing a single undefined element. Now it returns an empty
172list in list context for all errors [perl #80630].
d6b99bf4 173
7f28d7ed
DR
174=head2 Anonymous handles
175
176Automatically generated file handles are now named __ANONIO__ when the
177variable name cannot be determined, rather than $__ANONIO__.
178
84b2a83e
FC
179=head2 Last-accessed filehandle
180
181Perl has an internal variable that stores the last filehandle to be
a29933a3
DR
182accessed. It is used by C<$.> and by C<tell> and C<eof> without
183arguments.
84b2a83e 184
be9a5e16
DR
185It used to be possible to set this internal variable to a glob copy and
186then modify that glob copy to be something other than a glob, and still
187have the last-accessed filehandle associated with the variable after
188assigning a glob to it again:
84b2a83e
FC
189
190 my $foo = *STDOUT; # $foo is a glob copy
191 <$foo>; # $foo is now the last-accessed handle
192 $foo = 3; # no longer a glob
193 $foo = *STDERR; # still the last-accessed handle
194
be9a5e16 195Now the C<$foo = 3> assignment unsets that internal variable, so there
a29933a3
DR
196is no last-accessed filehandle, just as if C<< <$foo> >> had never
197happened.
84b2a83e 198
541cb22c
FC
199=head2 XS API tweak
200
201The C<newCONSTSUB_flags> C-level function, added in 5.15.4, now has a
202C<len> parameter.
203
e3c71926 204=head1 Performance Enhancements
6d110ad0 205
e3c71926 206=over 4
6d110ad0
FC
207
208=item *
209
a29933a3 210Perl 5.12.0 sped up the destruction of objects whose classes define
be9a5e16 211empty C<DESTROY> methods (to prevent autoloading), by simply not
a29933a3
DR
212calling such empty methods. This release takes this optimisation a
213step further, by not calling any C<DESTROY> method that begins with a
be9a5e16 214C<return> statement. This can be useful for destructors that are only
a29933a3 215used for debugging:
679b54e7
FC
216
217 use constant DEBUG => 1;
218 sub DESTROY { return unless DEBUG; ... }
219
a29933a3
DR
220Constant-folding will reduce the first statement to C<return;> if DEBUG
221is set to 0, triggering this optimisation.
6d110ad0 222
d1fb015b
FC
223=item *
224
be9a5e16
DR
225Assigning to a variable that holds a typeglob or copy-on-write scalar
226is now much faster. Previously the typeglob would be stringified or
227the copy-on-write scalar would be copied before being clobbered.
d1fb015b 228
7e7629fa
FC
229=item *
230
84b2a83e 231Assignment to C<substr> in void context is now more than twice its
a29933a3
DR
232previous speed. Instead of creating and returning a special lvalue
233scalar that is then assigned to, C<substr> modifies the original string
234itself.
7e7629fa 235
e3c71926 236=back
6d110ad0 237
e3c71926 238=head1 Modules and Pragmata
6d110ad0 239
e3c71926 240=head2 Updated Modules and Pragmata
6d110ad0 241
e3c71926 242=over 4
6d110ad0
FC
243
244=item *
245
f8c9502f
CBW
246L<Archive::Tar> has been upgraded from version 1.80 to version 1.82.
247
a29933a3
DR
248Adjustments to handle files >8gb (>0777777777777 octal) and a feature
249to return the MD5SUM of files in the archive.
a3f52e2e 250
87b9431e
CBW
251=item *
252
74c26f06
CBW
253L<AutoLoader> has been upgraded from version 5.71 to version 5.72.
254
255=item *
256
8cea0f87
CBW
257L<B::Debug> has been upgraded from version 1.16 to version 1.17.
258
259=item *
260
be4a9ab3 261L<B::Deparse> has been upgraded from version 1.09 to version 1.10.
679b54e7 262
a29933a3
DR
263Various constructs that used to be deparsed incorrectly have been
264fixed:
7f28d7ed
DR
265
266=over
267
268=item C<sort(foo(bar))>
269
be9a5e16
DR
270It used to deparse as C<sort foo(bar)>, which makes foo the sort
271routine, rather than a regular function call.
7f28d7ed
DR
272
273=item Keys and values in C<%^H>
274
275Undefined values in the hint hash were being deparsed as empty strings.
276Whenever the hint hash changed, all undefined values, even those
277unmodified, were being printed.
278
279Special characters, such as quotation marks, were not being escaped
280properly.
281
a29933a3
DR
282Some values used to be omitted if, for instance, a key was the same as
283a previous value and vice versa.
7f28d7ed
DR
284
285=item "method BLOCK" syntax
286
a29933a3
DR
287C<method { $expr }> used to be deparsed as something like C<< do{ $expr
288}->method >>, but the latter puts the $expr in scalar context, whereas
289the former puts in list context.
7f28d7ed
DR
290
291=item C<do +{}> and C<do({})>
292
293These are both variants of do-file syntax, but were being deparsed as
294do-blocks.
295
be9a5e16 296=item Keywords that do not follow the llaf rule
7f28d7ed
DR
297
298Keywords like C<return> and C<last> that do not follow the
a29933a3
DR
299looks-like-a-function rule are now deparsed correctly with parentheses
300in the right place.
7f28d7ed 301
be9a5e16
DR
302Similarly, C<not>, which I<does> follow the llaf rule, was being
303deparsed as though it does not.
7f28d7ed
DR
304
305=item C<=~>
306
a29933a3
DR
307In various cases, B::Deparse started adding a spurious C<$_ =~> before
308the right-hand side in Perl 5.14; e.g., C<< "" =~ <$a> >> would become
7f28d7ed
DR
309C<< "" =~ ($_ =~ <$a>) >>.
310
311=item C<open local *FH>
312
a29933a3
DR
313C<open>, C<pipe> and other functions that autovivify handles used to
314omit C<local *> from C<local *FH>.
7f28d7ed
DR
315
316=item Negated single-letter subroutine calls
317
a29933a3
DR
318Negated subroutine calls like C<- f()> and C<-(f())> were being
319deparsed as file test operators.
7f28d7ed
DR
320
321=item C<&{&}>
322
a29933a3
DR
323C<&{&}> and C<& &>, which are calls to the subroutine named "&",
324believe it or not, were being deparsed as C<&&>.
7f28d7ed 325
7f41f337
FC
326=item C<require $this + $that>
327
a29933a3
DR
328In Perl 5.14, C<require> followed by any binary operator started
329deparsing as C<no>.
7f41f337 330
7f28d7ed 331=back
679b54e7
FC
332
333=item *
334
5dd80d85
FC
335L<Carp> has been upgraded from version 1.23 to version 1.24.
336
a29933a3
DR
337It now tacks the last-accessed filehandle and line number on to the end
338of the error message, just like C<die> [perl #96672].
5dd80d85
FC
339
340=item *
341
a29933a3
DR
342L<Compress::Raw::Zlib> has been upgraded from version 2.042 to version
3432.045.
87b9431e 344
7e700369
CBW
345=item *
346
a29933a3
DR
347L<Compress::Raw::Bzip2> has been upgraded from version 2.042 to version
3482.045.
7e700369 349
dc7edc5c
CBW
350=item *
351
a29933a3
DR
352L<CPAN::Meta::YAML> has been upgraded from version 0.004 to version
3530.005.
1d8dd5fc
CBW
354
355=item *
356
db3e41d4 357L<CPANPLUS> has been upgraded from version 0.9112 to version 0.9114.
9e87a279
CBW
358
359=item *
360
be4a9ab3 361L<Data::Dumper> has been upgraded from version 2.134 to version 2.135.
61f966e7 362
a29933a3
DR
363The XS implementation has been updated to account for the Unicode
364symbol changes in Perl 5.15.4. It also knows how to output typeglobs
365with nulls in their names.
61f966e7
FC
366
367=item *
368
ecf16f8c
FC
369L<diagnostics> has been upgraded from version 1.25 to version 1.26.
370
a29933a3
DR
371It now understands the "%X" format code, which some error messages
372started using in Perl 5.14.0.
ecf16f8c
FC
373
374=item *
375
e39652ea
CBW
376L<Digest::SHA> has been upgraded from version 5.63 to version 5.70.
377
be9a5e16
DR
378Added BITS mode to the addfile method and shasum. This makes
379partial-byte inputs possible via files/STDIN and allows shasum to check
380all 8074 NIST Msg vectors, where previously special programming was
381required to do this.
e39652ea
CBW
382
383=item *
384
7f28d7ed
DR
385L<Exporter> has been upgraded from version 5.65 to version 5.66.
386
387It no longer tries to localise C<$_> unnecessarily.
388
389=item *
390
a29933a3
DR
391L<ExtUtils::ParseXS> has been upgraded from version 3.05 to version
3923.07.
ac616993
CBW
393
394=item *
395
a29933a3
DR
396L<IO::Compress::Base> has been upgraded from version 2.042 to version
3972.046.
08ad9465
CBW
398
399Added zipdetails utility.
dc7edc5c 400
7788a270
CBW
401=item *
402
4345d05b
CBW
403L<Locale::Codes> has been upgraded from version 3.18 to version 3.20.
404
a29933a3 405The code2XXX, XXX2code, all_XXX_codes, and all_XXX_names functions now
be9a5e16
DR
406support retired codes. All codesets may be specified by a constant or
407by their name now. Previously, they were specified only by a constant.
408
409The alias_code function exists for backward compatibility. It has been
410replaced by rename_country_code. The alias_code function will be
411removed some time after September, 2013.
412
413All work is now done in the central module (Locale::Codes).
414Previously, some was still done in the wrapper modules
415(Locale::Codes::*). Added Language Family codes (langfam) as defined
416in ISO 639-5.
4345d05b
CBW
417
418=item *
419
3c7c5233
DR
420L<Module::CoreList> has been upgraded from version 2.58 to version
4212.59.
422
423=item *
424
be9a5e16 425L<Module::Loaded> has been upgraded from version 0.06 to version 0.08.
b42ff875
CBW
426
427=item *
428
a71d67b1
CBW
429L<Pod::LaTeX> has been upgraded from version 0.59 to version 0.60.
430
431Added another LaTeX escape: --- => -{}-{}-
432
433Pod::LaTeX doesn't handle -- in PODs specially, passing it directly to
be9a5e16 434LaTeX, which then proceeds to replace it with a single -. This patch
a71d67b1
CBW
435replaces ----- with -{}-{}-{}-{}-
436
437=item *
438
be4a9ab3 439L<POSIX> has been upgraded from version 1.26 to version 1.27.
7e7629fa 440
a29933a3
DR
441It no longer produces a "Constant subroutine TCSANOW redefined" warning
442on Windows.
7e7629fa 443
ae241e63 444This bug was introduced in Perl 5.15.3.
7e7629fa
FC
445
446=item *
447
37b1de1b 448L<Socket> has been upgraded from version 1.94_02 to version 1.97.
c2654555
CBW
449
450=item *
451
85ca3be7
CBW
452L<threads> has been upgraded from version 1.85 to version 1.86.
453
454=item *
455
a29933a3
DR
456L<Unicode::Collate> has been upgraded from version 0.85 to version
4570.87.
7788a270 458
a29933a3
DR
459Tailored compatibility ideographs as well as unified ideographs for the
460locales: ja, ko, zh__big5han, zh__gb2312han, zh__pinyin, zh__stroke.
7788a270 461
be9a5e16 462Locale/*.pl files are now searched for in @INC.
65ae8d99 463
a3e88ad7
JP
464=item *
465
be4a9ab3 466L<UNIVERSAL> has been upgraded from version 1.10 to version 1.11.
a3e88ad7
JP
467
468Documentation change clarifies return values from UNIVERSAL::VERSION.
469
0aaeb177 470=back
6138a722 471
0aaeb177 472=head2 Removed Modules and Pragmata
6138a722 473
0aaeb177 474=over 4
be539103 475
a47fb3fe
CBW
476=item *
477
7f28d7ed
DR
478Changing the case of a UTF-8 encoded string under C<use locale> now
479gives better, but still imperfect, results. Previously, such a string
a29933a3 480would entirely lose locale semantics and silently be treated as
be9a5e16 481Unicode. Now, the code points that are less than 256 are treated with
a29933a3
DR
482locale rules, while those above 255 are, of course, treated as Unicode.
483 See L<perlfunc/lc> for more details, including the deficiencies of
484this scheme.
a3f52e2e 485
0aaeb177 486=back
a3f52e2e 487
0aaeb177 488=head1 Documentation
a3f52e2e 489
0aaeb177 490=head2 Changes to Existing Documentation
6138a722 491
7687d286 492=head3 L<perlsec/Laundering and Detecting Tainted Data>
a47fb3fe 493
0aaeb177 494=over 4
7ef25837 495
6d110ad0
FC
496=item *
497
7687d286
KW
498The example function for checking for taintedness contained a subtle
499error. C<$@> needs to be localized to prevent its changing this
500global's value outside the function. The preferred method to check for
be9a5e16 501this remains L<Scalar::Util/tainted>.
6d110ad0
FC
502
503=back
504
e3c71926
FR
505=head1 Diagnostics
506
0aaeb177
SH
507=head2 Changes to Existing Diagnostics
508
e3c71926 509=over 4
bd65daab 510
3f2cb5bf
SM
511=item *
512
a29933a3
DR
513Redefinition warnings for constant subroutines used to be mandatory,
514even occurring under C<no warnings>. Now they respect the L<warnings>
515pragma.
b420b12a 516
61f966e7
FC
517=item *
518
a29933a3
DR
519The "Attempt to free non-existent shared string" has had the spelling
520of "non-existent" corrected to "nonexistent". It was already listed
521with the correct spelling in L<perldiag>.
61f966e7 522
66008486
FC
523=item *
524
525The 'Use of "foo" without parentheses is ambiguous' warning has been
a29933a3
DR
526extended to apply also to user-defined subroutines with a (;$)
527prototype, and not just to built-in functions.
66008486 528
5dd80d85
FC
529=item *
530
531The error messages for using C<default> and C<when> outside of a
a29933a3
DR
532topicalizer have been standardised to match the messages for
533C<continue> and loop controls. They now read 'Can't "default" outside
534a topicalizer' and 'Can't "when" outside a topicalizer'. They both
535used to be 'Can't use when() outside a topicalizer' [perl #91514].
5dd80d85 536
3432e5a1 537=back
b420b12a 538
0aaeb177 539=head1 Utility Changes
9cfd094e 540
08ad9465 541=head3 L<zipdetails>
d6cf2367 542
e3c71926 543=over 4
b53e16ae
FC
544
545=item *
546
a29933a3 547L<zipdetails> displays information about the internal record structure
be9a5e16
DR
548of the zip file. It is not concerned with displaying any details of
549the compressed data stored in the zip file.
b53e16ae 550
3432e5a1 551=back
60092ce4 552
0aaeb177
SH
553=head1 Configuration and Compilation
554
e3c71926 555=over 4
b53e16ae
FC
556
557=item *
558
bb79e02f 559F<pod/roffitall> is now built by F<pod/buildtoc>, instead of being
be9a5e16
DR
560shipped with the distribution. Its list of manpages is now generated
561(and therefore current). See also RT #103202 for an unresolved related
a29933a3 562issue.
a3f52e2e 563
61f966e7
FC
564=item *
565
566Perl 5.15.5 had a bug in its installation script, which did not install
567F<unicore/Name.pm>. This has been corrected [perl #104226].
568
f4912a50
DR
569=item *
570
be9a5e16 571The man page for C<XS::Typemap> is no longer installed. C<XS::Typemap>
a29933a3
DR
572is a test module which is not installed, hence installing its
573documentation makes no sense.
ba91b4f3
NC
574
575=for 5.16.0 Merge this with the entry for "Stop installing XS::APItest*"
576
577=item *
578
a29933a3
DR
579The man pages for the perl FAQ, L<perlxs>, L<perlxstut> and L<perldoc>
580are once again correctly installed in F<man1>, not F<man3>
ba91b4f3
NC
581
582=for 5.16.0 This isn't a regression from 5.14.x, so don't mention this.
583
584=item *
585
a29933a3
DR
586The -Dusesitecustomize and -Duserelocatableinc options now work
587together properly.
f4912a50 588
0aaeb177 589=back
a3f52e2e 590
0aaeb177 591=head1 Testing
a3f52e2e 592
0aaeb177 593=over 4
a3f52e2e
FC
594
595=item *
596
a29933a3
DR
597The F<substr.t> and F<substr_thr.t> scripts for testing C<substr> have
598been moved under F<t/op/>, where they were originally. They had been
599moved under F<t/re/> along with the substitution tests when that
600directory was created.
a3f52e2e 601
0aaeb177 602=back
a3f52e2e 603
0aaeb177 604=head1 Platform Support
a3f52e2e 605
0aaeb177 606=head2 Platform-Specific Notes
ad32999b 607
f4912a50
DR
608=head3 VMS
609
0aaeb177 610=over 4
ad32999b 611
f4912a50 612=item *
ad32999b 613
a3ef9f5c
CB
614A link-time error on VMS versions without C<symlink> support was
615introduced in 5.15.1, but has now been corrected.
f4912a50
DR
616
617=item *
618
a29933a3
DR
619Explicit support for VMS versions prior to v7.0 and DEC C versions
620prior to v6.0 has been removed.
a3ef9f5c
CB
621
622=item *
623
624Since Perl 5.10.1, the home-grown C<stat> wrapper has been unable to
625distinguish between a directory name containing an underscore and an
626otherwise-identical filename containing a dot in the same position
be9a5e16 627(e.g., t/test_pl as a directory and t/test.pl as a file). This problem
a3ef9f5c 628has been corrected.
c15f899f 629
7f28d7ed 630=back
ad32999b 631
0aaeb177 632=head1 Selected Bug Fixes
9c7c1651 633
0aaeb177 634=over 4
fce59cd4 635
b9e83cd1
FC
636=item *
637
7402016d
AB
638RT #78266: The regex engine has been leaking memory when accessing
639named captures that weren't matched as part of a regex ever since 5.10
a29933a3
DR
640when they were introduced, e.g. this would consume over a hundred MB of
641memory:
7402016d 642
e46b6a32 643 for (1..10_000_000) {
be9a5e16
DR
644 if ("foo" =~ /(foo|(?<capture>bar))?/) {
645 my $capture = $+{capture}
646 }
e46b6a32
FC
647 }
648 system "ps -o rss $$"'
7402016d
AB
649
650=item *
651
a29933a3
DR
652A constant subroutine assigned to a glob whose name contains a null
653will no longer cause extra globs to pop into existence when the
654constant is referenced under its new name.
b9e83cd1 655
679b54e7
FC
656=item *
657
a29933a3
DR
658C<sort> was not treating C<sub {}> and C<sub {()}> as equivalent when
659such a sub was provided as the comparison routine. It used to croak on
679b54e7
FC
660C<sub {()}>.
661
662=item *
663
664Subroutines from the C<autouse> namespace are once more exempt from
a29933a3
DR
665redefinition warnings. This used to work in 5.005, but was broken in
6665.6 for most subroutines. For subs created via XS that redefine
667subroutines from the C<autouse> package, this stopped working in 5.10.
679b54e7
FC
668
669=item *
670
671New XSUBs now produce redefinition warnings if they overwrite existing
a29933a3 672subs, as they did in 5.8.x. (The C<autouse> logic was reversed in
be9a5e16
DR
6735.10-14. Only subroutines from the C<autouse> namespace would warn
674when clobbered.)
679b54e7
FC
675
676=item *
677
678Redefinition warnings triggered by the creation of XSUBs now respect
a29933a3
DR
679Unicode glob names, instead of using the internal representation. This
680was missed in 5.15.4, partly because this warning was so hard to
681trigger. (See the previous item.)
679b54e7
FC
682
683=item *
684
a29933a3
DR
685C<newCONSTSUB> used to use compile-time warning hints, instead of
686run-time hints. The following code should never produce a redefinition
be9a5e16 687warning, but it used to, if C<newCONSTSUB> redefined an existing
a29933a3 688subroutine:
679b54e7
FC
689
690 use warnings;
691 BEGIN {
be9a5e16
DR
692 no warnings;
693 some_XS_function_that_calls_new_CONSTSUB();
679b54e7
FC
694 }
695
61f966e7
FC
696=item *
697
a29933a3
DR
698Redefinition warnings for constant subroutines are on by default (what
699are known as severe warnings in L<perldiag>). This was only the case
700when it was a glob assignment or declaration of a Perl subroutine that
701caused the warning. If the creation of XSUBs triggered the warning, it
702was not a default warning. This has been corrected.
61f966e7
FC
703
704=item *
705
a29933a3
DR
706The internal check to see whether a redefinition warning should occur
707used to emit "uninitialized" warnings in cases like this:
61f966e7
FC
708
709 use warnings "uninitialized";
be9a5e16
DR
710 use constant {u => undef, v => undef};
711 sub foo(){u}
712 sub foo(){v}
61f966e7
FC
713
714=item *
715
716A bug fix in Perl 5.14 introduced a new bug, causing "uninitialized"
be9a5e16
DR
717warnings to report the wrong variable if the operator in question had
718two operands and one was C<%{...}> or C<@{...}>. This has been fixed
61f966e7
FC
719[perl #103766].
720
721=item *
722
723C<< version->new("version") >> and C<printf "%vd", "version"> no longer
724crash [perl #102586].
725
d1fb015b
FC
726=item *
727
a29933a3
DR
728C<$tied =~ y/a/b/>, C<chop $tied> and C<chomp $tied> now call FETCH
729just once when $tied holds a reference.
d1fb015b
FC
730
731=item *
732
a29933a3
DR
733Four-argument C<select> now always calls FETCH on tied arguments. It
734used to skip the call if the tied argument happened to hold C<undef> or
735a typeglob.
d1fb015b
FC
736
737=item *
738
739Four-argument C<select> no longer produces its "Non-string passed as
740bitmask" warning on tied or tainted variables that are strings.
741
742=item *
743
be9a5e16
DR
744C<sysread> now always calls FETCH on the buffer passed to it if the
745buffer is tied. It used to skip the call if the tied variable happened
746to hold a typeglob.
d1fb015b
FC
747
748=item *
749
a29933a3
DR
750C<< $tied .= <> >> now calls FETCH once on C<$tied>. It used to call
751it multiple times if the last value assigned to or returned from the
752tied variable was anything other than a string or typeglob.
d1fb015b 753
66008486
FC
754=item *
755
756The C<evalbytes> keyword added in 5.15.5 was respecting C<use utf8>
a29933a3
DR
757declarations from the outer scope, when it should have been ignoring
758them.
66008486 759
7e7629fa
FC
760=item *
761
be9a5e16 762C<goto &func> no longer crashes, but produces an error message, when
a29933a3 763the unwinding of the current subroutine's scope fires a destructor that
7e7629fa
FC
764undefines the subroutine being "goneto" [perl #99850].
765
73512201
DG
766=item *
767
a29933a3
DR
768Arithmetic assignment (C<$left += $right>) involving overloaded objects
769that rely on the 'nomethod' override no longer segfault when the left
770operand is not overloaded.
73512201 771
a1f0e6ed
FC
772=item *
773
774Assigning C<__PACKAGE__> or any other shared hash key scalar to a stash
775element no longer causes a double free. Regardless of this change, the
776results of such assignments are still undefined.
777
778=item *
779
a29933a3
DR
780Assigning C<__PACKAGE__> or another shared hash key string to a
781variable no longer stops that variable from being tied if it happens to
782be a PVMG or PVLV internally.
a1f0e6ed 783
ad790500
FC
784=item *
785
be9a5e16
DR
786Creating a C<UNIVERSAL::AUTOLOAD> sub no longer stops C<%+>, C<%-> and
787C<%!> from working some of the time [perl #105024].
ad790500 788
6d91e957
KW
789=item *
790
791When presented with malformed UTF-8 input, the XS-callable functions
792C<is_utf8_string()>, C<is_utf8_string_loc()>, and
793C<is_utf8_string_loclen()> could read beyond the end of the input
794string by up to 12 bytes. This no longer happens. [perl #32080].
a29933a3
DR
795However, currently, C<is_utf8_char()> still has this defect, see
796L</is_utf8_char()> above.
6d91e957 797
d6b99bf4
FC
798=item *
799
a29933a3
DR
800Doing a substitution on a tied variable returning a copy-on-write
801scalar used to cause an assertion failure or an "Attempt to free
802nonexistent shared string" warning.
d6b99bf4
FC
803
804=item *
805
a29933a3
DR
806A change in perl 5.15.4 caused C<caller()> to produce malloc errors and
807a crash with Perl's own malloc, and possibly with other malloc
d6b99bf4
FC
808implementations, too [perl #104034].
809
810=item *
811
812A bug fix in 5.15.5 could sometimes result in assertion failures under
813debugging builds of perl for certain syntax errors in C<eval>, such as
be9a5e16 814C<eval q|""!=!~//|>
d6b99bf4 815
8aade7da
DR
816=item *
817
a29933a3 818The "c [line num]" debugger command was broken by other debugger
be9a5e16 819changes released in 5.15.3. This is now fixed.
8aade7da 820
c7b728ca
SF
821=item *
822
a29933a3
DR
823Breakpoints were not properly restored after a debugger restart using
824the "R" command. This was broken in 5.15.3. This is now fixed.
5dd80d85
FC
825
826=item *
827
be9a5e16 828The debugger prompt did not display the current line. This was broken
5dd80d85 829in 5.15.3. This is now fixed.
c7b728ca
SF
830
831=item *
832
a29933a3
DR
833Class method calls still suffered from the Unicode bug with Latin-1
834package names. This was missed in the Unicode package name cleanup in
8355.15.4 [perl #105922].
c7b728ca 836
84b2a83e
FC
837=item *
838
839The debugger no longer tries to do C<local $_> when dumping data
840structures.
841
842=item *
843
a29933a3
DR
844Calling C<readline($fh)> where $fh is a glob copy (e.g., after C<$fh =
845*STDOUT>), assigning something other than a glob to $fh, and then
84b2a83e 846freeing $fh (e.g., by leaving the scope where it is defined) no longer
a29933a3
DR
847causes the internal variable used by C<$.> (C<PL_last_in_gv>) to point
848to a freed scalar, that could be reused for some other glob, causing
849C<$.> to use some unrelated filehandle [perl #97988].
84b2a83e
FC
850
851=item *
852
853A regression in 5.14 caused these statements not to set the internal
854variable that holds the handle used by C<$.>:
855
856 my $fh = *STDOUT;
857 tell $fh;
858 eof $fh;
859 seek $fh, 0,0;
860 tell *$fh;
861 eof *$fh;
862 seek *$fh, 0,0;
863 readline *$fh;
864
a29933a3
DR
865This is now fixed, but C<tell *{ *$fh }> still has the problem, and it
866is not clear how to fix it [perl #106536].
84b2a83e
FC
867
868=item *
869
a29933a3
DR
870Version comparisons, such as those that happen implicitly with C<use
871v5.43>, no longer cause locale settings to change [perl #105784].
b53e16ae 872
7c864bb3
VP
873=item *
874
be9a5e16
DR
875F<pod/buildtoc>, which generates L<perltoc>, put path names in the
876L<perltoc> file. This bug was introduced in 5.15.1.
7c864bb3 877
63ac71b9 878=back
bbc28bfc 879
be9a5e16 880=head1 Acknowledgments
7c864bb3 881
a29933a3
DR
882Perl 5.15.6 represents approximately 2 months of development since Perl
8835.15.5 and contains approximately 48,000 lines of changes across 560
884files from 36 authors.
bbc28bfc 885
a29933a3 886Perl continues to flourish into its third decade thanks to a vibrant
be9a5e16 887community of users and developers. The following people are known to
a29933a3 888have contributed the improvements that became Perl 5.15.6:
8fe05716 889
a29933a3
DR
890Aaron Crane, Abhijit Menon-Sen, Alexandr Ciornii, Brian Fraser, Carl
891Hayter, Chris 'BinGOs' Williams, Craig A. Berry, Dave Rolsky, David
892Golden, David Mitchell, Dominic Hargreaves, Father Chrysostomos, James
893E Keenan, Johannes Plunien, John Peacock, Karl Williamson, Marc Green,
894Mark Dootson, Matthew Horsfall, Nicholas Clark, Paul Evans, Peter
895Martini, Peter Scott, Rafael Garcia-Suarez, Reini Urban, Ricardo
896Signes, Rodolfo Carvalho, Shlomi Fish, Steffen Müller, Steve Hay,
897Steve Peters, Thomas Sibley, Timothe Litt, Tony Cook, Vadim Konovalov,
898Ævar Arnfjörð Bjarmason.
8fe05716 899
a29933a3 900The list above is almost certainly incomplete as it is automatically
be9a5e16 901generated from version control history. In particular, it does not
a29933a3
DR
902include the names of the (very much appreciated) contributors who
903reported issues to the Perl bug tracker.
8fe05716 904
a29933a3 905Many of the changes included in this version originated in the CPAN
be9a5e16 906modules included in Perl's core. We're grateful to the entire CPAN
a29933a3 907community for helping Perl to flourish.
8fe05716 908
a29933a3
DR
909For a more complete list of all of Perl's historical contributors,
910please see the F<AUTHORS> file in the Perl source distribution.
29cf780c 911
44691e6f
AB
912=head1 Reporting Bugs
913
914If you find what you think is a bug, you might check the articles
a29933a3
DR
915recently posted to the comp.lang.perl.misc newsgroup and the perl bug
916database at http://rt.perl.org/perlbug/ . There may also be
44691e6f
AB
917information at http://www.perl.org/ , the Perl Home Page.
918
919If you believe you have an unreported bug, please run the L<perlbug>
a29933a3
DR
920program included with your release. Be sure to trim your bug down to a
921tiny but sufficient test case. Your bug report, along with the output
922of C<perl -V>, will be sent off to perlbug@perl.org to be analysed by
923the Perl porting team.
44691e6f
AB
924
925If the bug you are reporting has security implications, which make it
a29933a3 926inappropriate to send to a publicly archived mailing list, then please
be9a5e16 927send it to perl5-security-report@perl.org. This points to a closed
a29933a3
DR
928subscription unarchived mailing list, which includes all the core
929committers, who will be able to help assess the impact of issues,
930figure out a resolution, and help co-ordinate the release of patches to
931mitigate or fix the problem across all platforms on which Perl is
be9a5e16
DR
932supported. Please only use this address for security issues in the
933Perl core, not for modules independently distributed on CPAN.
44691e6f
AB
934
935=head1 SEE ALSO
936
a29933a3
DR
937The F<Changes> file for an explanation of how to view exhaustive
938details on what changed.
44691e6f
AB
939
940The F<INSTALL> file for how to build Perl.
941
942The F<README> file for general stuff.
943
944The F<Artistic> and F<Copying> files for copyright information.
945
946=cut