This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix IO::Compress linkage
[perl5.git] / pod / perldelta.pod
1 =encoding utf8
2
3 =head1 NAME
4
5 perldelta - what is new for perl v5.21.8
6
7 =head1 DESCRIPTION
8
9 This document describes differences between the 5.21.7 release and the 5.21.8
10 release.
11
12 If you are upgrading from an earlier release such as 5.21.6, first read
13 L<perl5217delta>, which describes differences between 5.21.6 and 5.21.7.
14
15 =head1 Notice
16
17 With this release we are now in the contentious changes portion of the code
18 freeze as we prepare for the next stable release of Perl 5.
19
20 =head1 Core Enhancements
21
22 =head2 The warnings pragma now supports warnings outside of "all"
23
24 Ever since perl v5.6.0 we've had no way of adding new warnings without
25 retroactively adding them to all existing programs that used C<-w>,
26 C<-W> or C<use warnings>.
27
28 This caused us to not add new useful warnings out of fear that they
29 might unduly burden users who just wanted to upgrade perl and didn't
30 want to deal with a bunch of warnings from their existing code.
31
32 We now support a way to have our cake and eat it too, and can add new
33 warnings to the core going forward through other top-level warning
34 categories. See L<the warnings documentation|warnings/Top-level
35 warning categories & associated confusion> for details.
36
37 =head2 Non-Capturing Regular Expression Flag
38
39 Regular expressions now support a C</n> flag that disables capturing
40 and filling in C<$1>, C<$2>, etc... inside of groups:
41
42   "hello" =~ /(hi|hello)/n; # $1 is not set
43
44 This is equivalent to putting C<?:> at the beginning of every capturing group.
45
46 See L<perlre/"n"> for more information.
47
48 =head2 C<prototype> with no arguments
49
50 C<prototype()> with no arguments now infers C<$_>.  [perl #123514]
51
52 =head2 C<use re 'strict'>
53
54 This applies stricter syntax rules to regular expression patterns
55 compiled within its scope, which hopefully will alert you to typos and
56 other unintentional behavior that backwards-compatibility issues prevent
57 us from doing in normal regular expression compilations.  Because the
58 behavior of this is subject to change in future Perl releases as we gain
59 experience, using this pragma will raise a category
60 C<experimental:re_strict> warning.
61 See L<'strict' in re|re/'strict' mode>.
62
63 =head2 New "const" subroutine attribute
64
65 The "const" attribute can be applied to an anonymous subroutine.  It causes
66 it to be executed immediately when it is cloned.  Its value is captured and
67 used to create a new constant subroutine that is returned.  This feature is
68 experimental.  See L<perlsub/Constant Functions>.
69
70 =head1 Incompatible Changes
71
72 =head2 sub signatures moved before attributes
73
74 The experimental sub signatures feature, as introduced in 5.20, parsed
75 signatures after attributes.  In this release, the positioning has been
76 moved such that signatures occur in exactly the same positioning a
77 prototype would be found.
78
79 =head1 Modules and Pragmata
80
81 =head2 Updated Modules and Pragmata
82
83 =over 4
84
85 =item *
86
87 L<arybase> has been upgraded from version 0.09 to 0.10.
88
89 =item *
90
91 L<attributes> has been upgraded from version 0.24 to 0.25.
92
93 Minor internal change only.
94
95 =item *
96
97 L<autodie> has been upgraded from version 2.25 to 2.26.
98
99 =item *
100
101 L<B> has been upgraded from version 1.54 to 1.55.
102
103 A bug where, after an ithread creation or psuedofork, special/immortal SVs in
104 the child ithread/psuedoprocess did not have the correct class of
105 C<B::SPECIAL>, has been fixed.
106
107 The C<id> and C<outid> PADLIST methods have been added.
108
109 =item *
110
111 L<B::Deparse> has been upgraded from version 1.31 to 1.32.
112
113 Deparsing C<BEGIN { undef &foo }> with the B<-w> switch enabled started to
114 emit 'uninitialized' warnings in Perl 5.14.  This has been fixed.
115
116 Deparsing calls to subs with a C<(;+)> prototype resulted in an infinite
117 loop.  The C<(;$>) C<(_)> and C<(;_)> prototypes were given the wrong
118 precedence, causing C<foo($aE<lt>$b)> to be deparsed without the parentheses.
119
120 =item *
121
122 L<Compress::Raw::Bzip2> has been upgraded from version 2.067 to 2.068.
123
124 =item *
125
126 L<Compress::Raw::Zlib> has been upgraded from version 2.067 to 2.068.
127
128 =item *
129
130 L<CPAN::Meta::Requirements> has been upgraded from version 2.130 to 2.131.
131
132 =item *
133
134 L<Data::Dumper> has been upgraded from version 2.155 to 2.156.
135
136 =item *
137
138 L<DB_File> has been upgraded from version 1.834 to 1.835.
139
140 =item *
141
142 L<Devel::Peek> has been upgraded from version 1.20 to 1.21.
143
144 =item *
145
146 L<Devel::PPPort> has been upgraded from version 3.25 to 3.28.
147
148 =item *
149
150 L<Digest::MD5> has been upgraded from version 2.53 to 2.54.
151
152 =item *
153
154 L<Digest::SHA> has been upgraded from version 5.93 to 5.95.
155
156 =item *
157
158 L<DynaLoader> has been upgraded from version 1.29 to 1.30.
159
160 =item *
161
162 L<ExtUtils::Command> has been upgraded from version 1.18 to 1.20.
163
164 =item *
165
166 L<ExtUtils::Manifest> has been upgraded from version 1.69 to 1.70.
167
168 =item *
169
170 L<File::Glob> has been upgraded from version 1.23 to 1.24.
171
172 Avoid SvIV() expanding to call get_sv() three times in a few
173 places. [perl #123606]
174
175 =item *
176
177 L<Filter::Util::Call> has been upgraded from version 1.51 to 1.54.
178
179 =item *
180
181 L<Getopt::Long> has been upgraded from version 2.42 to 2.43.
182
183 =item *
184
185 L<IO::Compress> has been upgraded from version 2.067 to 2.068.
186
187 =item *
188
189 L<IO::Socket::IP> has been upgraded from version 0.34 to 0.36.
190
191 =item *
192
193 L<MIME::Base64> has been upgraded from version 3.14 to 3.15.
194
195 =item *
196
197 L<Module::CoreList> has been upgraded from version 5.20141220 to 5.20150120.
198
199 =item *
200
201 L<Module::Load::Conditional> has been upgraded from version 0.62 to 0.64.
202
203 =item *
204
205 L<Module::Metadata> has been upgraded from version 1.000024 to 1.000026.
206
207 =item *
208
209 L<Opcode> has been upgraded from version 1.30 to 1.31.
210
211 =item *
212
213 L<PerlIO::encoding> has been upgraded from version 0.20 to 0.21.
214
215 =item *
216
217 L<Pod::Simple> has been upgraded from version 3.28 to 3.29.
218
219 =item *
220
221 L<POSIX> has been upgraded from version 1.48 to 1.49.
222
223 =item *
224
225 L<re> has been upgraded from version 0.28 to 0.30.
226
227 =item *
228
229 L<Safe> has been upgraded from version 2.38 to 2.39.
230
231 C<reval> was not propagating void context properly.
232
233 =item *
234
235 L<SDBM_File> has been upgraded from version 1.12 to 1.13.
236
237 Simplified the build process.  [perl #123413]
238
239 =item *
240
241 L<Test::Harness> has been upgraded from version 3.34 to 3.35.
242
243 =item *
244
245 L<Test::Simple> has been upgraded from version 1.301001_090 to 1.301001_097.
246
247 =item *
248
249 L<Unicode::Collate> has been upgraded from version 1.09 to 1.10.
250
251 =item *
252
253 L<VMS::DCLsym> has been upgraded from version 1.05 to 1.06.
254
255 =item *
256
257 L<warnings> has been upgraded from version 1.29 to 1.30.
258
259 =back
260
261 =head1 Documentation
262
263 =head2 New Documentation
264
265 =head3 L<perlunicook>
266
267 This document, by Tom Christiansen, provides examples of handling Unicode in 
268 Perl.
269
270 =head1 Diagnostics
271
272 The following additions or changes have been made to diagnostic output,
273 including warnings and fatal error messages.  For the complete list of
274 diagnostic messages, see L<perldiag>.
275
276 =head2 New Diagnostics
277
278 =head3 New Errors
279
280 =over 4
281
282 =item *
283
284 L<Bad symbol for scalar|perldiag/"Bad symbol for scalar">
285
286 (P) An internal request asked to add a scalar entry to something that
287 wasn't a symbol table entry.
288
289 =item *
290
291 L<:const is not permitted on named subroutines|perldiag/":const is not permitted on named subroutines">
292
293 (F) The "const" attribute causes an anonymous subroutine to be run and
294 its value captured at the time that it is cloned.  Names subroutines are
295 not cloned like this, so the attribute does not make sense on them.
296
297 =back
298
299 =head3 New Warnings
300
301 =over 4
302
303 =item *
304
305 L<:const is experimental|perldiag/":const is experimental">
306
307 (S experimental::const_attr) The "const" attribute is experimental.
308 If you want to use the feature, disable the warning with C<no warnings
309 'experimental::const_attr'>, but know that in doing so you are taking
310 the risk that your code may break in a future Perl version.
311
312 =item *
313
314 L<Non-finite repeat count does nothing|perldiag/"Non-finite repeat count does nothing">
315
316 (W numeric) You tried to execute the
317 L<C<x>|perlop/Multiplicative Operators> repetition operator C<Inf> (or
318 C<-Inf>) or C<NaN> times, which doesn't make sense.
319
320 =item *
321
322 L<Useless use of attribute "const"|perldiag/Useless use of attribute "const">
323
324 (W misc) The "const" attribute has no effect except
325 on anonymous closure prototypes.  You applied it to
326 a subroutine via L<attributes.pm|attributes>.  This is only useful
327 inside an attribute handler for an anonymous subroutine.
328
329 =item *
330
331 L<Unusual use of %s in void context|perldiag/"Unusual use of %s in void context">
332
333 (W void_unusual) Similar to the "Useless use of %s in void context"
334 warning, but only turned on by the top-level "pedantic" warning
335 category, used for e.g. C<grep> in void context, which may indicate a
336 bug, but could also just be someone using C<grep> for its side-effects
337 as a loop.
338
339 Enabled as part of "extra" warnings, not in the "all" category. See
340 L<warnings> for details
341
342 =item *
343
344 L<E<quot>use re 'strict'E<quot> is experimental|perldiag/"use re 'strict'" is experimental>
345
346 (S experimental::re_strict) The things that are different when a regular
347 expression pattern is compiled under C<'strict'> are subject to change
348 in future Perl releases in incompatible ways.  This means that a pattern
349 that compiles today may not in a future Perl release.  This warning is
350 to alert you to that risk.
351
352 L<Wide character (U+%X) in %s|perldiag/"Wide character (U+%X) in %s">
353
354 (W locale) While in a single-byte locale (I<i.e.>, a non-UTF-8
355 one), a multi-byte character was encountered.   Perl considers this
356 character to be the specified Unicode code point.  Combining non-UTF8
357 locales and Unicode is dangerous.  Almost certainly some characters
358 will have two different representations.  For example, in the ISO 8859-7
359 (Greek) locale, the code point 0xC3 represents a Capital Gamma.  But so
360 also does 0x393.  This will make string comparisons unreliable.
361
362 You likely need to figure out how this multi-byte character got mixed up
363 with your single-byte locale (or perhaps you thought you had a UTF-8
364 locale, but Perl disagrees).
365
366 =item *
367
368 L<Both or neither range ends should be Unicode in regex; marked by E<lt>-- HERE in mE<sol>%sE<sol>|perldiag/"Both or neither range ends should be Unicode in regex; marked by <-- HERE in m/%s/">
369
370 (W regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>)
371
372 In a bracketed character class in a regular expression pattern, you
373 had a range which has exactly one end of it specified using C<\N{}>, and
374 the other end is specified using a non-portable mechanism.  Perl treats
375 the range as a Unicode range, that is, all the characters in it are
376 considered to be the Unicode characters, and which may be different code
377 points on some platforms Perl runs on.  For example, C<[\N{U+06}-\x08]>
378 is treated as if you had instead said C<[\N{U+06}-\N{U+08}]>, that is it
379 matches the characters whose code points in Unicode are 6, 7, and 8.
380 But that C<\x08> might indicate that you meant something different, so
381 the warning gets raised.
382
383 =item *
384
385 L<Ranges of ASCII printables should be some subset of "0-9", "A-Z", or "a-z" in regex; marked by E<lt>-- HERE in mE<sol>%sE<sol>|perldiag/"Ranges of ASCII printables should be some subset of "0-9", "A-Z", or "a-z" in regex; marked by <-- HERE in mE<sol>%sE<sol>">
386
387 (W regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>)
388
389 Stricter rules help to find typos and other errors.  Perhaps you didn't
390 even intend a range here, if the C<"-"> was meant to be some other
391 character, or should have been escaped (like C<"\-">).  If you did
392 intend a range, the one that was used is not portable between ASCII and
393 EBCDIC platforms, and doesn't have an obvious meaning to a casual
394 reader.
395
396  [3-7]    # OK; Obvious and portable
397  [d-g]    # OK; Obvious and portable
398  [A-Y]    # OK; Obvious and portable
399  [A-z]    # WRONG; Not portable; not clear what is meant
400  [a-Z]    # WRONG; Not portable; not clear what is meant
401  [%-.]    # WRONG; Not portable; not clear what is meant
402  [\x41-Z] # WRONG; Not portable; not obvious to non-geek
403
404 (You can force portability by specifying a Unicode range, which means that
405 the endpoints are specified by
406 L<C<\N{...}>|perlrecharclass/Character Ranges>, but the meaning may
407 still not be obvious.)
408 The stricter rules require that ranges that start or stop with an ASCII
409 character that is not a control have all their endpoints be the literal
410 character, and not some escape sequence (like C<"\x41">), and the ranges
411 must be all digits, or all uppercase letters, or all lowercase letters.
412
413 =item *
414
415 L<Ranges of digits should be from the same group in regex; marked by E<lt>-- HERE in mE<sol>%sE<sol>|perldiag/"Ranges of digits should be from the same group in regex; marked by <-- HERE in m/%s/">
416
417 (W regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>)
418
419 Stricter rules help to find typos and other errors.  You included a
420 range, and at least one of the end points is a decimal digit.  Under the
421 stricter rules, when this happens, both end points should be digits in
422 the same group of 10 consecutive digits.
423
424 =item *
425
426 L<"%s" is more clearly written simply as "%s" in regex; marked by E<lt>-- HERE in mE<sol>%sE<sol>|perldiag/"%s" is more clearly written simply as "%s" in regex; marked by <-- HERE in mE<sol>%sE<sol>>
427
428 (W regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>)
429
430 You specified a character that has the given plainer way of writing it,
431 and which is also portable to platforms running with different character
432 sets.
433
434 =back
435
436 =head2 Changes to Existing Diagnostics
437
438 =over 4
439
440 =item *
441
442 The message
443 L<Locale '%s' may not work well.%s|perldiag/"Locale '%s' may not work well.%s">
444 is no longer raised unless the problemtatic locale is actually used in
445 the Perl program.  Previously it was raised if it merely was the
446 underlying locale.  All Perl programs have an underlying locale at all
447 times, but something like a C<S<use locale>> is needed for that locale
448 to actually have some effect.  This message will not be raised when
449 the underlying locale is hidden.
450
451 =back
452
453 =head1 Configuration and Compilation
454
455 =over 4
456
457 =item *
458
459 pthreads and lcl will be linked by default if present. This allows XS modules 
460 that require threading to work on non-threaded perls. Note that you must still 
461 pass C<-Dusethreads> if you want a threaded perl.
462
463 =back
464
465 =head1 Testing
466
467 =over 4
468
469 =item *
470
471 A new test script, F<bigmem/subst.t>, has been added to test memory usage of
472 subst on very large strings.
473
474 =item *
475
476 A new test script, F<op/anonconst.t>, has been added to test experimental
477 :const subroutines.
478
479 =item *
480
481 A new test script, F<re/reg_nocapture.t>, has been added to test the new
482 C</n> regexp flag.
483
484 =back
485
486 =head1 Platform Support
487
488 =head2 Platform-Specific Notes
489
490 =over 4
491
492 =item Win32
493
494 =over 4
495
496 =item *
497
498 Previously, on Visual C++ for Win64 built Perls only, when compiling every Perl
499 XS module (including CPAN ones) and Perl aware .c file with a 64 bit Visual C++,
500 would unconditionally have around a dozen warnings from hv_func.h.  These
501 warnings have been silenced.  GCC all bitness and Visual C++ for Win32 were
502 not affected.
503
504 =item *
505
506 Support for building without PerlIO has been removed from the Windows
507 makefiles.  Non-PerlIO builds were all but deprecated in Perl 5.18.0 and are
508 already not supported by F<Configure> on POSIX systems.
509
510 =item *
511
512 Between 2 and 6 ms and 7 I/O calls have been saved per attempt to open a perl
513 module for each path in C<@INC>.
514
515 =back
516
517 =back
518
519 =head1 Internal Changes
520
521 =over 4
522
523 =item *
524
525 Added Perl_sv_get_backrefs() to determine if an SV is a weak-referent.
526
527 Function either returns an SV * of type AV, which contains the set of
528 weakreferences which reference the passed in SV, or a simple RV * which
529 is the only weakref to this item.
530
531 =back
532
533 =head1 Selected Bug Fixes
534
535 =over 4
536
537 =item *
538
539 A bug in regular expression patterns that could lead to segfaults and
540 other crashes has been fixed.  This occurred only in patterns compiled
541 with C<"/i">, while taking into account the current POSIX locale (this usually
542 means they have to be compiled within the scope of C<S<"use locale">>),
543 and there must be a string of at least 128 consecutive bytes to match.
544 [perl #123539]
545
546 =item *
547
548 C<s///> now works on very long strings instead of dying with 'Substitution
549 loop'.  [perl #103260] [perl #123071]
550
551 =item *
552
553 C<gmtime> no longer crashes with not-a-number values.  [perl #123495]
554
555 =item *
556
557 C<\()> (reference to an empty list) and C<y///> with lexical $_ in scope
558 could do a bad write past the end of the stack.  They have been fixed
559 to extend the stack first.
560
561 =item *
562
563 C<prototype()> with no arguments used to read the previous item on the
564 stack, so C<print "foo", prototype()> would print foo's prototype.  It has
565 been fixed to infer $_ instead.  [perl #123514]
566
567 =item *
568
569 Some cases of lexical state subs inside predeclared subs could crash but no
570 longer do.
571
572 =item *
573
574 Some cases of nested lexical state subs inside anonymous subs could cause
575 'Bizarre copy' errors or possibly even crash.
576
577 =item *
578
579 When trying to emit warnings, perl's default debugger (F<perl5db.pl>) was
580 sometimes giving 'Undefined subroutine &DB::db_warn called' instead.  This
581 bug, which started to occur in Perl 5.18, has been fixed.  [perl #123553]
582
583 =item *
584
585 Certain syntax errors in substitutions, such as C<< s/${E<lt>E<gt>{})// >>, would
586 crash, and had done so since Perl 5.10.  (In some cases the crash did not
587 start happening till 5.16.)  The crash has, of course, been fixed.
588 [perl #123542]
589
590 =item *
591
592 A repeat expression like C<33 x ~3> could cause a large buffer
593 overflow since the new output buffer size was not correctly handled by
594 SvGROW().  An expression like this now properly produces a memory wrap
595 panic.  [perl 123554]
596
597 =item *
598
599 C<< formline("@...", "a"); >> would crash.  The C<FF_CHECKNL> case in
600 pp_formline() didn't set the pointer used to mark the chop position,
601 which led to the C<FF_MORE> case crashing with a segmentation fault.
602 This has been fixed.  [perl #123538]
603
604 =back
605
606 =head1 Acknowledgements
607
608 Perl 5.21.8 represents approximately 4 weeks of development since Perl 5.21.7
609 and contains approximately 26,000 lines of changes across 750 files from 27
610 authors.
611
612 Excluding auto-generated files, documentation and release tools, there were
613 approximately 13,000 lines of changes to 410 .pm, .t, .c and .h files.
614
615 Perl continues to flourish into its third decade thanks to a vibrant community
616 of users and developers. The following people are known to have contributed the
617 improvements that became Perl 5.21.8:
618
619 Aaron Crane, Andreas Voegele, Chad Granum, Chris 'BinGOs' Williams, Craig A.
620 Berry, Daniel Dragan, David Mitchell, E. Choroba, Ed J, Father Chrysostomos,
621 H.Merijn Brand, Hugo van der Sanden, James E Keenan, Jarkko Hietaniemi, Karen
622 Etheridge, Karl Williamson, Matthew Horsfall, Max Maischein, Peter Martini,
623 Rafael Garcia-Suarez, Ricardo Signes, Rostislav Skudnov, Slaven Rezic, Steve
624 Hay, Tony Cook, Yves Orton, Ævar Arnfjörð Bjarmason.
625
626 The list above is almost certainly incomplete as it is automatically generated
627 from version control history. In particular, it does not include the names of
628 the (very much appreciated) contributors who reported issues to the Perl bug
629 tracker.
630
631 Many of the changes included in this version originated in the CPAN modules
632 included in Perl's core. We're grateful to the entire CPAN community for
633 helping Perl to flourish.
634
635 For a more complete list of all of Perl's historical contributors, please see
636 the F<AUTHORS> file in the Perl source distribution.
637
638 =head1 Reporting Bugs
639
640 If you find what you think is a bug, you might check the articles recently
641 posted to the comp.lang.perl.misc newsgroup and the perl bug database at
642 https://rt.perl.org/ .  There may also be information at
643 http://www.perl.org/ , the Perl Home Page.
644
645 If you believe you have an unreported bug, please run the L<perlbug> program
646 included with your release.  Be sure to trim your bug down to a tiny but
647 sufficient test case.  Your bug report, along with the output of C<perl -V>,
648 will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
649
650 If the bug you are reporting has security implications, which make it
651 inappropriate to send to a publicly archived mailing list, then please send it
652 to perl5-security-report@perl.org.  This points to a closed subscription
653 unarchived mailing list, which includes all the core committers, who will be
654 able to help assess the impact of issues, figure out a resolution, and help
655 co-ordinate the release of patches to mitigate or fix the problem across all
656 platforms on which Perl is supported.  Please only use this address for
657 security issues in the Perl core, not for modules independently distributed on
658 CPAN.
659
660 =head1 SEE ALSO
661
662 The F<Changes> file for an explanation of how to view exhaustive details on
663 what changed.
664
665 The F<INSTALL> file for how to build Perl.
666
667 The F<README> file for general stuff.
668
669 The F<Artistic> and F<Copying> files for copyright information.
670
671 =cut