This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Retry first shot at perldelta.pod.
[perl5.git] / pod / perl5151delta.pod
CommitLineData
5438d4b8
Z
1=encoding utf8
2
3=head1 NAME
4
5perl5151delta - what is new for perl v5.15.1
6
7=head1 DESCRIPTION
8
9This document describes differences between the 5.15.0 release and
10the 5.15.1 release.
11
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.
15
16=head1 Core Enhancements
17
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
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
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
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
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
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
56=head1 Performance Enhancements
57
58=over 4
59
60=item *
61
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.
65
66=item *
67
68The implementation of C<s///r> makes one fewer copy of the scalar's value.
69
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
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
81=item *
82
83Recursive calls to lvalue subroutines in lvalue scalar context use less
84memory.
85
86=back
87
88=head1 Modules and Pragmata
89
90=head2 New Modules and Pragmata
91
92=over 4
93
94=item *
95
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
107
108=back
109
110=head2 Updated Modules and Pragmata
111
112=over 4
113
114=item *
115
116L<B::Deparse> has been upgrade from version 1.05 to 1.06.
117
118It now correctly deparses interpolation of punctuation variables (like
119C<@*>) that do not interpolate without braces [perl #93990].
120
121=item *
122
123L<CGI> has been upgraded from version 3.54 to version 3.55.
124
125Things that may break your code:
126
127C<url()> was fixed to return C<PATH_INFO> when it is explicitly requested
128with either the C<path=E<gt>1> or C<path_info=E<gt>1> flag.
129
130If your code is running under mod_rewrite (or compatible) and you are calling C<self_url()> or
131you are calling C<url()> and passing C<path_info=E<gt>1>, These methods will actually be
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
151L<CPANPLUS> has been upgraded from version 0.9105 to version 0.9108
152
153=item *
154
155L<Compress::Raw::Bzip2> has been upgraded from version 2.035 to version 2.037
156
157=item *
158
159L<Compress::Raw::Zlib> has been upgraded from version 2.035 to version 2.037
160
161Added offset parameter to CRC32
162
163=item *
164
165L<Compress::Zlib> has been upgraded from version 2.035 to version 2.037
166
167IO::Compress::Zip and IO::Uncompress::Unzip now have support for LZMA (method 14).
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
170IO::Compress::Zip when the content size was exactly 0xFFFFFFFF.
171
172=item *
173
174L<Cwd> has been upgraded from version 3.36 to 3.37, to address an
175incompatibility with the EPIC debugger.
176
177=item *
178
179L<ExtUtils::MakeMaker> has been upgraded from version 6.57_05 to version 6.58
180
181=item *
182
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
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
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
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
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
233=item *
234
235L<Module::CoreList> has been upgraded from version 2.51 to 2.54.
236
237Some extraneous (and erroneous) entries have been removed
238[rt.cpan.org #69108].
239
240The C<corelist> utility now understands the C<-r> option for
241displaying Perl release dates.
242
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
251L<Pod::Simple> has been upgraded from version 3.16 to version 3.18
252
253=item *
254
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
259=item *
260
261L<Win32API::File> has been upgraded from version 0.1101 to version 0.1200
262
263Added SetStdHandle and GetStdHandle functions
264
265=item *
266
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
279L<threads> has been upgraded from version 1.83 to 1.84
280
281An unused variable was removed from the XS code.
282
283=back
284
285=head2 Removed Modules and Pragmata
286
287=over 4
288
289=item *
290
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
296again from L<Perl4::CoreLibs> on CPAN.
297
298=back
299
300=head1 Documentation
301
302=head2 New Documentation
303
304=head3 L<perldtrace>
305
306L<perldtrace> describes Perl's DTrace support, listing the provided probes
307and gives examples of their use.
308
309=head3 L<perl5141delta>
310
311The delta file for Perl 5.14.1 has been copied to blead.
312
313=head2 Changes to Existing Documentation
314
315=over 4
316
317=item *
318
319L<perlxs> was extended with documentation on inline typemaps.
320
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
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
342=back
343
344=head1 Diagnostics
345
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>.
349
350=head2 Changes to Existing Diagnostics
351
352=over 4
353
354=item *
355
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.
376
377=back
378
379=head1 Testing
380
381=over 4
382
383=item *
384
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.
390
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
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
406=back
407
408=head1 Platform Support
409
410=head2 Platform-Specific Notes
411
412=head3 Windows
413
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
427=head1 Internal Changes
428
429=over 4
430
431=item *
432
1cecf2c0 433The experimental C<fetch_cop_label> function has been renamed to
5438d4b8
Z
434C<cop_fetch_label>.
435
436=item *
437
438The C<cop_store_label> function has been added to the API, but is
439experimental.
440
441=back
442
443=head1 Selected Bug Fixes
444
445=over 4
446
447=item *
448
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.
460
461L<attributes.pm|attributes> has likewise been updated to warn and not apply
462the attribute.
463
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
474=item *
475
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
481=item *
482
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
487=item *
488
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
492like C<time>.
493
494=item *
495
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
499[perl #94984].
500
501=item *
502
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
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
516=item *
517
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
524C<return> has been fixed. It used to cause C<undef> to be returned in
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
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
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
552=item *
553
554Assignment to C<$^A> (the format output accumulator) now recalculates
555the number of lines output.
556
557=item *
558
559The regexp optimiser no longer crashes on debugging builds when merging
560fixed-string nodes with inconvenient contents.
561
562=back
563
564=head1 Acknowledgements
565
566Perl 5.15.1 represents approximately 5 weeks of development since Perl 5.15.0
567and contains approximately 220,000 lines of changes across 650 files from 37
568authors.
569
570Perl continues to flourish into its third decade thanks to a vibrant community
571of users and developers. The following people are known to have contributed the
572improvements that became Perl 5.15.1:
573
574Abhijit Menon-Sen, Alan Haggai Alavi, Brian Fraser, Brian Greenfield, Chris
575'BinGOs' Williams, Claes Jacobsson, Craig A. Berry, Dave Rolsky, David Golden,
576David Mitchell, Dee Newcum, Eric Brine, Father Chrysostomos, Florian Ragwitz,
577Gerard Goossen, H.Merijn Brand, Hojung Yoon, James E Keenan, Jesse Luehrs,
578Jesse Vincent, John Peacock, Karl Williamson, Keith Thompson, Leon Brocard,
579Matthew Horsfall, Nicholas Clark, Niko Tyni, Phil Monsen, Reini Urban, Ricardo
580Signes, Robin Barker, Sam Kimbrel, Shawn M Moore, Shlomi Fish, Steffen Müller,
581Vincent Pit, Zefram.
582
583The list above is almost certainly incomplete as it is automatically generated
584from version control history. In particular, it does not include the names of
585the (very much appreciated) contributors who reported issues to the Perl bug
586tracker.
587
588Many of the changes included in this version originated in the CPAN modules
589included in Perl's core. We're grateful to the entire CPAN community for
590helping Perl to flourish.
591
592For a more complete list of all of Perl's historical contributors, please see
593the F<AUTHORS> file in the Perl source distribution.
594
595=head1 Reporting Bugs
596
597If you find what you think is a bug, you might check the articles
598recently posted to the comp.lang.perl.misc newsgroup and the perl
599bug database at http://rt.perl.org/perlbug/ . There may also be
600information at http://www.perl.org/ , the Perl Home Page.
601
602If you believe you have an unreported bug, please run the L<perlbug>
603program included with your release. Be sure to trim your bug down
604to a tiny but sufficient test case. Your bug report, along with the
605output of C<perl -V>, will be sent off to perlbug@perl.org to be
606analysed by the Perl porting team.
607
608If the bug you are reporting has security implications, which make it
609inappropriate to send to a publicly archived mailing list, then please send
610it to perl5-security-report@perl.org. This points to a closed subscription
611unarchived mailing list, which includes
612all the core committers, who will be able
613to help assess the impact of issues, figure out a resolution, and help
614co-ordinate the release of patches to mitigate or fix the problem across all
615platforms on which Perl is supported. Please only use this address for
616security issues in the Perl core, not for modules independently
617distributed on CPAN.
618
619=head1 SEE ALSO
620
621The F<Changes> file for an explanation of how to view exhaustive details
622on what changed.
623
624The F<INSTALL> file for how to build Perl.
625
626The F<README> file for general stuff.
627
628The F<Artistic> and F<Copying> files for copyright information.
629
630=cut