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