This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #77234] Change 649d02de (unary prototypes) changes precedence
[perl5.git] / pod / perl5134delta.pod
CommitLineData
e90f0e29
DG
1=encoding utf8
2
3=head1 NAME
4
5eefbcc7 5perl5134delta - what is new for perl v5.13.4
e90f0e29
DG
6
7=head1 DESCRIPTION
8
9This document describes differences between the 5.13.4 release and
10the 5.13.3 release.
11
12If you are upgrading from an earlier release such as 5.13.2, first read
13L<perl5133delta>, which describes differences between 5.13.2 and
145.13.3.
15
e90f0e29
DG
16=head1 Core Enhancements
17
83832992
KW
18=head2 C<srand()> now returns the seed
19
5bd0cfd2 20This allows programs that need to have repeatable results to not have to come
83832992
KW
21up with their own seed generating mechanism. Instead, they can use C<srand()>
22and somehow stash the return for future use. Typical is a test program which
23has too many combinations to test comprehensively in the time available to it
a98d1b31
FR
24each run. It can test a random subset each time, and should there be a failure,
25log the seed used for that run so that it can later be used to reproduce the
26exact results.
27
874cd4e1
FR
28=head2 Creating unary functions with prototypes
29
30Calls to functions created with the following prototypes are now correctly parsed
31
32Functions declared with the following prototypes now behave correctly as unary functions:
33
34=over 4
35
36=item *
37
49be3765 38C<*>
874cd4e1
FR
39
40=item *
41
49be3765 42C<\sigil>
874cd4e1
FR
43
44=item *
45
49be3765 46C<\[...]>
874cd4e1
FR
47
48=item *
49
49be3765 50C<;$>
874cd4e1
FR
51
52=item *
53
49be3765 54C<;*>
874cd4e1
FR
55
56=item *
57
49be3765 58C<;\sigil>
874cd4e1
FR
59
60=item *
61
49be3765 62C<;\[...]>
874cd4e1
FR
63
64=back
65
a98d1b31
FR
66=head2 C<\N{I<name>}> and C<charnames> enhancements
67
68C<\N{}>, C<charnames::vianame>, C<charnames::viacode> now know about every
69character in Unicode. Previously, they didn't know about the Hangul syllables
70nor a number of CJK (Chinese/Japanese/Korean) characters.
83832992 71
e90f0e29
DG
72=head1 Incompatible Changes
73
dbce4399 74=head2 Declare API incompatibility between blead releases
e90f0e29 75
dbce4399
FR
76Only stable releases (5.10.x, 5.12.x, 5.14.x, ...) guarantee binary
77compatibility with each other, while blead releases (5.13.x, 5.15.x, ...) often
78break this compatibility. However, prior to perl 5.13.4, all blead releases had
79the same C<PERL_API_REVISION>, C<PERL_API_VERSION>, and C<PERL_API_SUBVERSION>,
80effectively declaring them as binary compatible, which they weren't. From now
81on, blead releases will have a C<PERL_API_SUBVERSION> equal to their
82C<PERL_SUBVERSION>, explicitly marking them as incompatible with each other.
e90f0e29 83
5bd0cfd2 84Maintenance releases of stable perl versions will continue to make no
dbce4399
FR
85intentionally incompatible API changes.
86
87=head2 Check API compatibility when loading XS modules
88
89When perl's API changes in incompatible ways (which usually happens between
90every major release), XS modules compiled for previous versions of perl will not
91work anymore. They will need to be recompiled against the new perl.
92
93In order to ensure that modules are recompiled, and to prevent users from
94accidentally loading modules compiled for old perls into newer ones, the
95C<XS_APIVERSION_BOOTCHECK> macro has been added. That macro, which is called
96when loading every newly compiled extension, compares the API version of the
97running perl with the version a module has been compiled for and raises an
98exception if they don't match.
e90f0e29 99
e795e964
KW
100=head2 Binary Incompatible with all previous Perls
101
5bd0cfd2 102Some bit fields have been reordered; therefore, this release will not be binary
123a0cbb 103compatible with any previous Perl release.
e795e964 104
61ea75ac
FC
105=head2 Change in the parsing of certain prototypes
106
107Due to a bug fix, functions using the C<(*)>, C<(;$)> and C<(;*)>
108prototypes are parsed with higher precedence than before. So in the
109following example:
110
111 sub foo($);
112 foo $a < $b;
113
114the second line is now parsed correctly as C<< foo($a) < $b >>, rather than
115C<< foo($a < $b) >>. This happens when one of these operators is used in
116an unparenthesised argument:
117
118 < > <= >= lt gt le ge
119 == != <=> eq ne cmp ~~
120 &
121 | ^
122 &&
123 || //
124 .. ...
125 ?:
126 = += -= *= etc.
127
e90f0e29
DG
128=head1 Deprecations
129
b631e5c2
FR
130=head2 List assignment to C<$[>
131
132After assignment to C<$[> has been deprecated and started to give warnings in
133perl version 5.12.0, this version of perl also starts to emit a warning when
134assigning to C<$[> in list context. This fixes an oversight in 5.12.0.
135
e90f0e29
DG
136=head1 Performance Enhancements
137
e90f0e29
DG
138=over 4
139
140=item *
141
874cd4e1
FR
142Make string appending 100 times faster
143
144When doing a lot of string appending, perl could end up allocating a lot more
145memory than needed in a very inefficient way, if perl was configured to use the
146system's C<malloc> implementation instead of its own.
147
148C<sv_grow>, which is what's being used to allocate more memory if necessary when
5bd0cfd2 149appending to a string, has now been taught how to round up the memory it
874cd4e1
FR
150requests to a certain geometric progression, making it much faster on certain
151platforms and configurations. On Win32, it's now about 100 times faster.
152
153=item *
154
8f7d8cf4 155For weak references, the common case of just a single weak reference per
123a0cbb
FR
156referent has been optimised to reduce the storage required. In this case it
157saves the equivalent of one small perl array per referent.
8f7d8cf4
FR
158
159=item *
160
874cd4e1
FR
161C<XPV>, C<XPVIV>, and C<XPVNV> now only allocate the parts of the C<SV> body
162they actually use, saving some space.
e90f0e29
DG
163
164=back
165
166=head1 Modules and Pragmata
167
e90f0e29
DG
168=head2 New Modules and Pragmata
169
123a0cbb 170This release does not introduce any new modules or pragmata.
e90f0e29
DG
171
172=head2 Updated Modules and Pragmata
173
174=over 4
175
5aa76647
FR
176=item C<Archive::Tar>
177
47237f0a 178Upgraded from version 1.64 to 1.68.
5aa76647
FR
179
180Among other things, the new version adds a new option to C<ptar> to allow safe
181creation of tarballs without world-writable files on Windows, allowing those
182archives to be uploaded to CPAN.
183
a767f83c
FR
184=item C<B::Lint>
185
186Upgraded from version 1.11 to 1.12.
187
09d86ea5 188=item C<Carp>
e90f0e29 189
09d86ea5
FR
190Upgraded from version 1.16 to 1.18.
191
123a0cbb
FR
192L<Carp> now detects incomplete L<caller()|perlfunc/"caller EXPR"> overrides and
193avoids using bogus C<@DB::args>. To provide backtraces, Carp relies on
194particular behaviour of the caller built-in. Carp now detects if other code has
195overridden this with an incomplete implementation, and modifies its backtrace
196accordingly. Previously incomplete overrides would cause incorrect values in
197backtraces (best case), or obscure fatal errors (worst case)
48792a70
FR
198
199This fixes certain cases of C<Bizarre copy of ARRAY> caused by modules
200overriding C<caller()> incorrectly.
09d86ea5 201
97613388
FR
202=item C<Compress::Raw::Bzip2>
203
204Upgraded from version 2.027 to 2.030.
205
206=item C<Compress::Raw::Zlib>
207
208Upgraded from version 2.027 to 2.030.
209
09d86ea5
FR
210=item C<File::Spec>
211
212Upgraded from version 3.31 to 3.31_01.
213
214Various issues in L<File::Spec::VMS> have been fixed.
e90f0e29 215
123a0cbb 216=item C<I18N::Langinfo>
7d255e31
FR
217
218Upgraded from version 0.03 to 0.04.
219
220C<langinfo()> now defaults to using C<$_> if there is no argument given, just
221like the documentation always claimed it did.
222
97613388
FR
223=item C<IO::Compress>
224
225Upgraded from version 2.027 to 2.030.
226
7d255e31
FR
227=item C<Module::CoreList>
228
229Upgraded from version 2.36 to 2.37.
230
231Besides listing the updated core modules of this release, it also stops listing
232the C<Filespec> module. That module never existed in core. The scripts
233generating C<Module::CoreList> confused it with C<VMS::Filespec>, which actually
234is a core module, since the time of perl 5.8.7.
235
b631e5c2
FR
236=item C<Test::Harness>
237
238Upgraded from version 3.21 to 3.22.
239
874cd4e1
FR
240=item C<Test::Simple>
241
242Upgraded from version 0.94 to 0.96.
243
244Among many other things, subtests without a C<plan> or C<no_plan> now have an
245implicit C<done_testing()> added to them.
246
a98d1b31
FR
247=item C<Unicode::Collate>
248
249Upgraded from version 0.53 to 0.56.
250
251Among other things, it is now using UCA Revision 20 (based on Unicode 5.2.0) and
252supports a couple of new locales.
253
c0c2d88f
FR
254=item C<feature>
255
256Upgraded from version 1.17 to 1.18.
257
e90f0e29
DG
258=back
259
260=head2 Removed Modules and Pragmata
261
123a0cbb 262This release does not remove any modules or pragmata.
e90f0e29
DG
263
264=head1 Documentation
265
e90f0e29
DG
266=head2 Changes to Existing Documentation
267
dbce4399
FR
268=head3 L<perldiag>
269
270=over 4
271
272=item *
273
274The following existing diagnostics are now documented:
275
276=over 4
277
278=item *
279
280L<Ambiguous use of %c resolved as operator %c|perldiag/"Ambiguous use of %c resolved as operator %c">
281
282=item *
283
284L<Ambiguous use of %c{%s} resolved to %c%s|perldiag/"Ambiguous use of %c{%s} resolved to %c%s">
285
286=item *
287
288L<Ambiguous use of %c{%s%s} resolved to %c%s%s|perldiag/"Ambiguous use of %c{%s%s} resolved to %c%s%s">
289
290=item *
291
292L<Ambiguous use of -%s resolved as -&%s()|perldiag/"Ambiguous use of -%s resolved as -&%s()">
293
874cd4e1
FR
294=item *
295
296L<Invalid strict version format (%s)|perldiag/"Invalid strict version format (%s)">
297
298=item *
299
300L<Invalid version format (%s)|perldiag/"Invalid version format (%s)">
301
302=item *
303
304L<Invalid version object|perldiag/"Invalid version object">
305
dbce4399
FR
306=back
307
308=back
309
09d86ea5 310=head3 L<perlport>
e90f0e29
DG
311
312=over 4
313
314=item *
315
09d86ea5
FR
316Documented a L<limitation|perlport/alarm> of L<alarm()|perlfunc/"alarm SECONDS">
317on Win32.
e90f0e29
DG
318
319=back
320
874cd4e1
FR
321=head3 L<perlre>
322
323=over 4
324
325=item *
326
327Minor fix to a multiple scalar match example.
328
329=back
330
e90f0e29
DG
331=head1 Configuration and Compilation
332
e90f0e29
DG
333=over 4
334
335=item *
336
874cd4e1
FR
337Compatibility with C<C++> compilers has been improved.
338
339=item *
340
341On compilers that support it, C<-Wwrite-strings> is now added to cflags by
342default.
e90f0e29
DG
343
344=back
345
346=head1 Testing
347
e90f0e29
DG
348=over 4
349
350=item *
351
5aa76647 352F<t/op/print.t> has been added to test implicit printing of C<$_>.
e90f0e29 353
dbce4399
FR
354=item *
355
356F<t/io/errnosig.t> has been added to test for restoration of of C<$!> when
357leaving signal handlers.
358
a98d1b31
FR
359=item *
360
361F<t/op/tie_fetch_count.t> has been added to see if C<FETCH> is only called once
362on tied variables.
363
364=item *
365
366F<lib/Tie/ExtraHash.t> has been added to make sure the, previously untested,
367L<Tie::ExtraHash> keeps working.
368
ac9f49e6
FR
369=item *
370
371F<t/re/overload.t> has been added to test against string corruption in pattern
372matches on overloaded objects. This is a TODO test.
373
e90f0e29
DG
374=back
375
376=head1 Platform Support
377
e90f0e29
DG
378=head2 Platform-Specific Notes
379
e90f0e29
DG
380=over 4
381
09d86ea5 382=item Win32
e90f0e29 383
09d86ea5
FR
384=over 4
385
386=item *
387
388Fixed a possible hang in F<t/op/readline.t>.
389
390=item *
391
123a0cbb 392Fixed build process for SDK2003SP1 compilers.
09d86ea5 393
a98d1b31
FR
394=item *
395
396When using old 32-bit compilers, the define C<_USE_32BIT_TIME_T> will now be set
397in C<$Config{ccflags}>. This improves portability when compiling XS extensions
398using new compilers, but for a perl compiled with old 32-bit compilers.
399
09d86ea5 400=back
e90f0e29
DG
401
402=back
403
404=head1 Internal Changes
405
e90f0e29
DG
406=over 4
407
09d86ea5 408=item Removed C<PERL_POLLUTE>
e90f0e29 409
09d86ea5
FR
410The option to define C<PERL_POLLUTE> to expose older 5.005 symbols for backwards
411compatibility has been removed. It's use was always discouraged, and MakeMaker
412contains a more specific escape hatch:
413
414 perl Makefile.PL POLLUTE=1
415
416This can be used for modules that have not been upgraded to 5.6 naming
417conventions (and really should be completely obsolete by now).
418
8f7d8cf4
FR
419=item Added C<PERL_STATIC_INLINE>
420
123a0cbb 421The C<PERL_STATIC_INLINE> define has been added to provide the best-guess
8f7d8cf4
FR
422incantation to use for static inline functions, if the C compiler supports
423C99-style static inline. If it doesn't, it'll give a plain C<static>.
424
425C<HAS_STATIC_INLINE> can be used to check if the compiler actually supports
426inline functions.
427
e90f0e29
DG
428=back
429
430=head1 Selected Bug Fixes
431
e90f0e29
DG
432=over 4
433
434=item *
435
48792a70
FR
436A possible memory leak when using L<caller()|perlfunc/"caller EXPR"> to set
437C<@DB::args> has been fixed.
09d86ea5
FR
438
439=item *
440
441Several memory leaks when loading XS modules were fixed.
e90f0e29 442
5aa76647
FR
443=item *
444
445A panic in the regular expression optimizer has been fixed (RT#75762).
446
447=item *
448
449Assignments to lvalue subroutines now honor copy-on-write behavior again, which
450has been broken since version 5.10.0 (RT#75656).
451
dbce4399
FR
452=item *
453
454Assignments to glob copies now behave just like assignments to regular globs
455(RT#1804).
456
457=item *
458
459Within signal handlers, C<$!> is now implicitly localized.
460
874cd4e1
FR
461=item *
462
463L<readline|perlfunc/"readline EXPR"> now honors C<< <> >> overloading on tied
464arguments.
465
6f3f41ca
FR
466=item *
467
643222e1 468L<substr()|perlfunc/"substr EXPR,OFFSET,LENGTH,REPLACEMENT">,
6f3f41ca
FR
469L<pos()|perlfunc/"index STR,SUBSTR,POSITION">, L<keys()|perlfunc/"keys HASH">,
470and L<vec()|perlfunc/"vec EXPR,OFFSET,BITS"> could, when used in combination
471with lvalues, result in leaking the scalar value they operate on, and cause its
472destruction to happen too late. This has now been fixed.
473
8f7d8cf4
FR
474=item *
475
476Building with C<PERL_GLOBAL_STRUCT>, which has been broken accidentally in
4775.13.3, now works again.
478
e90f0e29
DG
479=back
480
481=head1 Known Problems
482
e90f0e29
DG
483=over 4
484
485=item *
486
643222e1 487The changes in L<substr()|perlfunc/"substr EXPR,OFFSET,LENGTH,REPLACEMENT">
e5e6576a
FR
488broke C<HTML::Parser> <= 3.66. A fixed C<HTML::Parser> is available as version
4893.67 on CPAN.
e90f0e29 490
63cf2492
FR
491=item *
492
493The changes in prototype handling break C<Switch>. A patch has been sent
494upstream and will hopefully appear on CPAN soon.
495
e90f0e29
DG
496=back
497
123a0cbb 498=head1 Acknowledgements
e90f0e29 499
123a0cbb 500Perl 5.13.4 represents approximately one month of development since Perl 5.13.3,
cf00cff5 501and contains 91,200 lines of changes across 436 files from 34 authors and
123a0cbb 502committers.
e90f0e29 503
123a0cbb 504Thank you to the following for contributing to this release:
e90f0e29 505
cf00cff5
FR
506Abigail, Andy Armstrong, Andy Dougherty, Chas. Owens, Chip Salzenberg, Chris
507'BinGOs' Williams, Craig A. Berry, David Cantrell, David Golden, David Mitchell,
508Eric Brine, Father Chrysostomos, Florian Ragwitz, George Greer, Gerard Goossen,
509H.Merijn Brand, James Mastros, Jan Dubois, Jerry D. Hedden, Joshua ben Jore,
510Karl Williamson, Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯, Leon Brocard, Lubomir Rintel, Nicholas
511Clark, Paul Marquess, Rafael Garcia-Suarez, Reini Urban, Robin Barker, Slaven
512Rezic, Steve Peters, Tony Cook, Wolfram Humann, Zefram
e90f0e29
DG
513
514=head1 Reporting Bugs
515
123a0cbb
FR
516If you find what you think is a bug, you might check the articles recently
517posted to the comp.lang.perl.misc newsgroup and the perl bug database at
518http://rt.perl.org/perlbug/ . There may also be information at
519http://www.perl.org/ , the Perl Home Page.
e90f0e29 520
123a0cbb
FR
521If you believe you have an unreported bug, please run the B<perlbug> program
522included with your release. Be sure to trim your bug down to a tiny but
523sufficient test case. Your bug report, along with the output of C<perl -V>,
524will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
e90f0e29
DG
525
526If the bug you are reporting has security implications, which make it
123a0cbb
FR
527inappropriate to send to a publicly archived mailing list, then please send it
528to perl5-security-report@perl.org. This points to a closed subscription
529unarchived mailing list, which includes all the core committers, who be able to
530help assess the impact of issues, figure out a resolution, and help co-ordinate
531the release of patches to mitigate or fix the problem across all platforms on
532which Perl is supported. Please only use this address for security issues in the
533Perl core, not for modules independently distributed on CPAN.
e90f0e29
DG
534
535=head1 SEE ALSO
536
537The F<Changes> file for an explanation of how to view exhaustive details
538on what changed.
539
540The F<INSTALL> file for how to build Perl.
541
542The F<README> file for general stuff.
543
544The F<Artistic> and F<Copying> files for copyright information.
545
546=cut