This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
update epigraphs.pod
[perl5.git] / pod / perldelta.pod
CommitLineData
44691e6f
AB
1=encoding utf8
2
3=head1 NAME
4
e96e0834 5perldelta - what is new for perl v5.17.2
417a992d 6
e96e0834 7=head1 DESCRIPTION
028c8719 8
e96e0834
JL
9This document describes differences between the 5.17.1 release and
10the 5.17.2 release.
028c8719 11
e96e0834
JL
12If you are upgrading from an earlier release such as 5.17.0, first read
13L<perl5171delta>, which describes differences between 5.17.0 and
145.17.1.
028c8719 15
e96e0834 16=head1 Core Enhancements
e128ab2c 17
90519d0f
FC
18=head2 C<kill> with negative signal names
19
20C<kill> has always allowed a negative signal number, which kills the
21process group instead of a single process. It has also allowed signal
22names. But it did not behave consistently, because negative signal names
23were treated as 0. Now negative signals names like C<-INT> are supported
24and treated the same way as -2 [perl #112990].
25
6db9054f
TC
26=head2 C<pack> is now constant folded.
27
28C<pack> with constant arguments is now constant folded in most cases
29[perl #113470].
30
61174fb5 31=head1 Modules and Pragmata
ef7131e9 32
e96e0834 33=head2 Updated Modules and Pragmata
ff3f295c 34
e96e0834 35=over 4
95c6c5c5 36
95c6c5c5
JL
37=item *
38
4c77591b
NC
39L<File::stat> has been upgraded from version 1.06 to 1.07.
40
41Previously C<File::stat>'s overloaded C<-x> and C<-X> operators did not give
42the correct results for directories or executable files when running as
43root. They had been treating executable permissions for root just like for
44any other user, performing group membership tests I<etc> for files not owned
45by root. They now follow the correct Unix behaviour - for a directory they
46are always true, and for a file if any of the three execute permission bits
47are set then they report that root can execute the file. Perl's builtin
48C<-x> and C<-X> operators have always been correct.
c506fc7e 49
36ab1671
FC
50=item *
51
52L<Tie::StdHandle> has been upgraded from version 4.2 to 4.3.
53
54C<READ> now respects the offset argument to C<read> [perl #112826].
55
df2c1bb8
TC
56=item *
57
58L<IO> has been upgraded from version 1.25_07 to 1.25_08.
59
60L<IO::Socket> tries harder to cache or otherwise fetch socket
61information.
62
7ab2ea42
TC
63=item *
64
65L<Storable> has been upgraded from version 2.36 to 2.37.
66
67Restricted hashes were not always thawed correctly [perl #73972].
68
69Storable would croak when freezing a blessed REF object with a
70C<STORABLE_freeze()> method [perl #113880].
71
3be135d8
TC
72=item *
73
74L<Socket> has been upgraded from version 2.001 to 2.002.
75
6db9054f
TC
76=item *
77
78L<autodie> has been upgraded from version 2.11 to 2.12.
79
80C<autodie> now plays nicely with the 'open' pragma.
81
82=item *
83
84L<File::Fetch> has been upgraded from version 0.34 to 0.36.
85
86Added the 'file_default' option for URLs that do not have a file
87component.
88
7ca04d94
TC
89=item *
90
91L<Module::CoreList> has been upgraded from version 2.68 to 2.69.
92
e96e0834 93=back
c506fc7e 94
e96e0834 95=head1 Documentation
95c6c5c5 96
e96e0834 97=head2 Changes to Existing Documentation
95c6c5c5 98
66b30015 99=head3 L<perlfunc>
95c6c5c5 100
e96e0834 101=over 4
95c6c5c5
JL
102
103=item *
104
66b30015 105Clarified documentation of C<our>.
95c6c5c5 106
e96e0834 107=back
95c6c5c5 108
e96e0834 109=head1 Diagnostics
95c6c5c5 110
e96e0834
JL
111The following additions or changes have been made to diagnostic output,
112including warnings and fatal error messages. For the complete list of
113diagnostic messages, see L<perldiag>.
95c6c5c5 114
e96e0834 115=head2 New Diagnostics
95c6c5c5 116
e96e0834 117=head3 New Errors
95c6c5c5 118
e96e0834 119=over 4
95c6c5c5 120
95c6c5c5
JL
121=item *
122
a9be10f4 123L<Group name must start with a non-digit word character in regex; marked by <-- HERE in mE<sol>%sE<sol>|perldiag/"Group name must start with a non-digit word character in regex; marked by <-- HERE in m/%s/">
40e43b78
FC
124
125This error has been added for C<(?&0)>, which is invalid. It used to
126produce an incomprehensible error message [perl #101666].
95c6c5c5 127
b8a55fe7
FC
128=item *
129
130L<Can't use an undefined value as a subroutine reference|perldiag/"Can't use an undefined value as %s reference">
131
132Calling an undefined value as a subroutine now produces this error message.
133It used to, but was accidentally disabled, first in Perl 5.004 for
134non-magical variables, and then in Perl 5.14 for magical (e.g., tied)
135variables. It has now been restored. In the mean time, undef was treated
136as an empty string [perl #113576].
137
e96e0834 138=back
95c6c5c5 139
e96e0834 140=head3 New Warnings
95c6c5c5 141
e96e0834 142=over 4
95c6c5c5 143
95c6c5c5
JL
144=item *
145
4f85bc45
TC
146"L<Invalid negative number (%s) in chr|perldiag/"Invalid negative number (%s) in chr">"
147
72267260
JL
148C<chr()> now warns when passed a negative value [perl #83048].
149
150=item *
151
4f85bc45
TC
152"L<Integer overflow in srand|perldiag/"Integer overflow in srand">"
153
72267260
JL
154C<srand()> now warns when passed a value that doesn't fit in a C<UV> (since the
155value will be truncated rather than overflowing) [perl #40605].
7d101ed1 156
e013ada0
JL
157=item *
158
4f85bc45
TC
159"L<-i used with no filenames on the command line, reading from STDIN|perldiag/"-i used with no filenames on the command line, reading from STDIN">"
160
e013ada0
JL
161Running perl with the C<-i> flag now warns if no input files are provided on
162the command line [perl #113410].
163
e96e0834 164=back
d9661073 165
e96e0834 166=head2 Changes to Existing Diagnostics
95c6c5c5 167
e96e0834 168=over 4
95c6c5c5
JL
169
170=item *
171
90519d0f
FC
172The 'Can't use "my %s" in sort comparison' error has been downgraded to a
173warning, '"my %s" used in sort comparison' (with 'state' instead of 'my'
174for state variables). In addition, the heuristics for guessing whether
175lexical $a or $b has been misused have been improved to generate fewer
176false positives. Lexical $a and $b are no longer disallowed if they are
177outside the sort block. Also, a named unary or list operator inside the
178sort block no longer causes the $a or $b to be ignored [perl #86136].
3630f57e 179
e96e0834 180=back
3630f57e 181
e96e0834 182=head1 Configuration and Compilation
95c6c5c5 183
e96e0834 184=over 4
95c6c5c5
JL
185
186=item *
187
c5057b0f
FC
188Building perl with some Windows compilers used to fail due to a problem
189with miniperl's C<glob> operator (which uses the C<perlglob> program)
190deleting the PATH environment variable [perl #113798].
95c6c5c5 191
e96e0834 192=back
95c6c5c5 193
e96e0834 194=head1 Platform Support
05c8f9ed 195
61174fb5 196=head2 Platform-Specific Notes
ceb0881c 197
e96e0834 198=over 4
0998713f 199
5edb02d0 200=item VMS
112b6866 201
5edb02d0
CB
202Quotes are now removed from the command verb (but not the parameters) for commands
203spawned via C<system>, backticks, or a piped C<open>. Previously, quotes on the verb
204were passed through to DCL, which would fail to recognize the command. Also, if the
205verb is actually a path to an image or command procedure on an ODS-5 volume, quoting it
206now allows the path to contain spaces.
112b6866 207
42d72fc5
TC
208=item AIX
209
4f85bc45 210Configure now always adds C<-qlanglvl=extc99> to the CC flags on AIX when
42d72fc5
TC
211using xlC. This will make it easier to compile a number of XS-based modules
212that assume C99 [perl #113778].
213
61174fb5 214=back
8e125188 215
61174fb5 216=head1 Internal Changes
8e125188 217
e96e0834 218=over 4
e128ab2c 219
e2f0c3bb
FC
220=item *
221
16e4fcbf
CS
222Perl used to implement get magic in a way that would sometimes hide bugs in
223code could call mg_get() too many times on magical values. This hiding of
224errors no longer occurs, so long-standing bugs may become visible now. If
225you see magic-related errors in XS code, check to make sure it, together
226with the Perl API functions it uses, calls mg_get() only once on SvGMAGICAL()
227values.
228
229=item *
230
7ab2ea42
TC
231OP allocation for CVs now uses a slab allocator. This simplifies
232memory management for OPs allocated to a CV, so cleaning up after a
233compilation error is simpler and safer [perl #111462][perl #112312].
e2f0c3bb 234
90519d0f
FC
235=item *
236
237PERL_DEBUG_READONLY_OPS has been rewritten to work with the new slab
4f85bc45 238allocator, allowing it to catch more violations than before.
90519d0f
FC
239
240=item *
241
242The old slab allocator for ops, which was only enabled for PERL_IMPLICIT_SYS and PERL_DEBUG_READONLY_OPS, has been retired.
243
61174fb5 244=back
422287bf 245
61174fb5 246=head1 Selected Bug Fixes
2de6ba8d 247
e128ab2c
DM
248=over 4
249
250=item *
251
48895a0d 252A regression introduced in v5.14.0 has been fixed, in which some calls
7ab2ea42 253to the C<re> module would clobber C<$_> [perl #113750].
e128ab2c 254
8b1adbab
JL
255=item *
256
257C<do FILE> now always either sets or clears C<$@>, even when the file can't be
258read. This ensures that testing C<$@> first (as recommended by the
259documentation) always returns the correct result.
260
83f29afa
VP
261=item *
262
263The array iterator used for the C<each @array> construct is now correctly
264reset when C<@array> is cleared (RT #75596). This happens for example when the
265array is globally assigned to, as in C<@array = (...)>, but not when its
266B<values> are assigned to. In terms of the XS API, it means that C<av_clear()>
267will now reset the iterator.
268
269This mirrors the behaviour of the hash iterator when the hash is cleared.
270
0938f143
JL
271=item *
272
273C<< $class->can >>, C<< $class->isa >>, and C<< $class->DOES >> now return
274correct results, regardless of whether that package referred to by C<$class>
275exists [perl #47113].
276
72267260
JL
277=item *
278
279Arriving signals no longer clear C<$@> [perl #45173].
280
7a251f7a
JL
281=item *
282
283Allow C<my ()> declarations with an empty variable list [perl #113554].
284
21247d85
FC
285=item *
286
287During parsing, subs declared after errors no longer leave stubs
288[perl #113712].
289
2e4f8b82
FC
290=item *
291
c95d4104
FC
292Closures containing no string evals no longer hang on to their containing
293subroutines, allowing variables closed over by outer subroutines to be
294freed when the outer sub is freed, even if the inner sub still exists
295[perl #89544].
296
788505db
FC
297=item *
298
299Duplication of in-memory filehandles by opening with a "<&=" or ">&=" mode
300stopped working properly in 5.16.0. It was causing the new handle to
301reference a different scalar variable. This has been fixed [perl #113764].
302
2c2b9cf4
FC
303=item *
304
305C<qr//> expressions no longer crash with custom regular expression engines
306that do not set C<offs> at regular expression compilation time
307[perl #112962].
308
3cd56aaa
TC
309=item *
310
311C<delete local> no longer crashes with certain magical arrays and hashes
312[perl #112966].
313
314=item *
315
316C<local> on elements of certain magical arrays and hashes used not to
317arrange to have the element deleted on scope exit, even if the element did
318not exist before C<local>.
319
320=item *
321
322C<scalar(write)> no longer returns multiple items [perl #73690].
323
324=item *
325
326String to floating point conversions no longer misparse certain strings under
327C<use locale> [perl #109318].
328
329=item *
330
331C<@INC> filters that die no longer leak memory [perl #92252].
332
333=item *
334
335The implementations of overloaded operations are now called in the correct
336context. This allows, among other things, being able to properly override
337C<< <> >> [perl #47119].
338
339=item *
340
341Specifying only the C<fallback> key when calling C<use overload> now behaves
342properly [perl #113010].
343
c0c19433
JL
344=item *
345
346C<< sub foo { my $a = 0; while ($a) { ... } } >> and
347C<< sub foo { while (0) { ... } } >> now return the same thing [perl #73618].
348
7ab2ea42
TC
349=item *
350
f4df6cb9 351Fixed the debugger C<l> and C<M> commands, and other debugger
7ab2ea42
TC
352functionality which was broken in 5.17.0 [perl #113918].
353
354=item *
355
356String negation now behaves the same under C<use integer;> as it does
357without [perl #113012].
358
90519d0f
FC
359=item *
360
361C<chr> now returns the Unicode replacement character (U+FFFD) for -1,
362regardless of the internal representation. -1 used to wrap if the argument
363was tied or a string internally.
364
365=item *
366
367Using a C<format> after its enclosing sub was freed could crash as of
368perl 5.12.0, if the format referenced lexical variables from the outer sub.
369
370=item *
371
372Using a C<format> after its enclosing sub was undefined could crash as of
373perl 5.10.0, if the format referenced lexical variables from the outer sub.
374
375=item *
376
377Using a C<format> defined inside a closures, which format references
378lexical variables from outside, never really worked unless the C<write>
379call was directly inside the closure. In 5.10.0 it even started crashing.
380Now the copy of that closure nearest the top of the call stack is used to
381find those variables.
382
383=item *
384
385Formats that close over variables in special blocks no longer crash if a
386stub exists with the same name as the special block before the special
387block is compiled.
388
389=item *
390
391The parser no longer gets confused, treating C<eval foo ()> as a syntax
392error if preceded by C<print;> [perl #16249].
393
394=item *
395
396The return value of C<syscall> is no longer truncated on 64-bit platforms
397[perl #113980].
398
399=item *
400
401Constant folding no longer causes C<print 1 ? FOO : BAR> to print to the
402FOO handle [perl #78064].
403
404=item *
405
406C<do subname> now calls the named subroutine and uses the file name it
407returns, instead of opening a file named "subname".
408
409=item *
410
411Subroutines looked up by rv2cv check hooks (registered by XS modules) are
412now taken into consideration when determining whether C<foo bar> should be
413the sub call C<foo(bar)> or the method call C<< "bar"->foo >>.
414
415=item *
416
417C<CORE::foo::bar> is no longer treated specially, allowing global overrides
418to be called directly via C<CORE::GLOBAL::uc(...)> [perl #113016].
419
420=item *
421
422Calling an undefined sub whose typeglob has been undefined now produces the
423customary "Undefined subroutine called" error, instead of "Not a CODE
424reference".
425
b8a55fe7
FC
426=item *
427
428Two bugs involving @ISA have been fixed. C<*ISA = *glob_without_array> and
429C<undef *ISA; @{*ISA}> would prevent future modifications to @ISA from
430updating the internal caches used to look up methods. The
431*glob_without_array case was a regression from Perl 5.12.
432
433=item *
434
435Regular expression optimisations sometimes caused C<$> with C</m> to
436produce failed or incorrect matches [perl #114068].
437
438=item *
439
440C<__SUB__> now works in a C<sort> block when the enclosing subroutine is
441predeclared with C<sub foo;> syntax [perl #113710].
442
5073ffbd
KW
443=item *
444
445Unicode properties only apply to Unicode code points, which leads to
446some subtleties when regular expressions are matched against
447above-Unicode code points. There is a warning generated to draw your
448attention to this. However, this warning was being generated
449inappropriately in some cases, such as when a program was being parsed.
450Non-Unicode matches such as C<\w> and C<[:word;]> should not generate the
451warning, as their definitions don't limit them to apply to only Unicode
452code points. Now the message is only generated when matching against
453C<\p{}> and C<\P{}>. There remains a bug, [perl #114148], for the very
454few properties in Unicode that match just a single code point. The
455warning is not generated if they are matched against an above-Unicode
456code point.
457
e128ab2c
DM
458=back
459
61174fb5 460=head1 Acknowledgements
d5dc7001 461
4f85bc45
TC
462Perl 5.17.2 represents approximately 4 weeks of development since Perl 5.17.1
463and contains approximately 15,000 lines of changes across 320 files from 34
464authors.
465
466Perl continues to flourish into its third decade thanks to a vibrant community
467of users and developers. The following people are known to have contributed the
468improvements that became Perl 5.17.2:
469
470Aristotle Pagaltzis, Brian Fraser, Chip Salzenberg, Chris 'BinGOs' Williams,
471Colin Kuskie, Craig A. Berry, Daniel Dragan, Daniel Perrett, Darin McBride,
472David Golden, David Mitchell, Dominic Hargreaves, E. Choroba, Eric Brine,
473Father Chrysostomos, François Perrad, H.Merijn Brand, Jan Dubois, Jesse
474Luehrs, Karl Williamson, Lukas Mai, Matthew Horsfall, Nicholas Clark, Oleg
475Nesterov, Reini Urban, Ricardo Signes, Robin Barker, Shirakata Kentaro, Shlomi
476Fish, Steve Hay, Tony Cook, Vincent Pit, Walt Mankowski, Yves Orton.
477
478The list above is almost certainly incomplete as it is automatically generated
479from version control history. In particular, it does not include the names of
480the (very much appreciated) contributors who reported issues to the Perl bug
481tracker.
482
483Many of the changes included in this version originated in the CPAN modules
484included in Perl's core. We're grateful to the entire CPAN community for
485helping Perl to flourish.
486
487For a more complete list of all of Perl's historical contributors, please see
488the F<AUTHORS> file in the Perl source distribution.
29cf780c 489
44691e6f
AB
490=head1 Reporting Bugs
491
492If you find what you think is a bug, you might check the articles
52deee2e 493recently posted to the comp.lang.perl.misc newsgroup and the perl
f9001595
RS
494bug database at http://rt.perl.org/perlbug/ . There may also be
495information at http://www.perl.org/ , the Perl Home Page.
44691e6f
AB
496
497If you believe you have an unreported bug, please run the L<perlbug>
52deee2e
DR
498program included with your release. Be sure to trim your bug down
499to a tiny but sufficient test case. Your bug report, along with the
500output of C<perl -V>, will be sent off to perlbug@perl.org to be
501analysed by the Perl porting team.
44691e6f
AB
502
503If the bug you are reporting has security implications, which make it
f9001595
RS
504inappropriate to send to a publicly archived mailing list, then please send
505it to perl5-security-report@perl.org. This points to a closed subscription
506unarchived mailing list, which includes
507all the core committers, who will be able
508to help assess the impact of issues, figure out a resolution, and help
509co-ordinate the release of patches to mitigate or fix the problem across all
510platforms on which Perl is supported. Please only use this address for
511security issues in the Perl core, not for modules independently
512distributed on CPAN.
44691e6f
AB
513
514=head1 SEE ALSO
515
52deee2e
DR
516The F<Changes> file for an explanation of how to view exhaustive details
517on what changed.
44691e6f
AB
518
519The F<INSTALL> file for how to build Perl.
520
521The F<README> file for general stuff.
522
523The F<Artistic> and F<Copying> files for copyright information.
524
525=cut