This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Ahem. *Final* finalisation.
[perl5.git] / pod / perldelta.pod
CommitLineData
4c793fe3
FR
1=encoding utf8
2
3=head1 NAME
4
8f97a47a 5perldelta - what is new for perl v5.13.7
a12cf05f 6
8f97a47a 7=head1 DESCRIPTION
fb121860 8
8f97a47a
TM
9This document describes differences between the 5.13.6 release and
10the 5.13.7 release.
eb32ee41 11
8f97a47a
TM
12If you are upgrading from an earlier release such as 5.13.5, first read
13L<perl5136delta>, which describes differences between 5.13.5 and
145.13.6.
eb32ee41 15
8f97a47a 16=head1 Core Enhancements
5e26bbbe 17
c035a075
DG
18=head2 Single term prototype
19
20The C<+> prototype is a special alternative to C<$> that will act like
21C<\[@%]> when given a literal array or hash variable, but will otherwise
22force scalar context on the argument. This is useful for functions which
23should accept either a literal array or an array reference as the argument:
24
25 sub smartpush (+@) {
26 my $aref = shift;
27 die "Not an array or arrayref" unless ref $aref eq 'ARRAY';
28 push @$aref, @_;
29 }
30
31When using the C<+> prototype, your function must check that the argument
32is of an acceptable type.
33
b7bd32cc
FC
34=head2 C<use re '/flags';>
35
36The C<re> pragma now has the ability to turn on regular expression flags
37till the end of the lexical scope:
38
39 use re '/x';
40 "foo" =~ / (.+) /; # /x implied
41
42See L<re/'/flags' mode> for details.
43
a5e71717
FC
44=head2 Statement labels can appear in more places
45
46Statement labels can now occur before any type of statement or declaration,
47such as C<package>.
48
9b7c43ba
KW
49=head2 C<use feature "unicode_strings"> now applies to more regex matching
50
51Another chunk of the L<perlunicode/The "Unicode Bug"> is fixed in this
52release. Now, regular expressions compiled within the scope of the
53"unicode_strings" feature (or under the "u" regex modifier (specifiable
54currently only with infix notation C<(?u:...)> or via C<use re '/u'>)
55will match the same whether or not the target string is encoded in utf8,
56with regard to C<[[:posix:]]> character classes
57
58Work is underway to add the case sensitive matching to the control of
59this feature, but was not complete in time for this dot release.
60
cba5a3b0
DG
61=head2 Array and hash container functions accept references
62
63All built-in functions that operate directly on array or hash
64containers now also accept hard references to arrays or hashes:
65
66 |----------------------------+---------------------------|
67 | Traditional syntax | Terse syntax |
68 |----------------------------+---------------------------|
69 | push @$arrayref, @stuff | push $arrayref, @stuff |
70 | unshift @$arrayref, @stuff | unshift $arrayref, @stuff |
71 | pop @$arrayref | pop $arrayref |
72 | shift @$arrayref | shift $arrayref |
73 | splice @$arrayref, 0, 2 | splice $arrayref, 0, 2 |
74 | keys %$hashref | keys $hashref |
75 | keys @$arrayref | keys $arrayref |
76 | values %$hashref | values $hashref |
77 | values @$arrayref | values $arrayref |
78 | ($k,$v) = each %$hashref | ($k,$v) = each $hashref |
79 | ($k,$v) = each @$arrayref | ($k,$v) = each $arrayref |
80 |----------------------------+---------------------------|
81
82This allows these built-in functions to act on long dereferencing chains
83or on the return value of subroutines without needing to wrap them in
84C<@{}> or C<%{}>:
85
86 push @{$obj->tags}, $new_tag; # old way
87 push $obj->tags, $new_tag; # new way
88
89 for ( keys %{$hoh->{genres}{artists}} ) {...} # old way
90 for ( keys $hoh->{genres}{artists} ) {...} # new way
91
92For C<push>, C<unshift> and C<splice>, the reference will auto-vivify
93if it is not defined, just as if it were wrapped with C<@{}>.
94
95Calling C<keys> or C<values> directly on a reference gives a substantial
96performance improvement over explicit dereferencing.
97
98For C<keys>, C<values>, C<each>, when overloaded dereferencing is
99present, the overloaded dereference is used instead of dereferencing the
100underlying reftype. Warnings are issued about assumptions made in the
101following three ambiguous cases:
102
103 (a) If both %{} and @{} overloading exists, %{} is used
104 (b) If %{} overloading exists on a blessed arrayref, %{} is used
105 (c) If @{} overloading exists on a blessed hashref, @{} is used
106
15bc3b4f
FC
107=head2 y///r
108
109The C</r> flag, which was added to C<s///> in 5.13.2, has been extended to
110the C<y///> operator.
111
112It causes it to perform the substitution on a I<copy> of its operand,
113returning that copy instead of a character count.
114
d29ae9fc
FR
115=head2 New global variable C<${^GLOBAL_PHASE}>
116
117A new global variable, C<${^GLOBAL_PHASE}>, has been added to allow
118introspection of the current phase of the perl interpreter. It's explained in
119detail in L<perlvar/"${^GLOBAL_PHASE}"> and
120L<perlmod/"BEGIN, UNITCHECK, CHECK, INIT and END">.
121
3ffed8c2 122=head2 Unicode Version 6.0 is now supported (mostly)
bd84d130 123
484741e1
KW
124Perl comes with the Unicode 6.0 data base updated with
125L<Corrigendum #8|http://www.unicode.org/versions/corrigendum8.html>,
126with one exception noted below.
bd84d130
KW
127See L<http://unicode.org/versions/Unicode6.0.0> for details on the new
128release. Perl does not support any Unicode provisional properties,
129including the new ones for this release, but their database files are
130packaged with Perl.
131
3ffed8c2
KW
132Unicode 6.0 has chosen to use the name C<BELL> for the character at U+1F514,
133which is a symbol that looks like a bell, and used in Japanese cell
134phones. This conflicts with the long-standing Perl usage of having
135C<BELL> mean the ASCII C<BEL> character, U+0007. In Perl 5.14,
136C<\N{BELL}> will continue to mean U+0007, but its use will generate a
137deprecated warning message, unless such warnings are turned off. The
138new name for U+0007 in Perl will be C<ALERT>, which corresponds nicely
139with the existing shorthand sequence for it, C<"\a">. C<\N{BEL}> will
140mean U+0007, with no warning given. The character at U+1F514 will not
141have a name in 5.14, but can be referred to by C<\N{U+1F514}>. The plan
142is that in Perl 5.16, C<\N{BELL}> will refer to U+1F514, and so all code
143that uses C<\N{BELL}> should convert by then to using C<\N{ALERT}>,
144C<\N{BEL}>, or C<"\a"> instead.
145
74100276
FC
146=head2 Improved support for custom OPs
147
148Custom ops can now be registered with the new C<custom_op_register> C
149function and the C<XOP> structure. This will make it easier to add new
150properties of custom ops in the future. Two new properties have been added
151already, C<xop_class> and C<xop_peep>.
152
153C<xop_class> is one of the OA_*OP constants, and allows L<B> and other
154introspection mechanisms to work with custom ops that aren't BASEOPs.
155C<xop_peep> is a pointer to a function that will be called for ops of this
156type from C<Perl_rpeep>.
157
158See L<perlguts/Custom Operators> and L<perlapi/Custom Operators> for more
159detail.
160
161The old C<PL_custom_op_names>/C<PL_custom_op_descs> interface is still
162supported but discouraged.
163
4c793fe3
FR
164=head1 Incompatible Changes
165
a638ba6f
FC
166=head2 Dereferencing typeglobs
167
168If you assign a typeglob to a scalar variable:
169
170 $glob = *foo;
171
172the glob that is copied to C<$glob> is marked with a special flag
173indicating that the glob is just a copy. This allows subsequent assignments
174to C<$glob> to overwrite the glob. The original glob, however, is
175immutable.
176
177Many Perl operators did not distinguish between these two types of globs.
178This would result in strange behaviour in edge cases: C<untie $scalar>
179would do nothing if the last thing assigned to the scalar was a glob
180(because it treated it as C<untie *$scalar>, which unties a handle).
0b6a3b5a 181Assignment to a glob slot (e.g., C<(*$glob) = \@some_array>) would simply
a638ba6f
FC
182assign C<\@some_array> to C<$glob>.
183
184To fix this, the C<*{}> operator (including the C<*foo> and C<*$foo> forms)
185has been modified to make a new immutable glob if its operand is a glob
186copy. Various operators that make a distinction between globs and scalars
187have been modified to treat only immutable globs as globs.
188
189This causes an incompatible change in code that assigns a glob to the
190return value of C<*{}> when that operator was passed a glob copy. Take the
191following code, for instance:
192
193 $glob = *foo;
194 *$glob = *bar;
195
196The C<*$glob> on the second line returns a new immutable glob. That new
15bc3b4f
FC
197glob is made an alias to C<*bar>. Then it is discarded. So the second
198assignment has no effect.
a638ba6f 199
f869c585
FC
200It also means that C<tie $handle> will now tie C<$handle> as a scalar, even
201if it has had a glob assigned to it.
202
a638ba6f
FC
203The upside to this incompatible change is that bugs
204L<[perl #77496]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77496>,
205L<[perl #77502]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77502>,
206L<[perl #77508]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77508>,
207L<[perl #77688]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77688>,
208and
209L<[perl #77812]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77812>,
210and maybe others, too, have been fixed.
211
0b6a3b5a
FC
212See L<http://rt.perl.org/rt3/Public/Bug/Display.html?id=77810> for even
213more detail.
a638ba6f 214
e437e8d7
FC
215=head2 Clearing stashes
216
217Stash list assignment C<%foo:: = ()> used to make the stash anonymous
218temporarily while it was being emptied. Consequently, any of its
219subroutines referenced elsewhere would become anonymous (showing up as
220"(unknown)" in C<caller>). Now they retain their package names, such that
221C<caller> will return the original sub name if there is still a reference
a9fd1744
FC
222to its typeglob, or "foo::__ANON__" otherwise
223L<[perl #79208]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=79208>.
e437e8d7 224
8f97a47a 225=head1 Deprecations
6904a83f 226
3ffed8c2
KW
227=head2 C<\N{BELL}> is deprecated
228
229This is because Unicode is using that name for a different character.
230See L</Unicode Version 6.0 is now supported (mostly)> for more
231explanation.
232
4c793fe3
FR
233=head1 Performance Enhancements
234
8f97a47a 235=over 4
e2babdfb 236
b141c43c
FR
237=item *
238
6d07abef
CBW
239When an object has many weak references to it, freeing that object
240can under some some circumstances take O(N^2) time to free (where N is the
241number of references). The number of circumstances has been reduced.
242L<[perl #75254]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=75254>.
b141c43c 243
4c793fe3
FR
244=back
245
246=head1 Modules and Pragmata
247
8f97a47a 248=head2 New Modules and Pragmata
25e68b8b 249
8f97a47a 250=over 4
463da0ac
CBW
251
252=item *
253
028d3bfa 254The following modules were added by the C<Unicode::Collate>
b5d9a953 255upgrade from 0.63 to 0.67. See below for details.
028d3bfa 256
584e761d 257C<Unicode::Collate::CJK::Big5>
028d3bfa
CBW
258
259C<Unicode::Collate::CJK::GB2312>
260
584e761d
CBW
261C<Unicode::Collate::CJK::JISX0208>
262
263C<Unicode::Collate::CJK::Korean>
028d3bfa
CBW
264
265C<Unicode::Collate::CJK::Pinyin>
266
267C<Unicode::Collate::CJK::Stroke>
6481ebaf 268
8f97a47a 269=back
6481ebaf 270
8f97a47a 271=head2 Updated Modules and Pragmata
6481ebaf 272
8f97a47a 273=over 4
ac4c9720
CBW
274
275=item *
276
9f1eb87f
CBW
277C<Archive::Extract> has been upgraded from 0.44 to 0.46
278
279Resolves an issue with NetBSD-current and its new unzip
280executable.
281
282=item *
283
5d8924b5 284C<Archive::Tar> has been upgraded from 1.68 to 1.72
deabda19
CBW
285
286This adds the ptargrep utility for using regular expressions against
287the contents of files in a tar archive.
288
289=item *
290
8770f09e 291C<B> has been upgraded from 1.24 to 1.26.
a5e71717 292
ca60ecf2
FC
293It no longer crashes when taking apart a C<y///> containing characters
294outside the octet range or compiled in a C<use utf8> scope.
295
cd094c23
NC
296The size of the shared object has been reduced by about 40%, with no
297reduction in functionality.
298
a5e71717
FC
299=item *
300
b293762b 301C<B::Deparse> has been upgraded from 0.99 to 1.01.
b7bd32cc
FC
302
303It fixes deparsing of C<our> followed by a variable with funny characters
304(as permitted under the C<utf8> pragma)
305L<[perl #33752]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=33752>.
306
307=item *
308
84601d63
CBW
309C<CGI> has been upgraded from 3.49 to 3.50
310
311This provides the following security fixes: the MIME boundary in
312multipart_init is now random and improvements to the handling of
313newlines embedded in header values.
314
315The documentation for param_fetch() has been corrected and clarified.
316
317=item *
318
07be2ace
CBW
319C<CPAN> has been upgraded from 1.94_61 to 1.94_62
320
321=item *
322
59af3f66
CBW
323C<CPANPLUS> has been upgraded from 0.9007 to 0.9010
324
325Fixes for the SQLite source engine and resolving of issues with the
326testsuite when run under local::lib and/or cpanminus
327
328=item *
329
f5c34353
CBW
330C<CPANPLUS::Dist::Build> has been upgraded from 0.48 to 0.50
331
332=item *
333
b73d44b7 334C<Data::Dumper> has been upgraded from 2.129 to 2.130_01.
ca60ecf2
FC
335
336=item *
337
9e2ac5d4
FC
338C<DynaLoader> has been upgraded from 1.10 to 1.11.
339
340It fixes a buffer overflow when passed a very long file name.
341
342=item *
343
48ea5431
FC
344C<ExtUtils::Constant> has been upgraded from 0.22 to 0.23.
345
cd094c23
NC
346The C<AUTOLOAD> helper code generated by C<ExtUtils::Constant::ProxySubs>
347can now C<croak> for missing constants, or generate a complete C<AUTOLOAD>
348subroutine in XS, allowing simplification of many modules that use it.
349(C<Fcntl>, C<File::Glob>, C<GDBM_File>, C<I18N::Langinfo>, C<POSIX>, C<Socket>)
350
351C<ExtUtils::Constant::ProxySubs> can now optionally push the names of all
352constants onto the package's C{@EXPORT_OK}. This has been used to replace
353less space-efficient code in C<B>, helping considerably shrink the size of its
354shared object.
355
48ea5431
FC
356=item *
357
358C<Fcntl> has been upgraded from 1.09 to 1.10.
359
360=item *
361
6d3bcdd8 362C<File::Fetch> has been upgraded from 0.24 to 0.28
0df024e2
CBW
363
364C<HTTP::Lite> is now supported for 'http' scheme.
365
6d3bcdd8
CBW
366The C<fetch> utility is supported on FreeBSD, NetBSD and
367Dragonfly BSD for the C<http> and C<ftp> schemes.
368
0df024e2
CBW
369=item *
370
48ea5431
FC
371C<File::Glob> has been upgraded from 1.09 to 1.10.
372
373=item *
374
ca60ecf2
FC
375C<File::stat> has been upgraded from 1.03 to 1.04.
376
377The C<-x> and C<-X> file test operators now work correctly under the root
378user.
379
380=item *
381
c39f7439
FC
382C<GDBM_File> has been upgraded from 1.11 to 1.12.
383
384This fixes a memory leak when DBM filters are used.
385
386=item *
387
48ea5431
FC
388C<Hash::Util> has been upgraded from 0.09 to 0.10.
389
b293762b
FC
390=item *
391
392C<Hash::Util::FieldHash> has been upgraded from 1.05 to 1.06.
48ea5431
FC
393
394=item *
395
396C<I18N::Langinfo> has been upgraded from 0.06 to 0.07.
397
398=item *
399
b22271be
FR
400C<Locale::Maketext> has been upgraded from 1.16 to 1.17.
401
402=item *
403
b73d44b7
CBW
404C<Math::BigInt> has been upgraded from 1.97 to 1.99_01.
405
406=item *
407
408C<Math::BigRat> has been upgraded from 0.26 to 0.26_01
e1be28b4
TR
409
410=item *
411
b73d44b7 412C<Math::BigInt::FastCalc> has been upgraded from 0.22 to 0.24_01.
b293762b
FC
413
414=item *
415
46787c0e
CBW
416C<MIME::Base64> has been upgraded from 3.09 to 3.10
417
418Includes new functions to calculate the length of encoded and decoded
419base64 strings.
420
421=item *
422
8ff01ef0
FC
423C<mro> has been upgraded from 1.04 to 1.05.
424
425=item *
426
c39f7439
FC
427C<NDBM_File> has been upgraded from 1.09 to 1.10.
428
429This fixes a memory leak when DBM filters are used.
430
431=item *
432
433C<ODBM_File> has been upgraded from 1.08 to 1.09.
434
435This fixes a memory leak when DBM filters are used.
436
437=item *
438
ca60ecf2
FC
439C<Opcode> has been upgraded from 1.16 to 1.17.
440
441=item *
442
a9aeb2f1
CBW
443C<parent> has been upgraded from 0.223 to 0.224
444
445=item *
446
40fcdb56
CBW
447C<Pod::Simple> has been upgraded from 3.14 to 3.15
448
449Includes various fixes to C<HTML> and C<XHTML> handling.
450
451=item *
452
48ea5431
FC
453C<POSIX> has been upgraded from 1.21 to 1.22.
454
455=item *
456
b7bd32cc
FC
457C<re> has been upgraded from 0.13 to 0.14, for the sake of the new
458C<use re "/flags"> pragma.
dfa4c013 459
48ea5431
FC
460=item *
461
8ff01ef0
FC
462C<Safe> has been upgraded from 2.28 to 2.29.
463
464It adds C<&version::vxs::VCMP> to the default share.
465
466=item *
467
48ea5431
FC
468C<SDBM_File> has been upgraded from 1.07 to 1.08.
469
470=item *
471
a5e71717
FC
472C<SelfLoader> has been upgraded from 1.17 to 1.18.
473
474It now works in taint mode
475L<[perl #72062]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=72062>.
476
477=item *
478
48ea5431
FC
479C<Socket> has been upgraded from 1.90 to 1.91.
480
a5e71717
FC
481=item *
482
fd0eba19
CBW
483C<Storable> has been upgraded from 2.22 to 2.24
484
485Includes performance improvement for overloaded classes.
486
487=item *
488
a5e71717
FC
489C<Sys::Hostname> has been upgraded from 1.13 to 1.14.
490
539ce3d8
CBW
491=item *
492
b5d9a953 493C<Unicode::Collate> has been upgraded from 0.63 to 0.67
028d3bfa 494
584e761d 495This release newly adds locales C<ja> C<ko> and C<zh> and its variants
028d3bfa
CBW
496( C<zh__big5han>, C<zh__gb2312han>, C<zh__pinyin>, C<zh__stroke> ).
497
b5d9a953
CBW
498Supported UCA_Version 22 for Unicode 6.0.0.
499
028d3bfa 500The following modules have been added:
539ce3d8 501
028d3bfa
CBW
502C<Unicode::Collate::CJK::Big5> for C<zh__big5han> which makes
503tailoring of CJK Unified Ideographs in the order of CLDR's big5han ordering.
504
505C<Unicode::Collate::CJK::GB2312> for C<zh__gb2312han> which makes
506tailoring of CJK Unified Ideographs in the order of CLDR's gb2312han ordering.
507
584e761d
CBW
508C<Unicode::Collate::CJK::JISX0208> which makes tailoring of 6355 kanji
509(CJK Unified Ideographs) in the JIS X 0208 order.
510
511C<Unicode::Collate::CJK::Korean> which makes tailoring of CJK Unified Ideographs
512in the order of CLDR's Korean ordering.
513
028d3bfa
CBW
514C<Unicode::Collate::CJK::Pinyin> for C<zh__pinyin> which makes
515tailoring of CJK Unified Ideographs in the order of CLDR's pinyin ordering.
516
517C<Unicode::Collate::CJK::Stroke> for C<zh__stroke> which makes
518tailoring of CJK Unified Ideographs in the order of CLDR's stroke ordering.
519
8f97a47a 520=back
dfa4c013 521
8f97a47a 522=head1 Documentation
918184d1 523
570c3caa 524L<perlvar> reorders the variables and groups them by topic. Each variable
525introduced after Perl 5.000 notes the first version in which it is
526available. L<perlvar> also has a new section for deprecated variables to
527note when they were removed.
528
8f97a47a 529=head2 New Documentation
dca41e57 530
b73d44b7 531=head3 L<perlpodstyle>
dca41e57 532
b73d44b7
CBW
533New style guide for POD documentation,
534split mostly from the NOTES section of the pod2man man page.
c9a84c8b 535
b73d44b7 536( This was added to C<v5.13.6> but was not documented with that release ).
4c793fe3 537
ee0887a9 538=head2 Changes to Existing Documentation
fc1418b7 539
7eb82171
DG
540=over
541
48ea5431
FC
542=item *
543
a5e71717 544Array and hash slices in scalar context are now documented in L<perldata>.
48ea5431 545
b293762b
FC
546=item *
547
548L<perlform> and L<perllocale> have been corrected to state that
549C<use locale> affects formats.
550
7eb82171
DG
551=back
552
4c793fe3
FR
553=head1 Diagnostics
554
8f97a47a 555=head2 New Diagnostics
4c793fe3 556
dc08898c
FC
557=over 4
558
559=item *
560
15bc3b4f
FC
561"Using !~ with %s doesn't make sense": This message was actually added in
5625.13.2, but was omitted from perldelta. It now applies also to the C<y///>
563operator, and has been documented.
dc08898c
FC
564
565=back
566
8f97a47a 567=head1 Utility Changes
810f3b7c 568
deabda19 569=head3 L<ptargrep>
85318b69 570
ee0887a9 571=over 4
80b6a949 572
e2babdfb
FR
573=item *
574
deabda19
CBW
575L<ptargrep> is a utility to apply pattern matching to the contents of files
576in a tar archive. It comes with C<Archive::Tar>.
9ae8c3d9 577
ee0887a9 578=back
e2babdfb 579
8f97a47a 580=head1 Testing
5a9a79a4 581
8f97a47a 582=over 4
a7e93501
FC
583
584=item *
585
a9fd1744
FC
586The new F<t/mro/isa_aliases.t> has been added, which tests that
587C<*Foo::ISA = *Bar::ISA> works properly.
588
589=item *
590
15bc3b4f
FC
591F<t/mro/isarev.t> has been added, which tests that C<PL_isarev> (accessible
592at the Perl level via C<mro::get_isarev>) is updated properly.
593
a9fd1744 594=item *
15bc3b4f
FC
595
596F<t/run/switchd-78586.t> has been added, which tests that
597L<[perl #78586]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78586>
36b9bdc9 598has been fixed (related to line numbers in the debugger).
a7e93501 599
8f97a47a 600=back
a7e93501 601
8f97a47a 602=head1 Platform Support
a7e93501 603
8f97a47a 604=head2 Platform-Specific Notes
be1cc451 605
8f97a47a 606=over 4
b20c4ee1 607
b293762b 608=item Windows
afa74577 609
b293762b
FC
610Directory handles are now properly cloned when threads are created. In perl
6115.13.6, child threads simply stopped inheriting directory handles. In
612previous versions, threads would share handles, resulting in crashes.
afa74577 613
ffc8a9ad
SH
614Support for building with Visual C++ 2010 is now underway, but is not yet
615complete. See F<README.win32> for more details.
360f7568 616
cd67cda5
CB
617=item VMS
618
b2df7661 619Record-oriented files (record format variable or variable with fixed control)
cd67cda5
CB
620opened for write by the perlio layer will now be line buffered to prevent the
621introduction of spurious line breaks whenever the perlio buffer fills up.
622
8f97a47a 623=back
c8bbf675 624
8f97a47a 625=head1 Internal Changes
c8bbf675 626
8f97a47a 627=over 4
07d5f7aa 628
9ae8c3d9
FC
629=item *
630
b7bd32cc
FC
631C<lex_start> has been added to the API, but is considered experimental.
632
633=item *
634
635A new C<parse_block> function has been added to the API
636L<[perl #78222]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78222>.
637
638=item *
639
c678e617 640A new, experimental API has been added for accessing the internal
b7bd32cc
FC
641structure that Perl uses for C<%^H>. See the functions beginning with
642C<cophh_> in L<perlapi>.
9ae8c3d9 643
a5e71717
FC
644=item *
645
646A stash can now have a list of effective names in addition to its usual
8ff01ef0
FC
647name. The first effective name can be accessed via the C<HvENAME> macro,
648which is now the recommended name to use in MRO linearisations (C<HvNAME>
649being a fallback if there is no C<HvENAME>).
650
651These names are added and deleted via C<hv_ename_add> and
652C<hv_ename_delete>. These two functions are I<not> part of the API.
a5e71717 653
b293762b
FC
654=item *
655
656The way the parser handles labels has been cleaned up and refactored. As a
657result, the C<newFOROP()> constructor function no longer takes a parameter
658stating what label is to go in the state op.
659
660=item *
661
662The C<newWHILEOP()> and C<newFOROP()> functions no longer accept a line
663number as a parameter.
664
665=item *
666
667A new C<parse_barestmt()> function has been added, for parsing a statement
668without a label.
669
670=item *
671
672A new C<parse_label()> function has been added, that parses a statement
46c4051f 673label, separate from statements.
b293762b
FC
674
675=item *
676
677The C<CvSTASH()> macro can now only be used as an rvalue. C<CvSTASH_set()>
678has been added to replace assignment to C<CvSTASH()>. This is to ensure
679that backreferences are handled properly. These macros are not part of the
680API.
681
682=item *
683
684The C<op_scope()> and C<op_lvalue()> functions have been added to the API,
685but are considered experimental.
686
8f97a47a 687=back
825563b9 688
8f97a47a 689=head1 Selected Bug Fixes
825563b9 690
8f97a47a 691=over 4
825563b9 692
020fe755
AB
693=item *
694
b7bd32cc
FC
695The C<parse_stmt> C function added in earlier in the 5.13.x series has been
696fixed to work with statements ending with C<}>
697L<[perl #78222]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78222>.
698
699=item *
700
701The C<parse_fullstmt> C function added in 5.13.5 has been fixed to work
702when called while an expression is being parsed.
703
704=item *
705
706Characters in the Latin-1 non-ASCII range (0x80 to 0xFF) used not to match
707themselves if the string happened to be UTF8-encoded internally, the
708regular expression was not, and the character in the regular expression was
709inside a repeated group (e.g.,
c678e617 710C<Encode::decode_utf8("\303\200") =~ /(\xc0)+/>)
b7bd32cc
FC
711L<[perl #78464]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78464>.
712
713=item *
714
715The C<(?d)> regular expression construct now overrides a previous C<(?u)>
716or C<use feature "unicode_string">
717L<[perl #78508]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78508>.
718
719=item *
720
721A memory leak in C<do "file">, introduced in perl 5.13.6, has been fixed
722L<[perl #78488]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78488>.
020fe755 723
b293762b
FC
724=item *
725
726Various bugs related to typeglob dereferencing have been fixed. See
727L</Dereferencing typeglobs>, above.
728
729=item *
730
731The C<SvPVbyte> function available to XS modules now calls magic before
732downgrading the SV, to avoid warnings about wide characters
733L<[perl #72398]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=72398>.
734
735=item *
736
737The C<=> operator used to ignore magic (e.g., tie methods) on its
738right-hand side if the scalar happened to hold a typeglob. This could
739happen if a typeglob was the last thing returned from or assigned to a tied
740scalar
741L<[perl #77498]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77498>.
742
743=item *
744
745C<sprintf> was ignoring locales when called with constant arguments
746L<[perl #78632]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78632>.
747
9b7c43ba
KW
748=item *
749
750A non-ASCII character in the Latin-1 range could match both a Posix
751class, such as C<[[:alnum:]]>, and its inverse C<[[:^alnum:]]>. This is
752now fixed for regular expressions compiled under the C<"u"> modifier.
753See L</C<use feature "unicode_strings"> now applies to more regex matching>.
754L<[perl #18281]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=18281>.
755
8ff01ef0
FC
756=item *
757
758Concatenating long strings under C<use encoding> no longer causes perl to
759crash
760L<[perl #78674]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78674>.
761
762=item *
763
e55e5103
FC
764Typeglob assignments would crash if the glob's stash no longer existed, so
765long as the glob assigned to was named 'ISA' or the glob on either side of
766the assignment contained a subroutine.
8ff01ef0
FC
767
768=item *
769
4cca7b69
FC
770Calling C<< ->import >> on a class lacking an import method could corrupt
771the stack, resulting in strange behaviour. For instance,
8ff01ef0
FC
772
773 push @a, "foo", $b = bar->import;
774
775would assign 'foo' to C<$b>
776L<[perl #63790]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=63790>.
777
778=item *
779
780Creating an alias to a package when that package had been detached from the
781symbol table would result in corrupted isa caches
782L<[perl #77358]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77358>.
783
784=item *
785
786C<.=> followed by C<< <> >> or C<readline> would leak memory if C<$/>
787contained characters beyond the octet range and the scalar assigned to
788happened to be encoded as UTF8 internally
789L<[perl #72246]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=72246>.
790
791=item *
792
793The C<recv> function could crash when called with the MSG_TRUNC flag
794L<[perl #75082]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=75082>.
795
9e2ac5d4
FC
796=item *
797
798Evaluating a simple glob (like C<*a>) was calling get-magic on the glob,
799even when its contents were not being used
800L<[perl #78580]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78580>.
801
802This bug was introduced in 5.13.2 and did not affect earlier perl versions.
803
15bc3b4f
FC
804=item *
805
806Matching a Unicode character against an alternation containing characters
807that happened to match continuation bytes in the former's UTF8
808representation (C<qq{\x{30ab}} =~ /\xab|\xa9/>) would cause erroneous
809warnings
810L<[perl #70998]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=70998>.
811
812=item *
813
814C<s///r> (added in 5.13.2) no longer leaks.
815
ca60ecf2
FC
816=item *
817
818The trie optimisation was not taking empty groups into account, preventing
819'foo' from matching C</\A(?:(?:)foo|bar|zot)\z/>
820L<[perl #78356]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78356>.
821
822=item *
823
824A pattern containing a C<+> inside a lookahead would sometimes cause an
825incorrect match failure in a global match (e.g., C</(?=(\S+))/g>)
826L<[perl #68564]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=68564>.
827
828=item *
829
830Iterating with C<foreach> over an array returned by an lvalue sub now works
831L<[perl #23790]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=23790>.
832
833=item *
834
835C<$@> is now localised during calls to C<binmode> to prevent action at a
836distance
837L<[perl #78844]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78844>.
838
839=item *
840
841C<PL_isarev>, which is accessible to Perl via C<mro::get_isarev> is now
842updated properly when packages are deleted or removed from the C<@ISA> of
843other classes. This allows many packages to be created and deleted without
844causing a memory leak
845L<[perl #75176]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=75176>.
846
847=item *
848
518a9858
FC
849C<undef *Foo::> and C<undef *Foo::ISA> and C<delete $package::{ISA}>
850used not to update the internal isa caches if the
851stash or C<@ISA> array had a reference elsewhere. In
ca60ecf2 852fact, C<undef *Foo::ISA> would stop a new C<@Foo::ISA> array from updating
7683cad7 853caches.
ca60ecf2 854
38dbd939
FC
855=item *
856
857C<@ISA> arrays can now be shared between classes via
858C<*Foo::ISA = \@Bar::ISA> or C<*Foo::ISA = *Bar::ISA>
859L<[perl #77238]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77238>.
860
861=item *
862
863The parser no longer hangs when encountering certain Unicode characters,
864such as U+387
865L<[perl #74022]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=74022>.
866
867=item *
868
b4bbb350
FC
869C<formline> no longer crashes when passed a tainted format picture. It also
870taints C<$^A> now if its arguments are tainted
38dbd939
FC
871L<[perl #79138]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=79138>.
872
6d07abef
CBW
873=item *
874
875A signal handler called within a signal handler could cause leaks or
876double-frees. Now fixed.
877L<[perl #76248]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=76248>.
878
ad434082
FR
879=item *
880
881When trying to report C<Use of uninitialized value $Foo::BAR>, crashes could
882occur if the GLOB of the global variable causing the warning has been detached
883from its original stash by, for example C<delete $::{'Foo::'}>. This has been
884fixed by disabling the reporting of variable names in the warning in those
885cases.
886
8f97a47a 887=back
020fe755 888
8f97a47a 889=head1 Obituary
405fd67e 890
dd56ec38
DG
891Randy Kobes, creator of the kobesearch alternative to search.cpan.org and
892contributor/maintainer to several core Perl toolchain modules, passed away
67fa491b 893on September 18, 2010 after a battle with lung cancer. His contributions
dd56ec38
DG
894to the Perl community will be missed.
895
ee0887a9 896=head1 Acknowledgements
0195fb5f 897
91a7d54e
CBW
898Perl 5.13.7 represents approximately one month of development since Perl 5.13.6
899and contains 72427 lines of changes across 516 files from 39 authors and committers:
900
901Abhijit Menon-Sen, Abigail, Ben Morrow, Chas. J. Owens IV, Chris 'BinGOs' Williams, Craig A. Berry,
902David Golden, David Mitchell, Father Chrysostomos, Fingle Nark, Florian Ragwitz, George Greer,
903Grant McLean, H.Merijn Brand, Ian Goodacre, Jan Dubois, Jerry D. Hedden, Jesse Vincent, Karl Williamson,
904Lubomir Rintel, Marty Pauley, Moritz Lenz, Nicholas Clark, Nicolas Kaiser, Niko Tyni, Peter John Acklam,
905Rafael Garcia-Suarez, Shlomi Fish, Steffen Mueller, Steve Hay, Tatsuhiko Miyagawa, Tim Bunce, Todd Rinaldo,
906Tom Christiansen, Tom Hukins, Tony Cook, Yves Orton, Zefram and brian d foy
907
908Many of the changes included in this version originated in the CPAN modules included in
909Perl's core. We're grateful to the entire CPAN community for helping Perl to flourish.
4c793fe3
FR
910
911=head1 Reporting Bugs
912
913If you find what you think is a bug, you might check the articles
914recently posted to the comp.lang.perl.misc newsgroup and the perl
915bug database at http://rt.perl.org/perlbug/ . There may also be
916information at http://www.perl.org/ , the Perl Home Page.
917
918If you believe you have an unreported bug, please run the B<perlbug>
919program included with your release. Be sure to trim your bug down
920to a tiny but sufficient test case. Your bug report, along with the
921output of C<perl -V>, will be sent off to perlbug@perl.org to be
922analysed by the Perl porting team.
923
924If the bug you are reporting has security implications, which make it
925inappropriate to send to a publicly archived mailing list, then please send
ee0887a9 926it to perl5-security-report@perl.org. This points to a closed subscription
4c793fe3
FR
927unarchived mailing list, which includes all the core committers, who be able
928to help assess the impact of issues, figure out a resolution, and help
929co-ordinate the release of patches to mitigate or fix the problem across all
ee0887a9 930platforms on which Perl is supported. Please only use this address for
4c793fe3
FR
931security issues in the Perl core, not for modules independently
932distributed on CPAN.
933
934=head1 SEE ALSO
935
936The F<Changes> file for an explanation of how to view exhaustive details
937on what changed.
938
939The F<INSTALL> file for how to build Perl.
940
941The F<README> file for general stuff.
942
943The F<Artistic> and F<Copying> files for copyright information.
944
945=cut