This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta for 2384afee9 / #123553
[perl5.git] / pod / perl5215delta.pod
CommitLineData
86372193
A
1=encoding utf8
2
3=head1 NAME
4
5perl5215delta - what is new for perl v5.21.5
6
7=head1 DESCRIPTION
8
9This document describes differences between the 5.21.4 release and the 5.21.5
10release.
11
12If you are upgrading from an earlier release such as 5.21.3, first read
13L<perl5214delta>, which describes differences between 5.21.3 and 5.21.4.
14
15=head1 Core Enhancements
16
17=head2 New double-diamond operator
18
19C<<< <<>> >>> is like C<< <> >> but uses three-argument C<open> to open
20each file in @ARGV. So each element of @ARGV is an actual file name, and
21"|foo" won't be treated as a pipe open.
22
23=head2 Aliasing via reference
24
25Variables and subroutines can now be aliased by assigning to a reference:
26
27 \$c = \$d;
28 \&x = \&y;
29
30Or by using a backslash before a C<foreach> iterator variable, which is
31perhaps the most useful idiom this feature provides:
32
33 foreach \%hash (@array_of_hash_refs) { ... }
34
35This feature is experimental and must be enabled via C<use feature
36'refaliasing'>. It will warn unless the C<experimental::refaliasing>
37warnings category is disabled.
38
39See L<perlref/Assigning to References>
40
41=head2 Perl now supports POSIX 2008 locale currency additions.
42
43On platforms that are able to handle POSIX.1-2008, the
44hash returned by
45L<C<POSIX::localeconv()>|perllocale/The localeconv function>
46includes the international currency fields added by that version of the
47POSIX standard. These are
48C<int_n_cs_precedes>,
49C<int_n_sep_by_space>,
50C<int_n_sign_posn>,
51C<int_p_cs_precedes>,
52C<int_p_sep_by_space>,
53and
54C<int_p_sign_posn>.
55
56=head2 Packing infinity or not-a-number into a character is now fatal
57
58Before, when trying to pack infinity or not-a-number into a
59(signed) character, Perl would warn, and assumed you tried to
60pack C<< 0xFF >>; if you gave it as an argument to C<< chr >>,
61C<< U+FFFD >> was returned.
62
63But now, all such actions (C<< pack >>, C<< chr >>, and C<< print '%c' >>)
64result in a fatal error.
65
66=head2 Inf and NaN
67
68Many small improvements, bug fixes and added test cases for dealing
69with math related to infinity and not-a-number.
70
71=head1 Security
72
73=head2 Perl is now compiled with -fstack-protector-strong if available
74
75Perl has been compiled with the anti-stack-smashing option
76C<-fstack-protector> since 5.10.1. Now Perl uses the newer variant
77called C<-fstack-protector-strong>, if available. (This was added
78already in 5.21.4.)
79
80=head1 Deprecations
81
82=head2 Use of multiple /x regexp modifiers
83
84It is now deprecated to say something like any of the following:
85
86 qr/foo/xx;
87 /(?xax:foo)/;
88 use re qw(/amxx);
89
90That is, now C<x> should only occur once in any string of contiguous
91regular expression pattern modifiers. We do not believe there are any
92occurrences of this in all of CPAN. This is in preparation for a future
93Perl release having C</xx> mean to allow white-space for readability in
94bracketed character classes (those enclosed in square brackets:
95C<[...]>).
96
97=head1 Performance Enhancements
98
99=over 4
100
101=item *
102
103C<length> is up to 20% faster for non-magical/non-tied scalars containing a
104string if it is a non-utf8 string or if C<use bytes;> is in scope.
105
106=item *
107
108Non-magical/non-tied scalars that contain only a floating point value and are
109on most Perl builds with 64 bit integers now use 8-32 less bytes of memory
110depending on OS.
111
112=item *
113
114In C<@array = split>, the assignment can be optimized away with C<split>
115writing directly to the array. This optimisation was happening only for
116package arrays other than @_ and only
117sometimes. Now this optimisation happens
118almost all the time.
119
120=item *
121
122C<join> is now subject to constant folding. Moreover, C<join> with a
123scalar or constant for the separator and a single-item list to join is
124simplified to a stringification. The separator doesn't even get evaluated.
125
126=item *
127
128C<qq(@array)> is implemented using two ops: a stringify op and a join op.
129If the qq contains nothing but a single array, the stringification is
130optimized away.
131
132=item *
133
134C<our $var> and C<our($s,@a,%h)> in void context are no longer evaluated at
135run time. Even a whole sequence of C<our $foo;> statements will simply be
136skipped over. The same applies to C<state> variables.
137
138=back
139
140=head1 Modules and Pragmata
141
142=head2 Updated Modules and Pragmata
143
144=over 4
145
146=item *
147
148L<attributes> has been upgraded from version 0.23 to 0.24.
149
150Avoid reading beyond the end of a buffer. [perl #122629]
151
152=item *
153
154L<B> has been upgraded from version 1.51 to 1.52.
155
156=item *
157
158L<B::Concise> has been upgraded from version 0.993 to 0.994.
159
160Null ops that are part of the execution chain are now given sequence
161numbers.
162
163Private flags for nulled ops are now dumped with mnemonics as they would be
164for the non-nulled counterparts.
165
166L<B::Deparse> has been upgraded from version 1.28 to 1.29.
167
168Parenthesised arrays in lists passed to C<\> are now correctly deparsed
169with parentheses (e.g., C<\(@a, (@b), @c)> now retains the parentheses
170around @b), this preserving the flattening behaviour of referenced
171parenthesised arrays. Formerly, it only worked for one array: C<\(@a)>.
172
173C<local our> is now deparsed correctly, with the C<our> included.
174
175C<for($foo; !$bar; $baz) {...}> was deparsed without the C<!> (or C<not>).
176This has been fixed.
177
178Core keywords that conflict with lexical subroutines are now deparsed with
179the C<CORE::> prefix.
180
181C<foreach state $x (...) {...}> now deparses correctly with C<state> and
182not C<my>.
183
184C<our @array = split(...)> now deparses correctly with C<our> in those
185cases where the assignment is optimized away.
186
187=item *
188
189L<B::Debug> has been upgraded from version 1.21 to 1.22.
190
191=item *
192
193L<B::Deparse> has been upgraded from version 1.28 to 1.29.
194
195=item *
196
197L<Compress::Raw::Bzip2> has been upgraded from version 2.064 to 2.066.
198
199=item *
200
201L<Compress::Raw::Zlib> has been upgraded from version 2.065 to 2.066.
202
203=item *
204
205L<CPAN::Meta> has been upgraded from version 2.142060 to 2.142690.
206
207=item *
208
209L<DynaLoader> has been upgraded from version 1.26 to 1.27.
210
211Remove dl_nonlazy global if unused in Dynaloader. [perl #122926]
212
213=item *
214
215L<Errno> has been upgraded from version 1.20_04 to 1.21.
216
217=item *
218
219L<experimental> has been upgraded from version 0.010 to 0.012.
220
221=item *
222
223L<ExtUtils::CBuilder> has been upgraded from version 0.280219 to 0.280220.
224
225=item *
226
227L<ExtUtils::Miniperl> has been upgraded from version 1.02 to 1.03.
228
229=item *
230
231L<Fcntl> has been upgraded from version 1.11 to 1.13.
232
233Add support for the Linux pipe buffer size fcntl() commands.
234
235=item *
236
237L<feature> has been upgraded from version 1.37 to 1.38.
238
239=item *
240
241L<File::Find> has been upgraded from version 1.28 to 1.29.
242
243Slightly faster module loading time.
244
245=item *
246
247L<File::Spec> has been upgraded from version 3.50 to 3.51.
248
249=item *
250
251L<HTTP::Tiny> has been upgraded from version 0.049 to 0.050.
252
253=item *
254
255The IO-Compress set of modules has been upgraded from version 2.064 to 2.066.
256
257=item *
258
259L<JSON::PP> has been upgraded from version 2.27203 to 2.27300.
260
261=item *
262
263The libnet collection of modules has been upgraded from version 1.27 to 3.02.
264
265Support for IPv6 and SSL to Net::FTP, Net::NNTP, Net::POP3 and Net::SMTP.
266
267Improvements in Net::SMTP authentication.
268
269=item *
270
271L<Module::CoreList> has been upgraded from version 5.20140920 to 5.20141020.
272
273Updated to cover the latest releases of Perl.
274
275=item *
276
277L<Opcode> has been upgraded from version 1.28 to 1.29.
278
279=item *
280
281The PathTools module collection has been upgraded from version 3.50 to 3.51.
282
283Slightly faster module loading time.
284
285=item *
286
287L<perlfaq> has been upgraded from version 5.0150045 to version 5.0150046.
288[perl #123008]
289
290=item *
291
292L<POSIX> has been upgraded from version 1.43 to 1.45.
293
294POSIX::tmpnam() now produces a deprecation warning. [perl #122005]
295
296=item *
297
298L<re> has been upgraded from version 0.26 to 0.27.
299
300=item *
301
302L<Socket> has been upgraded from version 2.015 to 2.016.
303
304=item *
305
306L<Test::Simple> has been upgraded from version 1.001006 to 1.001008.
307
308=item *
309
310L<threads::shared> has been upgraded from version 1.46 to 1.47.
311
312=item *
313
314L<warnings> has been upgraded from version 1.26 to 1.28.
315
316=item *
317
318L<XSLoader> has been upgraded from version 0.17 to 0.18.
319
320Allow XSLoader to load modules from a different namespace.
321[perl #122455]
322
323=back
324
325=head1 Documentation
326
327=head2 Changes to Existing Documentation
328
329=head3 L<perlrecharclass>
330
331=over 4
332
333=item *
334
335Clarifications have been added to L<perlrecharclass/Character Ranges>
336to the effect that Perl guarantees that C<[A-Z]>, C<[a-z]>, C<[0-9]> and
337any subranges thereof in regular expression bracketed character classes
338are guaranteed to match exactly what a naive English speaker would
339expect them to match, even on platforms (such as EBCDIC) where special
340handling is required to accomplish this.
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 New Diagnostics
351
352=head3 New Errors
353
354=over 4
355
356=item *
357
358L<Cannot chr %f|perldiag/"Cannot chr %f">
359
360=item *
361
362L<Cannot compress %f in pack|perldiag/"Cannot compress %f in pack">
363
364=item *
365
366L<Cannot pack %f with '%c'|perldiag/"Cannot pack %f with '%c'">
367
368=item *
369
370L<Cannot print %f with '%c'|perldiag/"Cannot printf %f with '%c'">
371
372=back
373
374=head2 Changes to Existing Diagnostics
375
376=over 4
377
378=item *
379
380'"my" variable &foo::bar can't be in a package' has been reworded to say
381'subroutine' instead of 'variable'.
382
383=back
384
385=head1 Testing
386
387=over 4
388
389=item *
390
391Some regular expression tests are written in such a way that they will
392run very slowly if certain optimizations break. These tests have been
393moved into new files, F<< t/re/speed.t >> and F<< t/re/speed_thr.t >>,
394and are run with a C<< watchdog() >>.
395
396=back
397
398=head1 Platform Support
399
400=head2 Regained Platforms
401
402IRIX and Tru64 platforms are working again.
403(Some C<make test> failures remain.)
404
405=head2 Platform-Specific Notes
406
407=over 4
408
409=item EBCDIC
410
411Special handling is required on EBCDIC platforms to get C<qr/[i-j]/> to
412match only C<"i"> and C<"j">, since there are 7 characters between the
413code points for C<"i"> and C<"j">. This special handling had only been
414invoked when both ends of the range are literals. Now it is also
415invoked if any of the C<\N{...}> forms for specifying a character by
416name or Unicode code point is used instead of a literal. See
417L<perlrecharclass/Character Ranges>.
418
419=back
420
421=head1 Internal Changes
422
423=over 4
424
425=item *
426
427SVs of type SVt_NV are now bodyless when a build configure and platform allow
428it, specifically C<sizeof(NV) <= sizeof(IV)>. The bodyless trick is the same one
429as for IVs since 5.9.2, but for NVs, unlike IVs, is not guaranteed on all
430platforms and build configurations.
431
432=item *
433
434The C<$DB::single>, C<$DB::signal> and C<$DB::trace> now have set and
435get magic that stores their values as IVs and those IVs are used when
436testing their values in C<pp_dbstate>. This prevents perl from
437recursing infinity if an overloaded object is assigned to any of those
438variables. [perl #122445]
439
440=item *
441
442C<Perl_tmps_grow> which is marked as public API but undocumented has been
443removed from public API. If you use C<EXTEND_MORTAL> macro in your XS code to
444preextend the mortal stack, you are unaffected by this change.
445
446=item *
447
448C<cv_name>, which was introduced in 5.21.4, has been changed incompatibly.
449It now has a flags field that allows the caller to specify whether the name
450should be fully qualified. See L<perlapi/cv_name>.
451
452=item *
453
454Internally Perl no longer uses the C<SVs_PADMY> flag. C<SvPADMY()> now
455returns a true value for anything not marked PADTMP. C<SVs_PADMY> is now
456defined as 0.
457
458=item *
459
460The macros SETsv and SETsvUN have been removed. They were no longer used
461in the core since commit 6f1401dc2a, and have not been found present on
462CPAN.
463
464=item *
465
466The C<< SvFAKE >> bit (unused on HVs) got informally reserved by
467David Mitchell for future work on vtables.
468
469=item *
470
471The C<sv_catpvn_flags> function accepts C<SV_CATBYTES> and C<SV_CATUTF8>
472flags, which specify whether the appended string is bytes or utf8,
473respectively.
474
475=item *
476
477A new opcode class, C<< METHOP >> has been introduced, which holds
478class/method related info needed at runtime to improve performance
479of class/object method calls.
480
481C<< OP_METHOD >> and C<< OP_METHOD_NAMED >> are moved from being
cde31df6 482C<< UNOP/SVOP >> to being C<< METHOP >>.
86372193
A
483
484=back
485
486=head1 Selected Bug Fixes
487
488=over 4
489
490=item *
491
492Locking and unlocking values via L<Hash::Util> or C<Internals::SvREADONLY>
493no longer has any effect on values that are read-only to begin.
494Previously, unlocking such values could result in crashes, hangs or
495other erratic behaviour.
496
497=item *
498
499The internal C<looks_like_number> function (which L<Scalar::Util> provides
500access to) began erroneously to return true for "-e1" in 5.21.4, affecting
501also C<-'-e1'>. This has been fixed.
502
503=item *
504
505The flip-flop operator (C<..> in scalar context) would return the same
506scalar each time, unless the containing subroutine was called recursively.
507Now it always returns a new scalar. [perl #122829]
508
509=item *
510
511Some unterminated C<(?(...)...)> constructs in regular expressions would
512either crash or give erroneous error messages. C</(?(1)/> is one such
513example.
514
515=item *
516
517C<pack "w", $tied> no longer calls FETCH twice.
518
519=item *
520
521List assignments like C<($x, $z) = (1, $y)> now work correctly if $x and $y
522have been aliased by C<foreach>.
523
524=item *
525
526Some patterns including code blocks with syntax errors, such as
527C</ (?{(^{})/>, would hang or fail assertions on debugging builds. Now
528they produce errors.
529
530=item *
531
532An assertion failure when parsing C<sort> with debugging enabled has been
533fixed. [perl #122771]
534
535=item *
536
537C<*a = *b; @a = split //, $b[1]> could do a bad read and produce junk
538results.
539
540=item *
541
542In C<() = @array = split>, the C<() => at the beginning no longer confuses
543the optimizer, making it assume a limit of 1.
544
545=item *
546
547Fatal warnings no longer prevent the output of syntax errors.
548[perl #122966]
549
550=item *
551
552Fixed a NaN double to long double conversion error on VMS. For quiet NaNs
553(and only on Itanium, not Alpha) negative infinity instead of NaN was
554produced.
555
556=item *
557
558Fixed the issue that caused C<< make distclean >> to leave files behind
559that shouldn't. [perl #122820]
560
561=item *
562
563AIX now sets the length in C<< getsockopt >> correctly. [perl #120835],
564[rt #91183], [rt #85570].
565
566=item *
567
568During the pattern optimization phase, we no longer recurse into
569GOSUB/GOSTART when not SCF_DO_SUBSTR. This prevents the optimizer
570to run "forever" and exhaust all memory. [perl #122283]
571
572=item *
573
574F<< t/op/crypt.t >> now performs SHA-256 algorithm if the default one
575is disabled. [perl #121591]
576
577=item *
578
579Fixed an off-by-one error when setting the size of shared array.
580[perl #122950]
581
582=item *
583
584Fixed a bug that could cause perl to execute an infinite loop during
585compilation. [perl #122995]
586
587=back
588
589=head1 Acknowledgements
590
591Perl 5.21.5 represents approximately 4 weeks of development since Perl 5.21.4
592and contains approximately 40,000 lines of changes across 530 files from 33
593authors.
594
595Excluding auto-generated files, documentation and release tools, there were
596approximately 29,000 lines of changes to 390 .pm, .t, .c and .h files.
597
598Perl continues to flourish into its third decade thanks to a vibrant community
599of users and developers. The following people are known to have contributed the
600improvements that became Perl 5.21.5:
601
602Aaron Crane, Abigail, Alberto Simões, Andrew Fresh, Chris 'BinGOs' Williams,
603Craig A. Berry, Dagfinn Ilmari Mannsåker, Daniel Dragan, David Mitchell, Doug
604Bell, Ed J, Father Chrysostomos, George Greer, Graham Knop, James E Keenan,
605Jarkko Hietaniemi, Karen Etheridge, Karl Williamson, Leon Timmermans, Lukas
606Mai, Niko Tyni, Peter Martini, Petr Písař, Rafael Garcia-Suarez, Reini Urban,
607Ricardo Signes, Shlomi Fish, Steve Hay, syber, Tony Cook, Vincent Pit, Yves
608Orton, Ævar Arnfjörð Bjarmason.
609
610The list above is almost certainly incomplete as it is automatically generated
611from version control history. In particular, it does not include the names of
612the (very much appreciated) contributors who reported issues to the Perl bug
613tracker.
614
615Many of the changes included in this version originated in the CPAN modules
616included in Perl's core. We're grateful to the entire CPAN community for
617helping Perl to flourish.
618
619For a more complete list of all of Perl's historical contributors, please see
620the F<AUTHORS> file in the Perl source distribution.
621
622=head1 Reporting Bugs
623
624If you find what you think is a bug, you might check the articles recently
625posted to the comp.lang.perl.misc newsgroup and the perl bug database at
626https://rt.perl.org/ . There may also be information at
627http://www.perl.org/ , the Perl Home Page.
628
629If you believe you have an unreported bug, please run the L<perlbug> program
630included with your release. Be sure to trim your bug down to a tiny but
631sufficient test case. Your bug report, along with the output of C<perl -V>,
632will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
633
634If the bug you are reporting has security implications, which make it
635inappropriate to send to a publicly archived mailing list, then please send it
636to perl5-security-report@perl.org. This points to a closed subscription
637unarchived mailing list, which includes all the core committers, who will be
638able to help assess the impact of issues, figure out a resolution, and help
639co-ordinate the release of patches to mitigate or fix the problem across all
640platforms on which Perl is supported. Please only use this address for
641security issues in the Perl core, not for modules independently distributed on
642CPAN.
643
644=head1 SEE ALSO
645
646The F<Changes> file for an explanation of how to view exhaustive details on
647what changed.
648
649The F<INSTALL> file for how to build Perl.
650
651The F<README> file for general stuff.
652
653The F<Artistic> and F<Copying> files for copyright information.
654
655=cut