This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
copyedit perldelta
[perl5.git] / pod / perldelta.pod
CommitLineData
44691e6f
AB
1=encoding utf8
2
3=head1 NAME
4
0890f1a5 5perldelta - what is new for perl v5.15.1
f5938650 6
0890f1a5 7=head1 DESCRIPTION
760696b8 8
4abaf918
Z
9This document describes differences between the 5.15.0 release and
10the 5.15.1 release.
760696b8 11
0890f1a5
FC
12If you are upgrading from an earlier release such as 5.14.0, first read
13L<perl5150delta>, which describes differences between 5.14.0 and
145.15.0.
760696b8 15
0890f1a5 16=head1 Core Enhancements
6693394d 17
5cd408a2
EB
18=head2 C<splice()> doesn't warn when truncating
19
20You can now limit the size of an array using C<splice(@a,MAX_LEN)> without
21worrying about warnings.
22
062678b2
FC
23=head2 The C<\$> prototype accepts any scalar lvalue
24
25The C<\$> and C<\[$]> subroutine prototypes now accept any scalar lvalue
26argument. Previously they only accepted scalars beginning with C<$> and
27hash and array elements. This change makes them consistent with the way
28the built-in C<read> and C<recv> functions (among others) parse their
29arguments. This means that one can override the built-in functions with
30custom subroutines that parse their arguments the same way.
31
4185c919
NC
32=head2 You can now C<study> more than one string
33
34The restriction that you can only have one C<study> active at a time has been
35removed. You can now usefully C<study> as many strings as you want (until you
36exhaust memory).
37
82aed44a
KW
38=head2 The Unicode C<Script_Extensions> property is now supported.
39
40New in Unicode 6.0, this is an improved C<Script> property. Details
41are in L<perlunicode/Scripts>.
42
2b679393
SM
43=head2 DTrace probes for interpreter phase change
44
45The C<phase-change> probes will fire when the interpreter's phase
46changes, which tracks the C<${^GLOBAL_PHASE}> variable. C<arg0> is
47the new phase name; C<arg1> is the old one. This is useful mostly
48for limiting your instrumentation to one or more of: compile time,
49run time, destruct time.
50
7818c927
FC
51=head2 New Pad API
52
53Many new functions have been added to the API for manipulating lexical
54pads. See L<perlapi/Pad Data Structures> for more information.
55
0890f1a5 56=head1 Performance Enhancements
760696b8 57
6693394d
FC
58=over 4
59
60=item *
61
4abaf918
Z
62The short-circuiting operators C<&&>, C<||>, and C<//>, when chained
63(such as C<$a || $b || $c>), are now considerably faster to short-circuit,
64due to reduced optree traversal.
92c695db
S
65
66=item *
67
4abaf918 68The implementation of C<s///r> makes one fewer copy of the scalar's value.
6693394d 69
bfafcb9a
NC
70=item *
71
72If a studied scalar is C<split> with a regex, the engine will now take
73advantage of the C<study> data.
74
72de20cd
NC
75=item *
76
77C<study> now uses considerably less memory for shorter strings. Strings shorter
78than 65535 characters use roughly half the memory than previously, strings
79shorter than 255 characters use roughly one quarter of the memory.
80
93905212
FC
81=item *
82
83Recursive calls to lvalue subroutines in lvalue scalar context use less
84memory.
85
6693394d
FC
86=back
87
0890f1a5 88=head1 Modules and Pragmata
bdb9ba77 89
0890f1a5 90=head2 New Modules and Pragmata
6693394d 91
0890f1a5 92=over 4
6693394d
FC
93
94=item *
95
7818c927
FC
96The logic for parsing, merging, and dumping XS typemaps has been extracted
97from C<ExtUtils::ParseXS> into a module of its own, L<ExtUtils::Typemaps>.
98C<ExtUtils::Typemaps> offers an interface to typemap handling outside of
99the scope of the XS compiler itself.
100
101As a first use case of the improved API and extensibility, typemaps can now
102be included inline in XS code with a HEREDOC-like syntax:
103
104 TYPEMAP: <<END_TYPEMAP
105 MyType T_IV
106 END_TYPEMAP
6693394d
FC
107
108=back
109
0890f1a5 110=head2 Updated Modules and Pragmata
760696b8 111
0890f1a5 112=over 4
760696b8
FC
113
114=item *
115
7818c927 116L<B::Deparse> has been upgrade from version 1.05 to 1.06.
259925f6 117
7818c927
FC
118It now correctly deparses interpolation of punctuation variables (like
119C<@*>) that do not interpolate without braces [perl #93990].
259925f6
S
120
121=item *
122
4abaf918 123L<CGI> has been upgraded from version 3.54 to version 3.55.
90a3c601 124
4abaf918 125Things that may break your code:
90a3c601
CBW
126
127C<url()> was fixed to return C<PATH_INFO> when it is explicitly requested
128with either the path=>1 or path_info=>1 flag.
129
130If your code is running under mod_rewrite (or compatible) and you are calling C<self_url()> or
4abaf918 131you are calling C<url()> and passing C<< path_info=>1 >>, These methods will actually be
90a3c601
CBW
132returning C<PATH_INFO> now, as you have explicitly requested, or has C<self_url()>
133has requested on your behalf.
134
135The C<PATH_INFO> has been omitted in such URLs since the issue was introduced
136in the 3.12 release in December, 2005.
137
138This bug is so old your application may have come to depend on it or
139workaround it. Check for application before upgrading to this release.
140
141Examples of affected method calls:
142
143 $q->url(-absolute => 1, -query => 1, -path_info => 1 )
144 $q->url(-path=>1)
145 $q->url(-full=>1,-path=>1)
146 $q->url(-rewrite=>1,-path=>1)
147 $q->self_url();
148
149=item *
150
4abaf918
Z
151L<CPANPLUS> has been upgraded from version 0.9105 to version 0.9108
152
153=item *
154
cd272cae 155L<Compress::Raw::Bzip2> has been upgraded from version 2.035 to version 2.037
1d5c9fb0
CBW
156
157=item *
158
98a34606 159L<Compress::Raw::Zlib> has been upgraded from version 2.035 to version 2.037
bc771c2e
CBW
160
161Added offset parameter to CRC32
162
163=item *
164
101c03fa 165L<Compress::Zlib> has been upgraded from version 2.035 to version 2.037
529174d6
CBW
166
167IO::Compress::Zip and IO::Uncompress::Unzip now have support for LZMA (method 14).
101c03fa
CBW
168There is a fix for a CRC issue in IO::Compress::Unzip and it supports Streamed
169Stored context now. And fixed a Zip64 issue in
529174d6
CBW
170IO::Compress::Zip when the content size was exactly 0xFFFFFFFF.
171
172=item *
173
7818c927
FC
174L<Cwd> has been upgraded from version 3.36 to 3.37, to address an
175incompatibility with the EPIC debugger.
176
177=item *
178
4b5789fe
CBW
179L<ExtUtils::MakeMaker> has been upgraded from version 6.57_05 to version 6.58
180
181=item *
182
7818c927
FC
183L<ExtUtils::ParseXS> has been upgraded from version 2.2210 to 3.00_01.
184
185Much of L<ExtUtils::ParseXS>, the module behind the XS compiler C<xsubpp>,
186was rewritten and cleaned up. It has been made somewhat more extensible
187and now finally uses strictures.
188
189The typemap logic has been moved into a separate module,
190L<ExtUtils::Typemaps>. See L</New Modules and Pragmata>, above.
191
192=item *
193
77ccfaeb
DG
194L<HTTP::Tiny> has been upgraded from version 0.012 to version 0.013.
195
196Added support for using C<$ENV{http_proxy}> to set the default proxy host.
197
198=item *
199
508236ce
CBW
200L<IPC::Cmd> has been upgraded from version 0.70 to version 0.72
201
202Capturing of command output (both C<STDOUT> and C<STDERR>) is now supported
203using L<IPC::Open3> on MSWin32 without requiring L<IPC::Run>.
204
205=item *
206
c69a30ec
CBW
207L<Locale::Codes> has been upgraded from version 3.16 to version 3.17
208
209Added Language Extension codes (langext) and Language Variation codes
210(langvar) as defined in the IANA language registry.
211
212Added language codes from ISO 639-5
213
214Added language/script codes from the IANA language subtag
215registry
216
217Fixed an uninitialized value warning. RT 67438
218
219Fixed the return value for the all_XXX_codes and all_XXX_names functions. RT 69100
220
221Reorganized modules to move Locale::MODULE to Locale::Codes::MODULE to
222allow for cleaner future additions. The original four modules (Locale::Language,
223Locale::Currency, Locale::Country, Locale::Script) will continue to work, but
224all new sets of codes will be added in the Locale::Codes namespace.
225
226=item *
227
7c420290
NC
228L<Math::BigInt::FastCalc> has been upgraded from version 0.28 to version 0.29.
229
230The XS code is now compiled with C<PERL_NO_GET_CONTEXT>, which will aid
231performance under ithreads.
232
0cb4637e
CBW
233=item *
234
dd413713 235L<Module::CoreList> has been upgraded from version 2.51 to 2.53.
7818c927
FC
236
237Some extraneous (and erroneous) entries have been removed
238[rt.cpan.org #69108].
239
dd413713
CBW
240The C<corelist> utility now understands the C<-r> option for
241displaying Perl release dates.
242
7818c927
FC
243=item *
244
245L<Pod::Perldoc> has been upgraded from version 3.15_05 to 3.15_06.
246
247The B<-v> option now fetches the right section for C<$0>.
248
249=item *
250
e1f74b1a 251L<Pod::Simple> has been upgraded from version 3.16 to version 3.18
5aeca1f7
CBW
252
253=item *
254
0cb4637e
CBW
255L<Unicode::Collate> has been upgraded from version 0.76 to version 0.77
256
257Applied [perl #93470] silencing compiler warnings with -Wwrite-strings
258
00f02a57
CBW
259=item *
260
261L<Win32API::File> has been upgraded from version 0.1101 to version 0.1200
262
263Added SetStdHandle and GetStdHandle functions
264
8b00e523
NC
265=item *
266
4abaf918
Z
267L<attributes> has been upgraded from version 0.14 to 0.15, as part of the
268lvalue attribute warnings fix. See L</Selected Bug Fixes>, below.
269
270=item *
271
272L<diagnostics> has been upgraded from version 1.22 to 1.23.
273
274It now knows how to find descriptions for diagnostic messages ending with a
275dot, instead getting confused by it.
276
277=item *
278
8b00e523
NC
279L<threads> has been upgraded from version 1.83 to 1.84
280
281An unused variable was removed from the XS code.
282
e8e35311
FC
283=back
284
0890f1a5 285=head2 Removed Modules and Pragmata
bdb9ba77 286
0890f1a5 287=over 4
bdb9ba77
DG
288
289=item *
290
17d5d82d
FR
291Perl 4-era .pl libraries
292
293Perl used to bundle a handful of library files that predate Perl 5. Most of
294these files, which have been deprecated since version 5.14.0, have now been
295removed. If your code still relies on these libraries, you can install them
4abaf918 296again from L<Perl4::CoreLibs> on CPAN.
bdb9ba77
DG
297
298=back
299
0890f1a5 300=head1 Documentation
f5938650 301
0890f1a5 302=head2 New Documentation
f5938650 303
2b679393 304=head3 L<perldtrace>
bdb9ba77 305
2b679393
SM
306L<perldtrace> describes Perl's DTrace support, listing the provided probes
307and gives examples of their use.
bdb9ba77 308
7818c927
FC
309=head3 L<perl5141delta>
310
311The delta file for Perl 5.14.1 has been copied to blead.
312
0890f1a5
FC
313=head2 Changes to Existing Documentation
314
0890f1a5 315=over 4
6693394d
FC
316
317=item *
318
259925f6
S
319L<perlxs> was extended with documentation on inline typemaps.
320
7818c927
FC
321=item *
322
323L<perlref> has a new L<Circular References|perlref/Circular References>
324section explaining how circularities may not be freed and how to solve that
325with weak references.
326
327=item *
328
329The documentation for smart match in L<perlsyn> has been corrected for the
330case of C<undef> on the left-hand side. The list of different smart match
331behaviours had an item in the wrong place.
332
b908e258
Z
333=item *
334
335Parts of L<perlapi> were clarified, and Perl equivalents of some C
336functions have been added as an additional mode of exposition.
337
338=item *
339
340A few parts of L<perlre> and L<perlrecharclass> were clarified.
341
6693394d
FC
342=back
343
34dc2ec0 344=head1 Diagnostics
b7188eb5 345
34dc2ec0
DM
346The following additions or changes have been made to diagnostic output,
347including warnings and fatal error messages. For the complete list of
348diagnostic messages, see L<perldiag>.
44691e6f 349
0890f1a5 350=head2 Changes to Existing Diagnostics
42a91c97 351
34dc2ec0 352=over 4
42a91c97 353
6693394d 354=item *
42a91c97 355
7818c927
FC
356The L<Invalid version format|perldiag/"Invalid version format (%s)">
357error message now says "negative version number" within the parentheses,
358rather than "non-numeric data", for negative numbers.
359
360=item *
361
362The two warnings
363L<Possible attempt to put comments in qw() list|perldiag/"Possible attempt to put comments in qw() list">
364and
365L<Possible attempt to separate words with commas|perldiag/"Possible attempt to separate words with commas">
366are no longer mutually exclusive: the same C<qw> construct may produce
367both.
368
369=item *
370
371Warnings that mention the names of lexical (C<my>) variables with Unicode
372characters in them now respect the presence or absence of the C<:utf8>
373layer on the output handle, instead of outputting UTF8 regardless. Also,
374the correct names are included in the strings passed to C<$SIG{__WARN__}>
375handlers, rather than the raw UTF8 bytes.
42a91c97 376
34dc2ec0 377=back
42a91c97 378
0890f1a5 379=head1 Testing
bdab33d1 380
0890f1a5 381=over 4
f5938650
FC
382
383=item *
384
2b679393
SM
385F<t/run/dtrace.t> was added to test Perl's DTrace support. This
386test will only be run if your Perl was built with C<-Dusedtrace>
387and if calling C<dtrace> actually lets you instrument code. This
388generally requires being run as root, so this test file is primarily
389intended for use by the dtrace subcommittee of p5p.
f5938650 390
1fcb0052
PM
391=item *
392
393F<t/win32/runenv.t> was added to test aspects of Perl's environment
394variable handling on MSWin32 platforms. Previously, such tests were
395skipped on MSWin32 platforms.
396
b908e258
Z
397=item *
398
399Some bitrot has been fixed in the miniperl test suite, so that it now
400nearly passes. The minitest is normally only run when building the
401full perl fails, so it was liable to fall into disrepair making it a
402less useful debugging tool. When it is fully passing it is hoped to
403start including it in regular smoke tests, so that future bitrot will
404be quickly detected.
405
f5938650 406=back
2fbb14a0 407
0890f1a5 408=head1 Platform Support
975dff8c 409
0890f1a5 410=head2 Platform-Specific Notes
6693394d 411
1fcb0052 412=head3 Windows
6693394d 413
1fcb0052
PM
414=over
415
416=item *
417
418On Windows 7, 2008 and Vista, C<@INC> is now always properly populated
419based on the value of PERL5LIB set in the environment. Previously,
420values of PERL5LIB longer than 32766 bytes were skipped when C<@INC>
421was being populated. Tests for environment handling were
422also added (see L</Testing> section). Fixes
423L<RT #87322|https://rt.perl.org/rt3/Public/Bug/Display.html?id=87322>.
424
425=back
426
0890f1a5 427=head1 Internal Changes
6693394d 428
0890f1a5 429=over 4
f5938650
FC
430
431=item *
432
c62f68e3
FC
433The expermental C<fetch_cop_label> function has been renamed to
434C<cop_fetch_label>.
435
436=item *
437
438The C<cop_store_label> function has been added to the API, but is
439experimental.
f5938650 440
0890f1a5 441=back
25aa614d 442
0890f1a5 443=head1 Selected Bug Fixes
87d00a71 444
0890f1a5 445=over 4
87d00a71 446
da507230
FC
447=item *
448
fff96ff7
FC
449Applying the :lvalue attribute to subroutine that is already defined does
450not work properly, as the attribute changes the way the sub is compiled.
451Hence, Perl 5.12 began warning when an attempt is made to apply the
452attribute to an already defined sub. In such cases, the attribute is
453discarded.
454
455But the change in 5.12 missed the case where custom attributes are also
456present: that case still silently and ineffectively applied the attribute.
457That omission has now been corrected. C<sub foo :lvalue :Whatever> (when
458C<foo> is already defined) now warns about the :lvalue attribute, and does
459not apply it.
da507230 460
bb3abb05
FC
461L<attributes.pm|attributes> has likewise been updated to warn and not apply
462the attribute.
463
d25b0d7b
FC
464=item *
465
466The remaining discrepancies between explicit and implicit return from
467lvalue subroutines have been resolved. They mainly involved which error
468message to display when a read-only value is returned in lvalue context.
469Also, returning a PADTMP (the result of most built-ins, like C<index>) in
470lvalue context is now forbidden for explicit return, as it always has been
471for implicit return. This is not a regression from 5.14, as all the cases
472in which it could happen where previously syntax errors.
473
4bee03f8
FC
474=item *
475
4bee03f8
FC
476Explicitly returning a tied C<my> variable from an lvalue subroutine in
477list lvalue context used to clear the variable before the assignment could
478happen. This is something that was missed when explicit return was made to
479work in 5.15.0.
480
d9463c66
FC
481=item *
482
d9463c66
FC
483A minor memory leak, introduced in 5.15.0, has been fixed. It would occur
484when a hash is freed that has had its current iterator deleted
485[perl #93454].
486
7c4c6e7c
FC
487=item *
488
b908e258
Z
489The C<prototype> function no longer dies for the C<__FILE__>, C<__LINE__>
490and C<__PACKAGE__> directives. It now returns an empty-string prototype
491for them, because they are syntactically very similar to nullary functions
7c4c6e7c
FC
492like C<time>.
493
777d9014
FC
494=item *
495
b908e258
Z
496C<prototype> now returns C<undef> for all overridable infix operators,
497such as C<eq>, which are not callable in any way resembling functions.
498It used to return incorrect prototypes for some and die for others
95f7e41f
FC
499[perl #94984].
500
501=item *
502
777d9014
FC
503A bug affecting lvalue context propagation through nested lvalue subroutine
504calls has been fixed. Previously, returning a value in nested rvalue
505context would be treated as lvalue context by the inner subroutine call,
506resulting in some values (such as read-only values) being rejected.
507
df5b44bd
FC
508=item *
509
510Some core bugs affecting L<Hash::Util> have been fixed: locking a hash
511element that is a glob copy no longer causes subsequent assignment to it to
512corrupt the glob, and unlocking a hash element that holds a copy-on-write
513scalar no longer causes modifications to that scalar to modify other
514scalars that were sharing the same string buffer.
515
e22e289d
FC
516=item *
517
7818c927
FC
518C<when> blocks are now capable of returning variables declared inside the
519enclosing C<given> block [perl #93548].
520
521=item *
522
523A problem with context propagation when a C<do> block is an argument to
4abaf918 524C<return> has been fixed. It used to cause C<undef> to be returned in
7818c927
FC
525some cases of a C<return> inside an C<if> block which itself is followed by
526another C<return>.
527
528=item *
529
530Calling C<index> with a tainted constant no longer causes constants in
531subsequently compiled code to become tainted [perl #64804].
532
533=item *
534
c62f68e3
FC
535Use of lexical (C<my>) variables in code blocks embedded in regular
536expressions will no longer result in memory corruption or crashes.
537
538Nevertheless, these code blocks are still experimental, as there are still
539problems with the wrong variables being closed over (in loops for instance)
540and with abnormal exiting (e.g., C<die>) causing memory corruption.
541
542=item *
543
e22e289d
FC
544The C<SvIsCOW> C macro now returns false for read-only copies of typeglobs,
545such as those created by:
546
547 $hash{elem} = *foo;
548 Hash::Util::lock_value %hash, 'elem';
549
550It used to return true.
551
b908e258
Z
552=item *
553
4ec40670
Z
554Assignment to C<$^A> (the format output accumulator) now recalculates
555the number of lines output.
556
557=item *
558
b908e258
Z
559The regexp optimiser no longer crashes on debugging builds when merging
560fixed-string nodes with inconvenient contents.
561
42a91c97
FC
562=back
563
44691e6f
AB
564=head1 Acknowledgements
565
c7d4feba 566XXX Generate this with:
548e9a3a
LB
567
568 perl Porting/acknowledgements.pl v5.15.0..HEAD
29cf780c 569
44691e6f
AB
570=head1 Reporting Bugs
571
572If you find what you think is a bug, you might check the articles
34dc2ec0 573recently posted to the comp.lang.perl.misc newsgroup and the perl
44691e6f
AB
574bug database at http://rt.perl.org/perlbug/ . There may also be
575information at http://www.perl.org/ , the Perl Home Page.
576
577If you believe you have an unreported bug, please run the L<perlbug>
578program included with your release. Be sure to trim your bug down
579to a tiny but sufficient test case. Your bug report, along with the
580output of C<perl -V>, will be sent off to perlbug@perl.org to be
581analysed by the Perl porting team.
582
583If the bug you are reporting has security implications, which make it
584inappropriate to send to a publicly archived mailing list, then please send
34dc2ec0 585it to perl5-security-report@perl.org. This points to a closed subscription
b4707b2a
FC
586unarchived mailing list, which includes
587all the core committers, who will be able
44691e6f
AB
588to help assess the impact of issues, figure out a resolution, and help
589co-ordinate the release of patches to mitigate or fix the problem across all
34dc2ec0
DM
590platforms on which Perl is supported. Please only use this address for
591security issues in the Perl core, not for modules independently
44691e6f
AB
592distributed on CPAN.
593
594=head1 SEE ALSO
595
596The F<Changes> file for an explanation of how to view exhaustive details
597on what changed.
598
599The F<INSTALL> file for how to build Perl.
600
601The F<README> file for general stuff.
602
603The F<Artistic> and F<Copying> files for copyright information.
604
605=cut