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