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