This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #114338] Misleading prototype in perlapi manpage
[perl5.git] / pod / perl5172delta.pod
CommitLineData
4eabcf70
TC
1=encoding utf8
2
3=head1 NAME
4
5perl5172delta - what is new for perl v5.17.2
6
7=head1 DESCRIPTION
8
9This document describes differences between the 5.17.1 release and
10the 5.17.2 release.
11
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.
15
16=head1 Core Enhancements
17
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
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
31=head1 Modules and Pragmata
32
33=head2 Updated Modules and Pragmata
34
35=over 4
36
37=item *
38
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.
49
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
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
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
72=item *
73
74L<Socket> has been upgraded from version 2.001 to 2.002.
75
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
89=item *
90
91L<Module::CoreList> has been upgraded from version 2.68 to 2.69.
92
93=back
94
95=head1 Documentation
96
97=head2 Changes to Existing Documentation
98
99=head3 L<perlfunc>
100
101=over 4
102
103=item *
104
105Clarified documentation of C<our>.
106
107=back
108
109=head1 Diagnostics
110
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>.
114
115=head2 New Diagnostics
116
117=head3 New Errors
118
119=over 4
120
121=item *
122
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/">
124
125This error has been added for C<(?&0)>, which is invalid. It used to
126produce an incomprehensible error message [perl #101666].
127
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
138=back
139
140=head3 New Warnings
141
142=over 4
143
144=item *
145
146"L<Invalid negative number (%s) in chr|perldiag/"Invalid negative number (%s) in chr">"
147
148C<chr()> now warns when passed a negative value [perl #83048].
149
150=item *
151
152"L<Integer overflow in srand|perldiag/"Integer overflow in srand">"
153
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].
156
157=item *
158
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
161Running perl with the C<-i> flag now warns if no input files are provided on
162the command line [perl #113410].
163
164=back
165
166=head2 Changes to Existing Diagnostics
167
168=over 4
169
170=item *
171
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].
179
180=back
181
182=head1 Configuration and Compilation
183
184=over 4
185
186=item *
187
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].
191
192=back
193
194=head1 Platform Support
195
196=head2 Platform-Specific Notes
197
198=over 4
199
200=item VMS
201
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.
207
208=item AIX
209
210Configure now always adds C<-qlanglvl=extc99> to the CC flags on AIX when
211using xlC. This will make it easier to compile a number of XS-based modules
212that assume C99 [perl #113778].
213
214=back
215
216=head1 Internal Changes
217
218=over 4
219
220=item *
221
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
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].
234
235=item *
236
237PERL_DEBUG_READONLY_OPS has been rewritten to work with the new slab
238allocator, allowing it to catch more violations than before.
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
244=back
245
246=head1 Selected Bug Fixes
247
248=over 4
249
250=item *
251
252A regression introduced in v5.14.0 has been fixed, in which some calls
253to the C<re> module would clobber C<$_> [perl #113750].
254
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
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
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
277=item *
278
279Arriving signals no longer clear C<$@> [perl #45173].
280
281=item *
282
283Allow C<my ()> declarations with an empty variable list [perl #113554].
284
285=item *
286
287During parsing, subs declared after errors no longer leave stubs
288[perl #113712].
289
290=item *
291
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
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
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
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
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
349=item *
350
351Fixed the debugger C<l> and C<M> commands, and other debugger
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
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
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
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
458=back
459
460=head1 Acknowledgements
461
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.
489
490=head1 Reporting Bugs
491
492If you find what you think is a bug, you might check the articles
493recently posted to the comp.lang.perl.misc newsgroup and the perl
494bug database at http://rt.perl.org/perlbug/ . There may also be
495information at http://www.perl.org/ , the Perl Home Page.
496
497If you believe you have an unreported bug, please run the L<perlbug>
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.
502
503If the bug you are reporting has security implications, which make it
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.
513
514=head1 SEE ALSO
515
516The F<Changes> file for an explanation of how to view exhaustive details
517on what changed.
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