This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta: Add ticket number to bug fix
[perl5.git] / pod / perldelta.pod
CommitLineData
44691e6f
AB
1=encoding utf8
2
90bf1576 3=for comment
ea88c40c 4This has been completed up to 1a50d74bac4, except for:
d25a863e 58629c11317 smueller Escape double-quotes in generated #line directives
4e6e9b23
FC
68dc67a69b shlomif perl -d: display lines inside subroutines.
73dfd1b5cd2 leont Export PerlIOBase_open
90bf1576 8
44691e6f
AB
9=head1 NAME
10
52deee2e 11perldelta - what is new for perl v5.15.7
ad32999b 12
52deee2e 13=head1 DESCRIPTION
ad32999b 14
52deee2e
DR
15This document describes differences between the 5.15.6 release and
16the 5.15.7 release.
ad32999b 17
52deee2e
DR
18If you are upgrading from an earlier release such as 5.15.5, first read
19L<perl5156delta>, which describes differences between 5.15.5 and
205.15.6.
a3f52e2e 21
52deee2e 22=head1 Notice
61f966e7 23
52deee2e 24XXX Any important notices here
61f966e7 25
52deee2e 26=head1 Core Enhancements
d1fb015b 27
fbb93542
KW
28=head2 C<use charnames> no longer needed for C<\N{I<name>}>
29
30The C<charnames> module is now automatically loaded when needed as if
31the C<:full> and C<:short> options had been specified. See
32L<charnames>.
33
8c85651d
KW
34=head2 Improved performance for Unicode properties in regular expressions
35
36Matching a code point against a Unicode property is now done via a
37binary search instead of linear. This means for example that the worst
38case for a 1000 item property is 10 probes instead of 1000. This
39inefficiency has been compensated for in the past by permanently storing
40in a hash the results of a given probe plus the results for the adjacent
4164 code points, under the theory that near-by code points are likely to
42be searched for. A separate hash was used for each mention of a Unicode
43property in each regular expression. Thus, C<qr/\p{foo}abc\p{foo}/>
44would generate two hashes. Any probes in one instance would be unknown
45to the other, and the hashes could expand separately to be quite large
46if the regular expression were used on many different widely-separated
47code points. This can lead to running out of memory in extreme cases.
48Now, however, there is just one hash shared by all instances of a given
49property. This means that if C<\p{foo}> is matched against "A" in one
50regular expression in a thread, the result will be known immediately to
51all regular expressions, and the relentless march of using up memory is
52slowed considerably.
53
e3c71926 54=head1 Security
6d110ad0 55
52deee2e
DR
56XXX Any security-related notices go here. In particular, any security
57vulnerabilities closed should be noted here rather than in the
58L</Selected Bug Fixes> section.
7f28d7ed 59
52deee2e 60[ List each security issue as a =head2 entry ]
7f28d7ed 61
52deee2e 62=head1 Incompatible Changes
7f28d7ed 63
52deee2e 64XXX For a release on a stable branch, this section aspires to be:
7f28d7ed 65
52deee2e
DR
66 There are no changes intentionally incompatible with 5.XXX.XXX
67 If any exist, they are bugs, and we request that you submit a
68 report. See L</Reporting Bugs> below.
7f28d7ed 69
52deee2e 70[ List each incompatible change as a =head2 entry ]
7f28d7ed 71
52deee2e 72=head1 Deprecations
7f28d7ed 73
ef337e16
CBW
74=head2 Deprecated Modules
75
76=over
77
78=item L<Version::Requirements>
79
80Version::Requirements is now DEPRECATED, use CPAN::Meta::Requirements,
81which is a drop-in replacement. It will be deleted from perl.git blead
82in v5.17.0.
83
84=back
85
52deee2e 86=head1 Performance Enhancements
66008486 87
52deee2e 88=over 4
66008486
FC
89
90=item *
91
39de7394
FC
92Version declarations with the C<use> keyword (e.g., C<use 5.012>) are now
93faster, as they enable features without loading F<feature.pm>.
66008486 94
cadced9f
FC
95=item *
96
97C<local $_> is faster now, as it no longer iterates through magic that it
98is not going to copy anyway.
99
66008486
FC
100=back
101
52deee2e 102=head1 Modules and Pragmata
84b2a83e 103
52deee2e
DR
104XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
105go here. If Module::CoreList is updated, generate an initial draft of the
106following sections using F<Porting/corelist-perldelta.pl>, which prints stub
107entries to STDOUT. Results can be pasted in place of the '=head2' entries
108below. A paragraph summary for important changes should then be added by hand.
109In an ideal world, dual-life modules would have a F<Changes> file that could be
110cribbed.
541cb22c 111
52deee2e 112[ Within each section, list entries as a =item entry ]
541cb22c 113
e3c71926 114=head2 Updated Modules and Pragmata
6d110ad0 115
e3c71926 116=over 4
6d110ad0
FC
117
118=item *
119
6f103008
FC
120L<B::Deparse> has been upgraded from version 1.10 to version 1.11.
121
6ee63c28 122It now deparses C<open('random string')> correctly. It used to omit the
6f103008
FC
123quotation marks, which did not work if the string were not a valid
124identifier [perl #91416].
125
6ee63c28
FC
126A similar bug also affected hash and array elements such as
127C<< 'random string'->[0] >>, which would deparse as C<$random string[0]>.
128This has been fixed.
129
cb1728ed
FC
130Those same syntaxes used to drop the package name from variables beginning
131with a punctuation mark, as in C<< "foo::]"->{$key} >>. This, too, has
132been fixed.
133
36a6a135
FC
134B::Deparse no longer hangs when deparsing a program with stash
135circularities, such as C<BEGIN { *Acme::Acme:: = *Acme:: }> [perl #91384].
136
137C</$s[1]/> used to be deparsed as C<$s[1]> if @s were a lexical variable
2e120742
FC
138[perl #81424]. Similarly, C</$#s/> would be deparsed as C<$#s> for both
139lexical and package variables. These has been fixed.
36a6a135
FC
140
141The C</applaud> regular expression flags are no longer omitted.
142
e3ed6ae8
FC
143Feature hints are now deparsed with C<use feature> rather than C<%^H>
144assignments.
145
ea88c40c 146A regression in 1.10 that caused C<ambient_pragmas> to disable strict mode
025130bf
FC
147in obscure cases has been fixed.
148
c7235129
FC
149Strict mode is now fully deparsed, including subs and vars [perl #24027].
150
a7106152
FC
151The global variables C<$(>, C<$|> and C<$)> are now deparsed with braces
152(i.e., C<${(}>) in regular expressions [perl #86060].
153
ea88c40c
FC
154C<continue> blocks after C<for> loops are now deparsed correctly, as they
155were back in 0.67 (included with Perl 5.8.5) [perl #108224]
156
6f103008
FC
157=item *
158
7f92e913
CBW
159L<CGI> has been upgraded from version 3.58 to version 3.59.
160
161We no longer read from STDIN when the Content-Length is not set, preventing
162requests with no Content-Length from freezing in some cases. This is consistent
163with the CGI RFC 3875, and is also consistent with CGI::Simple. However, the old
164behavior may have been expected by some command-line uses of CGI.pm.
165
166=item *
167
2b283575
CBW
168L<CPAN::Meta> has been upgraded from version 2.112621 to version 2.113640.
169
170Version::Requirements has now been merged as CPAN::Meta::Requirements.
171
172=item *
173
ce6b844f 174L<CPANPLUS> has been upgraded from version 0.9113 to version 0.9116.
7f41f337 175
88c5c971
CBW
176=item *
177
8f12b018
FC
178L<Data::Dumper> has been upgraded from version 2.135_01 to version
1792.135_03.
180
181It can now dump vstrings [perl #101162].
182
26afcec5
FC
183The nameless typeglob (C<*{""}>) is now dumped properly.
184
8f12b018
FC
185=item *
186
d7fbd56d
FC
187L<diagnostics> has been upgraded from version 1.26 to version 1.27.
188
189See the entry for splain in the L</Utility Changes> section, for the
190changes. The diagnostics module and the splain utility are actually one
191and the same.
192
193=item *
194
711a3903
FC
195L<ExtUtils::Packlist> has been upgraded from version 1.45 to version 1.46.
196
197It no longer produces "used once" warnings when the C<read> and C<write>
198methods are called while the main program is still compiling (e.g., from
199within a BEGIN block) [perl #107410] [rt.cpan.org #50315].
200
201=item *
202
6b339779
CBW
203L<Locale::Maketext> has been upgraded from version 1.21 to version 1.22.
204
205=item *
206
4e6ab4ad
CBW
207L<Module::Pluggable> has been upgraded from version 3.9 to version 4.0.
208
209=item *
210
79e10968
FC
211L<overload> has been upgraded from version 1.16 to version 1.17.
212
213C<overload::Overloaded> no longer calls C<can> on the class, but uses
214another means to determine whether the object has overloading. It was
215never correct for it to call C<can>, as overloading does not respect
216AUTOLOAD. So classes that autoload methods and implement C<can> no longer
217have to account for overloading [perl #40333].
218
ea88c40c
FC
219A warning is now produced for invalid arguments. See L</New Diagnostics>.
220
79e10968
FC
221=item *
222
329d453a 223L<perlfaq> has been upgraded from version 5.0150036 to version 5.0150038.
9d055b1a
CBW
224
225=item *
226
cadced9f
FC
227L<PerlIO::scalar> has been upgraded from version 0.12 to version 0.13.
228
229(This is the module that implements C<< open $fh, '>', \$scalar >>.)
230
231It no longer assumes during C<seek> that $scalar is a string internally.
232If it didn't crash, it was close to doing so [perl #92706].
233
234Printing to an in-memory handle now works if the $scalar holds a reference,
235stringifying the reference before modifying it. References used to be
236treated as empty strings.
237
238Printing to an in-memory handle no longer crashes if the $scalar happens to
239hold a number internally, but no string buffer.
240
241=item *
242
632c5d30
NC
243L<Pod::Html> has been upgraded from version 1.12 to 1.13
244
245=item *
246
60ffae32 247L<POSIX> has been upgraded from version 1.27 to version 1.29.
4e6e9b23
FC
248
249C<sigsuspend> and C<pause> now run signals handle before returning, as the
250whole point of these two functions is to wait until a signal has
251arrived, and then return I<after> it has been triggered. Delayed, or
252"safe", signals were preventing that from happening, possibly resulting in
253race conditions [perl #107216].
60ffae32
CBW
254C<POSIX::sleep> is now a direct call into the underlying OS C<sleep>
255function, instead of being a Perl wrapper on C<CORE::sleep>. C<POSIX::dup2>
256now returns the correct value on Win32 (I<i.e.> the file descriptor).
257C<POSIX::SigSet> C<sigsuspend> and C<sigpending> and C<POSIX::pause> now
258dispatch safe signals immediately before returning to their caller.
4e6e9b23
FC
259
260=item *
261
1887da8c
RS
262L<Pod::Perldoc> has been upgraded from version 3.15_01 to version 3.15_15.
263
264=item *
265
88c5c971
CBW
266L<Term::UI> has been upgraded from version 0.26 to version 0.30.
267
c0504019
TR
268=item *
269
270L<Tie::File> has been upgraded from version 0.96 to version 0.98.
271
937a45d0
KW
272=item *
273
274L<Unicode::UCD> has been upgraded from version 0.37 to version 0.38.
275This changes the output of C<prop_invmap()> for the Name_Alias property
276to reflect the changes that are planned for Unicode 6.1, so that there
277won't be a format change when upgrading to 6.1. Briefly, a second
278component of each alias is added that gives the type of alias it is.
279Examples are at L<Unicode::UCD/prop_invmap()>.
280
ef337e16
CBW
281=item *
282
283L<Version::Requirements> has been upgraded from version 0.101020 to version 0.101021.
284
285Version::Requirements is now DEPRECATED, use CPAN::Meta::Requirements,
286which is a drop-in replacement.
287
7f28d7ed 288=back
679b54e7 289
52deee2e 290=head1 Documentation
3c7c5233 291
52deee2e 292=head2 Changes to Existing Documentation
a71d67b1 293
cadced9f
FC
294=head3 L<perlfunc>
295
296=over 4
297
298=item *
299
300C<dbmopen> treats a 0 mode as a special case, that prevents a nonexistent
301file from being created. This has been the case since Perl 5.000, but was
302never documented anywhere. Now the perlfunc entry mentions it
303[perl #90064].
304
305=item *
306
307The entry for C<split> has been rewritten. It is now far clearer than
308before.
309
310=back
311
312=head3 L<perlop> and L<perlsyn>
7e7629fa 313
52deee2e 314=over 4
7e7629fa
FC
315
316=item *
317
cadced9f
FC
318Documentation of the smartmatch operator has been reworked and moved from
319perlsyn to perlop where it belongs.
320
321=item *
322
323Documentation of the ellipsis statement (C<...>) has been reworked and
324moved from perlop to perlsyn.
c2654555 325
52deee2e 326=back
85ca3be7 327
52deee2e 328=head1 Diagnostics
85ca3be7 329
52deee2e
DR
330The following additions or changes have been made to diagnostic output,
331including warnings and fatal error messages. For the complete list of
332diagnostic messages, see L<perldiag>.
7788a270 333
52deee2e 334=head2 New Diagnostics
a3e88ad7 335
52deee2e 336=head3 New Errors
6138a722 337
0aaeb177 338=over 4
be539103 339
a47fb3fe
CBW
340=item *
341
4888c563
FC
342L<Cannot set tied @DB::args|perldiag/"Cannot set tied @DB::args">
343
344This error occurs when C<caller> tries to set C<@DB::args> but finds it
345tied. Before this error was added, it used to crash instead.
a3f52e2e 346
52272450
FC
347=item *
348
349L<Cannot tie unreifiable array|perldiag/"Cannot tie unreifiable array">
350
351This error is part of a safety check that the C<tie> operator does before
352tying a special array like C<@_>. You should never see this message.
353
0aaeb177 354=back
a3f52e2e 355
52deee2e 356=head3 New Warnings
a47fb3fe 357
0aaeb177 358=over 4
7ef25837 359
6d110ad0
FC
360=item *
361
604a99bd
NC
362L<defined(@array) is deprecated|perldiag/"defined(@array) is deprecated">
363
364The long-deprecated C<defined(@array)> now also warns for package variables.
365Previously it only issued a warning for lexical variables.
6d110ad0 366
ea88c40c
FC
367=item *
368
369L<Useless use of \E|perldiag/"Useless use of \E">
370
371C<\E> does nothing unless preceded by C<\Q>, C<\L> or C<\U>.
372
373=item *
374
375L<overload arg '%s' is invalid|perldiag/"overload arg '%s' is invalid">
376
377This warning, in the "overload" category, is produced when the overload
378pragma is given an argument it doesn't recognize, presumably a mistyped
379operator.
380
6d110ad0
FC
381=back
382
cadced9f
FC
383=head2 Removals
384
385=over 4
386
387=item *
388
389"sort is now a reserved word"
390
391This error used to occur when C<sort> was called without arguments, followed by C<;> or C<)>. (E.g., C<sort;> would die, but C<{sort}> was
392OK.) This error message was added in Perl 3 to catch code like
393C<close(sort)> which would no longer work. More than two decades later,
394this message is no longer appropriate. Now C<sort> without arguments is
395always allowed, and returns an empty list, as it did in those cases where
396it was already allowed [perl #90030].
397
398=back
399
0aaeb177 400=head1 Utility Changes
9cfd094e 401
d7fbd56d 402=head3 L<splain>
0aaeb177 403
e3c71926 404=over 4
b53e16ae
FC
405
406=item *
407
d7fbd56d
FC
408splain no longer emits backtraces with the first line number repeated.
409This:
410
411 Uncaught exception from user code:
412 Cannot fwiddle the fwuddle at -e line 1.
413 at -e line 1
414 main::baz() called at -e line 1
415 main::bar() called at -e line 1
416 main::foo() called at -e line 1
417
418has become this:
419
420 Uncaught exception from user code:
421 Cannot fwiddle the fwuddle at -e line 1.
422 main::baz() called at -e line 1
423 main::bar() called at -e line 1
424 main::foo() called at -e line 1
ba91b4f3 425
b18aa002
FC
426=item *
427
66056247 428Some error messages consist of multiple lines that are listed as separate
b18aa002
FC
429entries in L<perldiag>. splain has been taught to find the separate
430entries in these cases, instead of simply failing to find the message.
431
52deee2e 432=back
ba91b4f3 433
52deee2e 434=head1 Configuration and Compilation
f4912a50 435
0aaeb177 436=over 4
a3f52e2e
FC
437
438=item *
439
3e975088
NC
440The Pod files for the perl FAQ, L<perlxs>, L<perlxstut> and L<perldoc>
441are once again correctly installed in the same directory as the other core
442Pods.
443
444=for 5.16.0 This isn't a regression from 5.14.x, so don't mention this.
a3f52e2e 445
0aaeb177 446=back
a3f52e2e 447
52deee2e 448=head1 Testing
a3f52e2e 449
0aaeb177 450=over 4
ad32999b 451
f4912a50 452=item *
ad32999b 453
48eabb99
NC
454F<t/porting/utils.t> now tests that various utility scripts compile cleanly.
455During development, this avoids the embarrassment of inadvertently pushing a
456commit which breaks code which isn't otherwise tested by the regression test
457suite. For example, F<installperl> and F<installman>, needed by
458C<make install>, are tested here.
c15f899f 459
7f28d7ed 460=back
ad32999b 461
52deee2e 462=head1 Internal Changes
d6b99bf4 463
52deee2e 464=over 4
8aade7da 465
c7b728ca
SF
466=item *
467
39de7394
FC
468There are now feature bundle hints in C<PL_hints> (C<$^H>) that version
469declarations use, to avoid having to load F<feature.pm>. One setting of
470the hint bits indicates a "custom" feature bundle, which means that the
471entries in C<%^H> still apply. F<feature.pm> uses that.
472
473The C<HINT_FEATURE_MASK> macro is defined in F<perl.h> along with other
474hints. Other macros for setting and testing features and bundles are in
475the new F<feature.h>. C<FEATURE_IS_ENABLED> (which has moved to
476F<feature.h>) is no longer used throughout the codebase, but more specific
477macros, e.g., C<FEATURE_SAY_IS_ENABLED>, that are defined in F<feature.h>.
478
479=item *
480
481F<lib/feature.pm> is now a generated file, created by the new
482F<regen/feature.pl> script, which also generates F<feature.h>.
5dd80d85 483
52272450
FC
484=item *
485
486Tied arrays are now always C<AvREAL>. If C<@_> or C<DB::args> is tied, it
487is reified first, to make sure this is always the case.
488
52deee2e 489=back
5dd80d85 490
52deee2e 491=head1 Selected Bug Fixes
c7b728ca 492
52deee2e 493=over 4
84b2a83e 494
5343a617 495=item * "b . COND" in the debugger has been fixed
84b2a83e 496
5343a617
SF
497Breaking on the current line with C<b . COND> was broken by previous work and
498has now been fixed.
84b2a83e 499
07f0992c
FC
500=item * Tying C<%^H>
501
90bf1576
FC
502Tying C<%^H> no longer causes perl to crash or ignore
503the contents of C<%^H> when entering a compilation
07f0992c
FC
504scope [perl #106282].
505
36a6a135
FC
506=item * C<~> on vstrings
507
508The bitwise complement operator (and possibly other operators, too) when
509passed a vstring would leave vstring magic attached to the return value,
510even though the string had changed. This meant that
511C<< version->new(~v1.2.3) >> would create a version looking like "v1.2.3"
512even though the string passed to C<< version->new >> was actually
513"\376\375\374". This also caused L<B::Deparse> to deparse C<~v1.2.3>
514incorrectly, without the C<~> [perl #29070].
515
516=item * Vstrings blowing away magic
517
518Assigning a vstring to a magic (e.g., tied, C<$!>) variable and then
519assigning something else used to blow away all the magic. This meant that
520tied variables would come undone, C<$!> would stop getting updated on
521failed system calls, C<$|> would stop setting autoflush, and other
522mischief would take place. This has been fixed.
523
a32fcfdc
FC
524=item * C<newHVhv> and tied hashes
525
526The C<newHVhv> XS function now works on tied hashes, instead of crashing or
527returning an empty hash.
528
063b2a72
FC
529=item * Hashes will null elements
530
531It is possible from XS code to create hashes with elements that have no
532values. Perl itself sometimes creates such hashes, but they are rarely
533visible to Perl code. The hash element and slice operators used to crash
534when handling these in lvalue context. These have been fixed. They now
535produce a "Modification of non-creatable hash value attempted" error
536message.
537
8c7dd470
FC
538=item * No warning for C<open(foo::bar)>
539
540When one writes C<open foo || die>, which used to work in Perl 4, a
541"Precedence problem" warning is produced. This warning used erroneously to
66056247
FC
542apply to fully-qualified bareword handle names not followed by C<||>. This
543has been corrected.
8c7dd470 544
f7606f70
FC
545=item * C<select> and package aliasing
546
547After package aliasing (C<*foo:: = *bar::>), C<select> with 0 or 1 argument
548would sometimes return a name that could not be used to refer to the
549filehandle, or sometimes it would return C<undef> even when a filehandle
550was selected. Now it returns a typeglob reference in such cases.
551
c0a5c448
FC
552=item * C<PerlIO::get_layers> and tied variables
553
554C<PerlIO::get_layers> no longer ignores FETCH on tied variables as it used
12d5b6c4
FC
555to most of the time [perl #97956].
556
557=item * C<PerlIO::get_layers> and numbers
558
559C<PerlIO::get_layers> no longer ignores some arguments that it thinks are
560numeric, while treating others as filehandle names. It is now consistent
561for flat scalars (i.e., not references).
c0a5c448 562
3ba4cf6c
FC
563=item * Lvalue subs and strict mode
564
565Lvalue sub calls that are not determined to be such at compile time
566(C<&$name> or &{"name"}) are no longer exempt from strict refs if they
567occur in the last statement of an lvalue subroutine [perl #102486].
568
569=item * Non-lvalue sub calls in potentially lvalue context
570
571Sub calls whose subs are not visible at compile time, if
572they occurred in the last statement of an lvalue subroutine,
573would reject non-lvalue subroutines and die with "Can't modify non-lvalue
574subroutine call" [perl #102486].
575
576Non-lvalue sub calls whose subs I<are> visible at compile time exhibited
577the opposite bug. If the call occurred in the last statement of an lvalue
578subroutine, there would be no error when the lvalue sub was called in
579lvalue context. Perl would blindly assign to the temporary value returned
580by the non-lvalue subroutine.
581
582=item * AUTOLOADing lvalue subs
583
584C<AUTOLOAD> routines used to take precedence over the actual sub being
585called (i.e., when autoloading wasn't needed), for sub calls in lvalue or
586potential lvalue context, if the subroutine was not visible at compile
587time.
588
4888c563
FC
589=item * C<caller> and tied C<@DB::args>
590
591C<caller> sets C<@DB::args> to the subroutine arguments when called from
592the DB package. It used to crash when doing so if C<@DB::args> happened to
593be tied. Now it croaks instead.
594
52272450
FC
595=item * Tying C<@_>
596
597Under debugging builds, this code:
598
599 sub TIEARRAY{bless[]}
600 sub {
601 tie @_, "";
602 \@_;
603 }->(1);
604
605use to produce an "av_reify called on tied array" warning. It doesn't any
606more.
607
ad266194
FC
608=item * Unrecognised switches on C<#!> line
609
610If a switch, such as B<-x>, that cannot occur on the C<#!> line is used
66056247 611there, perl dies with "Can't emulate...".
ad266194
FC
612
613It used to produce the same message for switches that perl did not
614recognise at all, whether on the command line or the C<#!> line.
615
616Now it produces the "Unrecognized switch" error message [perl #104288].
617
17b27d32
FC
618=item * C<system> and SIGCHLD
619
620C<system> now temporarily blocks the SIGCHLD signal handler, to prevent the
621signal handler from stealing the exit status [perl #105700].
622
b0e9fc93
FC
623=item * Deleting methods via C<delete>
624
625Deletion of methods via C<delete $Class::{method}> syntax used to update
626method caches if called in void context, but not scalar or list context.
627Now it always updates those caches.
628
d563d34b
FC
629=item * Hash element deletion and destructors
630
631When hash elements are deleted in void context, the internal hash entry is
66056247 632now freed before the value is freed, to prevent destructors called by that
d563d34b
FC
633latter freeing from seeing the hash in an inconsistent state. It was
634possible to cause double-frees if the destructor freed the hash itself
635[perl #100340].
636
6e555b9a
FC
637=item * C<(s)printf>'s %n formatting code
638
639The %n formatting code, which causes the number of characters to be
640assigned to the next argument to C<printf> or C<sprintf> now actually
641assigns the number of characters, instead of the number of bytes.
642
643It also works now with special lvalue functions like C<substr> and with
644nonexistent hash and array elements [perl #103492].
645
ac8fb82c
FC
646=item * Typeglobs and threads
647
648Typeglobs returned from threads are no longer cloned if the parent thread
649already has a glob with the same name. This means that returned
650subroutines will now assign to the right package variables [perl #107366].
651
711a3903
FC
652=item * C<local $_>
653
654In Perl 5.14, C<local $_> was changed to create a new variable not tied to
655anything, even if $_ was tied before that. But, due to an oversight, it
656would still call FETCH once on a tied $_ before replacing it with the new
657variable. This has been fixed [perl #105912].
658
cadced9f
FC
659=item * Returning tied variables
660
661When returning a value from a non-lvalue subroutine, Perl copies the value.
662Sometimes it cheats for the sake of speed, and does not copy the value if
663it makes no observable difference. This optimisation was erroneously
664allowing the copy to be skipped on tied variables, causing a difference in
665behaviour depending on the tied variable's reference count. This has been
666fixed [perl #95548].
667
668=item * C<{@a = sort}> no longer crashes
669
670This particular piece of code (C<sort> with no arguments assigned to an
671array, inside a block with no C<;>) started crashing in an earlier 5.15.x
672release. It has been fixed.
673
674=item * C<utf8::decode> and read-only scalars
675
676C<utf8::decode> now refuses to modify read-only scalars [perl #91850].
677
678=item * C<dbmopen> with undefined mode
679
680C<dbmopen> now only warns once, rather than three times, if the mode
681argument is C<undef> [perl #90064].
682
683=item * Freeing an aggregate during list assignment
684
685If list assignment to a hash or array triggered destructors that freed the
686hash or array itself, a crash would ensue. This is no longer the case
687[perl #107440].
688
838cf719
FC
689=item * Confused internal bookkeeping with @ISA arrays
690
691Creating a weak reference to an @ISA array or accessing the array index
692(C<$#ISA>) could result in confused internal bookkeeping for elements
693subsequently added to the @ISA array. For instance, creating a weak
694reference to the element itself could push that weak reference on to @ISA;
695and elements added after use of C<$#ISA> would be ignored by method lookup
696[perl #85670].
697
698=item * DELETE on scalar ties
699
700Tying an element of %ENV or C<%^H> and then deleting that element would
701result in a call to the tie object's DELETE method, even though tying the
702element itself is supposed to be equivalent to tying a scalar (the element
703is, of course, a scalar) [perl #67490].
704
705=item * Freeing $_ inside C<grep> or C<map>
706
707Freeing $_ inside a C<grep> or C<map> block or a code block embedded in a
708regular expression used to result in double frees [perl #92254, #92256].
709
b00f6edb
FC
710=item * Warnings with C<+=>
711
712The C<+=> operator does not usually warn when the left-hand side is
713C<undef>, but it was doing so for tied variables. This has been fixed
714[perl #44895].
715
66056247 716=item * Tying and autovivification
7a3fd9ed
FC
717
718When Perl autovivifies an element of a tied array or hash (which entails
719calling STORE with a new reference), it now calls FETCH immediately after
720the STORE, instead of assuming that FETCH would have returned the same
721reference. This can make it easier to implement tied objects [perl #35865, #43011].
722
1a50d74b
FC
723=item * C<@&> and C<$&>
724
725Mentioning a variable named "&" other than C<$&> (i.e., C<@&> or C<%&>) no
726longer stops C<$&> from working. The same applies to variables named "'"
727and "`" [perl #24237].
728
ea88c40c
FC
729=item * Stacked filetests
730
731C<-T> and C<-B> now work when stacked up with other filetest operators
732[perl #77388].
733
734=item * Filetests and stat buffers
735
736Perl keeps several internal variables to keep track of the last stat
737buffer, from which file(handle) it originated, what type it was, and
738whether the last stat succeeded.
739
740There were various cases where these could get out of synch, resulting in
741inconsistent or erratic behaviour in edge cases (every mention of C<-T>
742applies to C<-B> as well):
743
744=over
745
746=item *
747
748C<-T I<HANDLE>>, even though it does a C<stat>, was not resetting the last
749stat type, so an C<lstat _> following it would merrily return the wrong
750results. Also, it was not setting the success status.
751
752=item *
753
754Freeing the handle last used by C<stat> or a filetest could result in
755S<C<-T _>> using an unrelated handle.
756
757=item *
758
759C<stat> with an IO reference (as returned by C<*STDIO{IO}>, for instance)
760would not reset the stat type.
761
762=item *
763
764C<stat> with an IO reference was not recording the filehandle for
765S<C<-T _>> to use.
766
767=item *
768
769The presence of fatal warnings could cause the stat buffer not to be reset
770for a filetest operator on an unopened filehandle or C<-l> on any handle.
771
772=item *
773
774Fatal warnings would stop C<-T> from setting C<$!>.
775
776=item *
777
778When the last stat was on an unreadable file, C<-T _> is supposed to
779return C<undef>, leaving the last stat buffer unchanged. But it was
780setting the stat type, causing C<lstat _> to stop working.
781
782=item *
783
784C<-T I<FILENAME>> was not resetting the internal stat buffers for
785unreadable files.
786
787=back
788
789These have all been fixed.
790
791=item * C<defined *{"!"}>
792
793An earlier 5.15.x release caused this construct to stop the C<%!> hash
794from working. Likewise C<defined *{"+"}> and C<defined *{"-"}> caused
795C<%+> and C<%->, respectively, to stop working. This has been fixed.
796
797=item * C<-T _> with no preceding C<stat>
798
799This used to produce a confusing "uninitialized" warning, even though there
800is no visible uninitialized value to speak of.
801
802=item * C<stat I<HANDLE>> and fstat failures
803
804If the operating system's C<fstat> function failed, C<stat> would warn
805about an unopened handle, even though that was not the case. This has been
806fixed.
807
808=item * C<lstat I<IOREF>>
809
810C<lstat> is documented to fall back to C<stat> (with a warning) when given
811a filehandle. When passed an IO reference, it was actually doing the
812equivalent of S<C<stat _>> and ignoring the handle.
813
485495c3
FC
814=item * Crashes with warnings
815
816Two warning messages that mention variable names started crashing in
fbed6467 8175.15.5, but have been fixed [perl #106726, #107656].
485495c3 818
18af289e
FC
819=item * Bitwise assignment operators and copy-on-write
820
821In 5.14.0, the bitwise assignment operators C<|=>, C<^=> and C<&=> starting
822leaving the left-hand side undefined if it happened to be a copy-on-write
823string. This has been fixed [perl #108480].
824
1ac442bc
KW
825=item * Three problematic Unicode characters now work better in regex pattern matching under C</i>
826
827In the past, three Unicode characters:
828LATIN SMALL LETTER SHARP S,
829GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS,
830and
831GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS,
832along with the sequences that they fold to
833(including "ss" in the case of LATIN SMALL LETTER SHARP S),
834did not properly match under C</i>. 5.14.0 fixed some of these cases,
835but introduced others, including a panic when one of the characters or
836sequences was used in the C<(?(DEFINE)> regular expression predicate.
837The known bugs that were introduced in 5.14 have now been fixed; as well
838as some other edge cases that have never worked until now. All these
839involve using the characters and sequences outside bracketed character
c0154fe2
KW
840classes under C</i>. This closes [perl #98546].
841
842There remain known problems when using certain characters with
843multi-character folds inside bracketed character classes, including such
844constructs as C<qr/[\N{LATIN SMALL LETTER SHARP}a-z]/i>. These
845remaining bugs are addressed in [perl #89774].
1ac442bc 846
52deee2e 847=back
84b2a83e 848
52deee2e 849=head1 Acknowledgements
8fe05716 850
7ae580ab
CBW
851Perl 5.15.7 represents approximately 4 weeks of development since Perl 5.15.6
852and contains approximately 50,000 lines of changes across 470 files from 28
853authors.
854
855Perl continues to flourish into its third decade thanks to a vibrant community
856of users and developers. The following people are known to have contributed the
857improvements that became Perl 5.15.7:
858
859Alberto Simões, Brian Fraser, Chris 'BinGOs' Williams, Craig A. Berry, Dave
860Rolsky, David Mitchell, Eric Brine, Father Chrysostomos, Florian Ragwitz,
861H.Merijn Brand, Hojung Youn, James E Keenan, Joel Berger, Joshua ben Jore, Karl
862Williamson, Leon Timmermans, Matthew Horsfall, Michael Witten, Nicholas Clark,
863Ricardo Signes, Shlomi Fish, Steffen Müller, Steffen Schwigon, Todd Rinaldo,
864Tom Christiansen, Tom Hukins, Tony Cook, Ævar Arnfjörð Bjarmason.
865
866The list above is almost certainly incomplete as it is automatically generated
867from version control history. In particular, it does not include the names of
868the (very much appreciated) contributors who reported issues to the Perl bug
869tracker.
870
871Many of the changes included in this version originated in the CPAN modules
872included in Perl's core. We're grateful to the entire CPAN community for
873helping Perl to flourish.
874
875For a more complete list of all of Perl's historical contributors, please see
876the F<AUTHORS> file in the Perl source distribution.
29cf780c 877
44691e6f
AB
878=head1 Reporting Bugs
879
880If you find what you think is a bug, you might check the articles
52deee2e
DR
881recently posted to the comp.lang.perl.misc newsgroup and the perl
882bug database at http://rt.perl.org/perlbug/ . There may also be
44691e6f
AB
883information at http://www.perl.org/ , the Perl Home Page.
884
885If you believe you have an unreported bug, please run the L<perlbug>
52deee2e
DR
886program included with your release. Be sure to trim your bug down
887to a tiny but sufficient test case. Your bug report, along with the
888output of C<perl -V>, will be sent off to perlbug@perl.org to be
889analysed by the Perl porting team.
44691e6f
AB
890
891If the bug you are reporting has security implications, which make it
52deee2e
DR
892inappropriate to send to a publicly archived mailing list, then please send
893it to perl5-security-report@perl.org. This points to a closed subscription
894unarchived mailing list, which includes
895all the core committers, who will be able
896to help assess the impact of issues, figure out a resolution, and help
897co-ordinate the release of patches to mitigate or fix the problem across all
898platforms on which Perl is supported. Please only use this address for
899security issues in the Perl core, not for modules independently
900distributed on CPAN.
44691e6f
AB
901
902=head1 SEE ALSO
903
52deee2e
DR
904The F<Changes> file for an explanation of how to view exhaustive details
905on what changed.
44691e6f
AB
906
907The F<INSTALL> file for how to build Perl.
908
909The F<README> file for general stuff.
910
911The F<Artistic> and F<Copying> files for copyright information.
912
913=cut