This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add missing =item * in perldelta (now perl5217delta) from commit 070733dfda
[perl5.git] / pod / perl5217delta.pod
CommitLineData
b5d4d3b9
MM
1=encoding utf8
2
3=head1 NAME
4
5perl5217delta - what is new for perl v5.21.7
6
7=head1 DESCRIPTION
8
9This document describes differences between the 5.21.6 release and the 5.21.7
10release.
11
12If you are upgrading from an earlier release such as 5.21.5, first read
13L<perl5216delta>, which describes differences between 5.21.5 and 5.21.6.
14
15=head1 Core Enhancements
16
17=head2 faster array and hash lookups
18
19Array and hash lookups (especially nested ones) that use only constants
20or simple variables as keys, are now considerably faster. See
21L</Internal Changes> for more details.
22
23=head2 C<fileno> now works on directory handles
24
25When the relevant support is available in the operating system, the
26C<fileno> builtin now works on directory handles, yielding the
27underlying file descriptor in the same way as for filehandles. On
28operating systems without such support, C<fileno> on a directory handle
29continues to return the undefined value, as before, but also sets C<$!> to
30indicate that the operation is not supported.
31
32Currently, this uses either a C<dd_fd> member in the OS C<DIR>
33structure, or a dirfd(3) function as specified by POSIX.1-2008.
34
35=head1 Incompatible Changes
36
37=head2 C<&> and C<\&> prototypes accepts only subs
38
39The C<&> prototype character now accepts only anonymous subs (C<sub {...}>)
40and things beginning with C<\&>. Formerly it erroneously also allowed
41C<undef> and references to array, hashes, and lists. [perl #4539]
42[perl #123062]
43
44The C<\&> prototype was allowing subroutine calls, whereas now it only
45allows subroutines. C<&foo> is permitted. C<&foo()> and C<foo()> are not.
46[perl #77860]
47
48=head2 C<use encoding> is now lexical
49
50The L<encoding> pragma's effect is now limited to lexical scope. This
51pragma is deprecated, but in the meantime, it could adversely affect
52unrelated modules that are included in the same program.
53
54=head2 List slices returning empty lists
55
56List slices return an empty list now only if the original list was empty
57(or if there are no indices). Formerly, a list slice would return an empty
58list if all indices fell outside the original list. [perl #114498]
59
60=head1 Deprecations
61
62=head2 Setting C<${^ENCODING}> to anything but C<undef>
63
64This variable allows Perl scripts to be written in a non-ASCII,
65non-UTF-8 encoding. However, it affects all modules globally, leading
66to wrong answers and segmentation faults. New scripts should be written
67in UTF-8; old scripts should be converted to UTF-8, which is easily done
68with the L<encoding> pragma.
69
70=head1 Performance Enhancements
71
72=over 4
73
74=item *
75
76Win32 Perl uses 8 KB less of per-process memory than before for every perl
77process of this version. This data is now memory mapped from disk and shared
78between perl processes from the same perl binary.
79
80=item *
81
82If method and class names are known at compile time, hashes are precomputed
83to speed up run-time method lookup. Also, compound method names like
84C<SUPER::new> are parsed at compile time, to save having to parse them at
85run time.
86
87=back
88
89=head1 Modules and Pragmata
90
91=head2 Updated Modules and Pragmata
92
93=over 4
94
95=item *
96
97The PathTools module collection has been upgraded from 3.52 to 3.53.
98
99Don't turn leading C<//> into C</> on Cygwin. [perl #122635]
100
101=item *
102
103L<Archive::Tar> has been upgraded from version 2.02 to 2.04.
104
105=item *
106
107L<arybase> has been upgraded from version 0.08 to 0.09.
108
109=item *
110
111L<B> has been upgraded from version 1.53 to 1.54.
112
113Nulled COPs are now of class C<B::COP>, rather than C<B::OP>.
114
115B::REGEXP objects now provide a C<qr_anoncv> method for accessing the
116implicit CV associated with C<qr//> things containing code blocks, and a
117C<compflags> method that returns the pertinent flags originating from the
118C<qr//blahblah> op.
119
120B::PMOP now provides a C<pmregexp> method returning a B::REGEXP object.
121
122Two new classes, B::PADNAME and B::PADNAMELIST, have been introduced.
123
124=item *
125
126L<B::Concise> has been upgraded from version 0.995 to 0.996.
127
128=item *
129
130L<B::Deparse> has been upgraded from version 1.30 to 1.31.
131
132BEGIN blocks at the end of the enclosing scope are now deparsed in the
133right place. [perl #77452]
134
135BEGIN blocks were sometimes deparsed as __ANON__, but are now always called
136BEGIN.
137
138Lexical subroutines are now fully deparsed. [perl #116553]
139
140Deparsing of C<$lexical =~ //> was accidentally broken in 1.30 (perl
1415.21.6), omitting the C<$lexical =~>, but has now been fixed.
142
143C<Anything =~ y///r> with C</r> no longer omits the left-hand operand.
144
145The op trees that make up regexp code blocks are now deparsed for real.
146Formerly, the original string that made up the regular expression was used.
147That caused problems with C<qr/(?{E<lt>E<lt>heredoc})/> and multiline code blocks,
148which were deparsed incorrectly. [perl #123217] [perl #115256]
149
150C<$;> at the end of a statement no longer loses its semicolon.
151[perl #123357]
152
153Some cases of subroutine declarations stored in the stash in shorthand form
154were being omitted.
155
156Non-ASCII characters are now consistently escaped in strings, instead of
157some of the time. (There are still outstanding problems with regular
158expressions and identifiers that have not been fixed.)
159
160When prototype sub calls are deparsed with C<&> (e.g., under the B<-P>
161option), C<scalar> is now added where appropriate, to force the scalar
162context implied by the prototype.
163
164C<require(foo())>, C<do(foo())>, C<goto(foo())> and similar constructs with
165loop controls are now deparsed correctly. The outer parentheses are not
166optional.
167
168Whitespace is no longer escaped in regular expressions, because it was
169getting erroneously escaped within C<(?x:...)> sections.
170
171C<sub foo { foo() }> is now deparsed with those mandatory parentheses.
172
173C</@array/> is now deparsed as a regular expression, and not just
174C<@array>.
175
176C</@{-}/>, C</@{+}/> and C<$#{1}> are now deparsed with the braces, which
177are mandatory in these cases.
178
179In deparsing feature bundles, B::Deparse was emitting C<no feature;> first
180instead of C<no feature ':all';>. This has been fixed.
181
182C<chdir FH> is now deparsed without quotation marks.
183
184C<\my @a> is now deparsed without parentheses. (Parenthese would flatten
185the array.)
186
187C<system> and C<exec> followed by a block are now deparsed correctly.
188Formerly there was an erroneous C<do> before the block.
189
190C<< use constant QR =E<gt> qr/.../flags >> followed by C<"" =~ QR> is no longer
191without the flags.
192
193=item *
194
195L<charnames> has been upgraded from version 1.41 to 1.43.
196
197=item *
198
199L<Compress::Raw::Bzip2> has been upgraded from version 2.066 to 2.067.
200
201=item *
202
203L<Compress::Raw::Zlib> has been upgraded from version 2.066 to 2.067.
204
205=item *
206
207L<Data::Dumper> has been upgraded from version 2.154 to 2.155.
208
209=item *
210
211L<DB_File> has been upgraded from version 1.831 to 1.834.
212
213=item *
214
215L<Devel::Peek> has been upgraded from version 1.19 to 1.20.
216
217=item *
218
219L<Devel::PPPort> has been upgraded from version 3.24 to 3.25.
220
221=item *
222
223L<DynaLoader> has been upgraded from version 1.28 to 1.29.
224
225=item *
226
227L<Encode> has been upgraded from version 2.64 to 2.67.
228
229=item *
230
231L<Errno> has been upgraded from version 1.21 to 1.22.
232
233=item *
234
235L<ExtUtils::CBuilder> has been upgraded from version 0.280220 to 0.280221.
236
237=item *
238
239L<ExtUtils::MakeMaker> has been upgraded from version 7.02 to 7.04.
240
241=item *
242
243L<ExtUtils::ParseXS> has been upgraded from version 3.26 to 3.27.
244
245Only declare C<file> unused if we actually define it.
246
247Improve generated C<RETVAL> code generation to avoid repeated
248references to C<ST(0)>. [perl #123278]
249
250Broaden and document the C</OBJ$/> to C</REF$/> typemap optimization
251for the C<DESTROY> method. [perl #123418]
252
253=item *
254
255L<feature> has been upgraded from version 1.38 to 1.39.
256
257=item *
258
259L<File::Spec> has been upgraded from version 3.51 to 3.54.
260
261=item *
262
263L<Filter::Util::Call> has been upgraded from version 1.49 to 1.51.
264
265=item *
266
267L<HTTP::Tiny> has been upgraded from version 0.051 to 0.053.
268
269=item *
270
271L<IO> has been upgraded from version 1.34 to 1.35.
272
273=item *
274
275The IO::Compress module collection has been upgraded from version 2.066 to 2.067.
276
277=item *
278
279L<IO::Socket::IP> has been upgraded from version 0.32 to 0.34.
280
281=item *
282
283L<Locale::Codes> has been upgraded from version 3.32 to 3.33.
284
285=item *
286
287L<Locale::Maketext> has been upgraded from version 1.25 to 1.26.
288
289=item *
290
291L<Module::CoreList> has been upgraded from version 5.20141120 to 5.20141220.
292
293=item *
294
295L<mro> has been upgraded from version 1.16 to 1.17.
296
297=item *
298
299L<NDBM_File> has been upgraded from version 1.13 to 1.14.
300
301=item *
302
303L<Opcode> has been upgraded from version 1.29 to 1.30.
304
305=item *
306
307L<PerlIO::scalar> has been upgraded from version 0.20 to 0.21.
308
309Reading from a position well past the end of the scalar now correctly
310returns end of file. [perl #123443]
311
312Seeking to a negative position still fails, but no longer leaves the
313file position set to a negation location.
314
315C<eof()> on a C<PerlIO::scalar> handle now properly returns true when
316the file position is past the 2GB mark on 32-bit systems.
317
318=item *
319
320L<Pod::Escapes> has been upgraded from version 1.06 to 1.07.
321
322=item *
323
324L<POSIX> has been upgraded from version 1.46 to 1.48.
325
326=item *
327
328L<SDBM_File> has been upgraded from version 1.11 to 1.12.
329
330=item *
331
332L<Storable> has been upgraded from version 2.51 to 2.52.
333
334=item *
335
336L<strict> has been upgraded from version 1.08 to 1.09.
337
338=item *
339
340L<Sys::Hostname> has been upgraded from version 1.19 to 1.20.
341
342=item *
343
344L<Test::Simple> has been upgraded from version 1.301001_075 to 1.301001_090.
345
346=item *
347
348L<threads> has been upgraded from version 1.96 to 1.96_001.
349
350=item *
351
352L<Unicode::Collate> has been upgraded from version 1.07 to 1.09.
353
354=item *
355
356L<XSLoader> has been upgraded from version 0.19 to 0.20
357
358Don't test twice for bootstrap file.
359
360=back
361
362=head1 Diagnostics
363
364The following additions or changes have been made to diagnostic output,
365including warnings and fatal error messages. For the complete list of
366diagnostic messages, see L<perldiag>.
367
368=head2 Changes to Existing Diagnostics
369
370=over 4
371
372=item *
373
374"Variable %s will not stay shared" has been changed to say "Subroutine"
375when it is actually a lexical sub that will not stay shared.
376
377=back
378
379=head1 Platform Support
380
381=head2 Platform-Specific Notes
382
383=head3 Win32
384
385=over
386
387=item *
388
389Intel C builds are now always built with C99 mode on.
390
391=back
392
393=head1 Internal Changes
394
395=over 4
396
397=item *
398
399The PADNAME and PADNAMELIST types are now separate types, and no longer
400simply aliases for SV and AV. [perl #123223]
401
402=item *
403
404Pad names are now always UTF8. The C<PadnameUTF8> macro always returns
405true. Previously, this was effectively the case already, but any support
406for two different internal representations of pad names has now been
407removed.
408
409=item *
410
411The C<OP_SIBLING> and C<OP_HAS_SIBLING> macros added in an earlier 5.21.x
412release have been renamed C<OpSIBLING> and C<OpHAS_SIBLING>, following the
413existing convention.
414
415=item *
416
417A new op class, C<UNOP_AUX>, has been added. This is a subclass of
418C<UNOP> with an C<op_aux> field added, which points to an array of unions
419of C<UV>, C<SV*> etc. It is intended for where an op needs to store more data
420than a simple C<op_sv> or whatever. Currently the only op of this type is
421C<OP_MULTIDEREF> (see below).
422
423=item *
424
425A new op has been added, C<OP_MULTIDEREF>, which performs one or more
426nested array and hash lookups where the key is a constant or simple
427variable. For example the expression C<$a[0]{$k}[$i]>, which previously
428involved ten C<rv2Xv>, C<Xelem>, C<gvsv> and C<const> ops is now performed
429by a single C<multideref> op. It can also handle C<local>, C<exists> and
430C<delete>. A non-simple index expression, such as C<[$i+1]> is still done
431using C<aelem/helem>, and single-level array lookup with a small constant
432index is still done using C<aelemfast>.
433
434=back
435
436=head1 Selected Bug Fixes
437
438=over 4
439
440=item *
441
442On Win32, restoring in a child pseudo-process a variable that was
443C<local()>ed in a parent pseudo-process before the C<fork> happened caused
444memory corruption and a crash in the child pseudo-process (and therefore OS
445process). [perl #40565]
446
447=item *
448
449Calling C<write> on a format with a C<^**> field could produce a panic
450in sv_chop() if there were insufficient arguments or if the variable
451used to fill the field was empty. [perl #123245]
452
453=item *
454
455Non-ASCII lexical sub names (use in error messages) on longer have extra
456junk on the end.
457
458=item *
459
460The C<\@> subroutine prototype no longer flattens parenthesized arrays
461(taking a reference to each element), but takes a reference to the array
462itself. [perl #47363]
463
464=item *
465
466A block containing nothing except a C-style C<for> loop could corrupt the
467stack, causing lists outside the block to lose elements or have elements
468overwritten. This could happen with C<map { for(...){...} } ...> and with
469lists containing C<do { for(...){...} }>. [perl #123286]
470
471=item *
472
473C<scalar()> now propagates lvalue context, so that
474C<for(scalar($#foo)) { ... }> can modify C<$#foo> through C<$_>.
475
476=item *
477
478C<qr/@array(?{block})/> no longer dies with "Bizarre copy of ARRAY".
479[#123344]
480
481=item *
482
483C<eval '$variable'> in nested named subroutines would sometimes look up a
484global variable even with a lexical variable in scope.
485
020d3472
SH
486=item *
487
b5d4d3b9
MM
488In perl 5.20.0, C<sort CORE::fake> where 'fake' is anything other than a
489keyword started chopping of the last 6 characters and treating the result
490as a sort sub name. The previous behaviour of treating "CORE::fake" as a
491sort sub name has been restored. [perl #123410]
492
493=item *
494
495Outside of C<use utf8>, a single-character Latin-1 lexical variable is
496disallowed. The error message for it, "Can't use global $foo...", was
497giving garbage instead of the variable name.
498
499=item *
500
501C<readline> on a nonexistent handle was causing C<${^LAST_FH}> to produce a
502reference to an undefined scalar (or fail an assertion). Now
503C<${^LAST_FH}> ends up undefined.
504
505=item *
506
507C<(...)x...> in void context now applies scalar context to the left-hand
508argument, instead of the context the current sub was called in.
509[perl #123020]
510
511=back
512
513=head1 Acknowledgements
514
515Perl 5.21.7 represents approximately 4 weeks of development since Perl 5.21.6
516and contains approximately 97,000 lines of changes across 640 files from 30
517authors.
518
519Excluding auto-generated files, documentation and release tools, there were
520approximately 26,000 lines of changes to 400 .pm, .t, .c and .h files.
521
522Perl continues to flourish into its third decade thanks to a vibrant community
523of users and developers. The following people are known to have contributed the
524improvements that became Perl 5.21.7:
525
526Aaron Crane, Aristotle Pagaltzis, Chad Granum, Chris 'BinGOs' Williams, Craig
cbd16e09 527A. Berry, Dagfinn Ilmari Mannsåker, Daniel Dragan, David Mitchell, Eric
b5d4d3b9
MM
528Herman, Father Chrysostomos, H.Merijn Brand, Hugo van der Sanden, James
529Raspass, Jarkko Hietaniemi, Jim Cromie, Karen Etheridge, Karl Williamson, kmx,
cbd16e09
KE
530Lukas Mai, Matthew Horsfall, Max Maischein, Petr Písař, Ricardo Signes,
531Shlomi Fish, Steffen Müller, Steve Hay, Sullivan Beck, syber, Todd Rinaldo,
b5d4d3b9
MM
532Tony Cook.
533
534The list above is almost certainly incomplete as it is automatically generated
535from version control history. In particular, it does not include the names of
536the (very much appreciated) contributors who reported issues to the Perl bug
537tracker.
538
539Many of the changes included in this version originated in the CPAN modules
540included in Perl's core. We're grateful to the entire CPAN community for
541helping Perl to flourish.
542
543For a more complete list of all of Perl's historical contributors, please see
544the F<AUTHORS> file in the Perl source distribution.
545
546=head1 Reporting Bugs
547
548If you find what you think is a bug, you might check the articles recently
549posted to the comp.lang.perl.misc newsgroup and the perl bug database at
550https://rt.perl.org/ . There may also be information at
551http://www.perl.org/ , the Perl Home Page.
552
553If you believe you have an unreported bug, please run the L<perlbug> program
554included with your release. Be sure to trim your bug down to a tiny but
555sufficient test case. Your bug report, along with the output of C<perl -V>,
556will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
557
558If the bug you are reporting has security implications, which make it
559inappropriate to send to a publicly archived mailing list, then please send it
560to perl5-security-report@perl.org. This points to a closed subscription
561unarchived mailing list, which includes all the core committers, who will be
562able to help assess the impact of issues, figure out a resolution, and help
563co-ordinate the release of patches to mitigate or fix the problem across all
564platforms on which Perl is supported. Please only use this address for
565security issues in the Perl core, not for modules independently distributed on
566CPAN.
567
568=head1 SEE ALSO
569
570The F<Changes> file for an explanation of how to view exhaustive details on
571what changed.
572
573The F<INSTALL> file for how to build Perl.
574
575The F<README> file for general stuff.
576
577The F<Artistic> and F<Copying> files for copyright information.
578
579=cut