summaryrefslogtreecommitdiff
path: root/pod/perl5172delta.pod
blob: ed2a29c543b5723b6fdbd43b2311bf4eb89850f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
=encoding utf8

=head1 NAME

perl5172delta - what is new for perl v5.17.2

=head1 DESCRIPTION

This document describes differences between the 5.17.1 release and
the 5.17.2 release.

If you are upgrading from an earlier release such as 5.17.0, first read
L<perl5171delta>, which describes differences between 5.17.0 and
5.17.1.

=head1 Core Enhancements

=head2 C<kill> with negative signal names

C<kill> has always allowed a negative signal number, which kills the
process group instead of a single process.  It has also allowed signal
names.  But it did not behave consistently, because negative signal names
were treated as 0.  Now negative signals names like C<-INT> are supported
and treated the same way as -2 [perl #112990].

=head2 C<pack> is now constant folded.

C<pack> with constant arguments is now constant folded in most cases
[perl #113470].

=head1 Modules and Pragmata

=head2 Updated Modules and Pragmata

=over 4

=item *

L<File::stat> has been upgraded from version 1.06 to 1.07.

Previously C<File::stat>'s overloaded C<-x> and C<-X> operators did not give
the correct results for directories or executable files when running as
root. They had been treating executable permissions for root just like for
any other user, performing group membership tests I<etc> for files not owned
by root. They now follow the correct Unix behaviour - for a directory they
are always true, and for a file if any of the three execute permission bits
are set then they report that root can execute the file. Perl's builtin
C<-x> and C<-X> operators have always been correct.

=item *

L<Tie::StdHandle> has been upgraded from version 4.2 to 4.3.

C<READ> now respects the offset argument to C<read> [perl #112826].

=item *

L<IO> has been upgraded from version 1.25_07 to 1.25_08.

L<IO::Socket> tries harder to cache or otherwise fetch socket
information.

=item *

L<Storable> has been upgraded from version 2.36 to 2.37.

Restricted hashes were not always thawed correctly [perl #73972].

Storable would croak when freezing a blessed REF object with a
C<STORABLE_freeze()> method [perl #113880].

=item *

L<Socket> has been upgraded from version 2.001 to 2.002.

=item *

L<autodie> has been upgraded from version 2.11 to 2.12.

C<autodie> now plays nicely with the 'open' pragma.

=item *

L<File::Fetch> has been upgraded from version 0.34 to 0.36.

Added the 'file_default' option for URLs that do not have a file
component.

=item *

L<Module::CoreList> has been upgraded from version 2.68 to 2.69.

=back

=head1 Documentation

=head2 Changes to Existing Documentation

=head3 L<perlfunc>

=over 4

=item *

Clarified documentation of C<our>.

=back

=head1 Diagnostics

The following additions or changes have been made to diagnostic output,
including warnings and fatal error messages.  For the complete list of
diagnostic messages, see L<perldiag>.

=head2 New Diagnostics

=head3 New Errors

=over 4

=item *

L<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/">

This error has been added for C<(?&0)>, which is invalid.  It used to
produce an incomprehensible error message [perl #101666].

=item *

L<Can't use an undefined value as a subroutine reference|perldiag/"Can't use an undefined value as %s reference">

Calling an undefined value as a subroutine now produces this error message.
It used to, but was accidentally disabled, first in Perl 5.004 for
non-magical variables, and then in Perl 5.14 for magical (e.g., tied)
variables.  It has now been restored.  In the mean time, undef was treated
as an empty string [perl #113576].

=back

=head3 New Warnings

=over 4

=item *

"L<Invalid negative number (%s) in chr|perldiag/"Invalid negative number (%s) in chr">"

C<chr()> now warns when passed a negative value [perl #83048].

=item *

"L<Integer overflow in srand|perldiag/"Integer overflow in srand">"

C<srand()> now warns when passed a value that doesn't fit in a C<UV> (since the
value will be truncated rather than overflowing) [perl #40605].

=item *

"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">"

Running perl with the C<-i> flag now warns if no input files are provided on
the command line [perl #113410].

=back

=head2 Changes to Existing Diagnostics

=over 4

=item *

The 'Can't use "my %s" in sort comparison' error has been downgraded to a
warning, '"my %s" used in sort comparison' (with 'state' instead of 'my'
for state variables).  In addition, the heuristics for guessing whether
lexical $a or $b has been misused have been improved to generate fewer
false positives.  Lexical $a and $b are no longer disallowed if they are
outside the sort block.  Also, a named unary or list operator inside the
sort block no longer causes the $a or $b to be ignored [perl #86136].

=back

=head1 Configuration and Compilation

=over 4

=item *

Building perl with some Windows compilers used to fail due to a problem
with miniperl's C<glob> operator (which uses the C<perlglob> program)
deleting the PATH environment variable [perl #113798].

=back

=head1 Platform Support

=head2 Platform-Specific Notes

=over 4

=item VMS

Quotes are now removed from the command verb (but not the parameters) for commands
spawned via C<system>, backticks, or a piped C<open>.  Previously, quotes on the verb 
were passed through to DCL, which would fail to recognize the command.  Also, if the
verb is actually a path to an image or command procedure on an ODS-5 volume, quoting it
now allows the path to contain spaces.

=item AIX

Configure now always adds C<-qlanglvl=extc99> to the CC flags on AIX when
using xlC.  This will make it easier to compile a number of XS-based modules
that assume C99 [perl #113778].

=back

=head1 Internal Changes

=over 4

=item *

Perl used to implement get magic in a way that would sometimes hide bugs in
code could call mg_get() too many times on magical values.  This hiding of
errors no longer occurs, so long-standing bugs may become visible now.  If
you see magic-related errors in XS code, check to make sure it, together
with the Perl API functions it uses, calls mg_get() only once on SvGMAGICAL()
values.

=item *

OP allocation for CVs now uses a slab allocator.  This simplifies
memory management for OPs allocated to a CV, so cleaning up after a
compilation error is simpler and safer [perl #111462][perl #112312].

=item *

PERL_DEBUG_READONLY_OPS has been rewritten to work with the new slab
allocator, allowing it to catch more violations than before.

=item *

The old slab allocator for ops, which was only enabled for PERL_IMPLICIT_SYS and PERL_DEBUG_READONLY_OPS, has been retired.

=back

=head1 Selected Bug Fixes

=over 4

=item *

A regression introduced in v5.14.0 has been fixed, in which some calls
to the C<re> module would clobber C<$_> [perl #113750].

=item *

C<do FILE> now always either sets or clears C<$@>, even when the file can't be
read. This ensures that testing C<$@> first (as recommended by the
documentation) always returns the correct result.

=item *

The array iterator used for the C<each @array> construct is now correctly
reset when C<@array> is cleared (RT #75596). This happens for example when the
array is globally assigned to, as in C<@array = (...)>, but not when its
B<values> are assigned to. In terms of the XS API, it means that C<av_clear()>
will now reset the iterator.

This mirrors the behaviour of the hash iterator when the hash is cleared.

=item *

C<< $class->can >>, C<< $class->isa >>, and C<< $class->DOES >> now return
correct results, regardless of whether that package referred to by C<$class>
exists [perl #47113].

=item *

Arriving signals no longer clear C<$@> [perl #45173].

=item *

Allow C<my ()> declarations with an empty variable list [perl #113554].

=item *

During parsing, subs declared after errors no longer leave stubs
[perl #113712].

=item *

Closures containing no string evals no longer hang on to their containing
subroutines, allowing variables closed over by outer subroutines to be
freed when the outer sub is freed, even if the inner sub still exists
[perl #89544].

=item *

Duplication of in-memory filehandles by opening with a "<&=" or ">&=" mode
stopped working properly in 5.16.0.  It was causing the new handle to
reference a different scalar variable.  This has been fixed [perl #113764].

=item *

C<qr//> expressions no longer crash with custom regular expression engines
that do not set C<offs> at regular expression compilation time
[perl #112962].

=item *

C<delete local> no longer crashes with certain magical arrays and hashes
[perl #112966].

=item *

C<local> on elements of certain magical arrays and hashes used not to
arrange to have the element deleted on scope exit, even if the element did
not exist before C<local>.

=item *

C<scalar(write)> no longer returns multiple items [perl #73690].

=item *

String to floating point conversions no longer misparse certain strings under
C<use locale> [perl #109318].

=item *

C<@INC> filters that die no longer leak memory [perl #92252].

=item *

The implementations of overloaded operations are now called in the correct
context. This allows, among other things, being able to properly override
C<< <> >> [perl #47119].

=item *

Specifying only the C<fallback> key when calling C<use overload> now behaves
properly [perl #113010].

=item *

C<< sub foo { my $a = 0; while ($a) { ... } } >> and
C<< sub foo { while (0) { ... } } >> now return the same thing [perl #73618].

=item *

Fixed the debugger C<l> and C<M> commands, and other debugger
functionality which was broken in 5.17.0 [perl #113918].

=item *

String negation now behaves the same under C<use integer;> as it does
without [perl #113012].

=item *

C<chr> now returns the Unicode replacement character (U+FFFD) for -1,
regardless of the internal representation.  -1 used to wrap if the argument
was tied or a string internally.

=item *

Using a C<format> after its enclosing sub was freed could crash as of
perl 5.12.0, if the format referenced lexical variables from the outer sub.

=item *

Using a C<format> after its enclosing sub was undefined could crash as of
perl 5.10.0, if the format referenced lexical variables from the outer sub.

=item *

Using a C<format> defined inside a closures, which format references
lexical variables from outside, never really worked unless the C<write>
call was directly inside the closure.  In 5.10.0 it even started crashing.
Now the copy of that closure nearest the top of the call stack is used to
find those variables.

=item *

Formats that close over variables in special blocks no longer crash if a
stub exists with the same name as the special block before the special
block is compiled.

=item *

The parser no longer gets confused, treating C<eval foo ()> as a syntax
error if preceded by C<print;> [perl #16249].

=item *

The return value of C<syscall> is no longer truncated on 64-bit platforms
[perl #113980].

=item *

Constant folding no longer causes C<print 1 ? FOO : BAR> to print to the
FOO handle [perl #78064].

=item *

C<do subname> now calls the named subroutine and uses the file name it
returns, instead of opening a file named "subname".

=item *

Subroutines looked up by rv2cv check hooks (registered by XS modules) are
now taken into consideration when determining whether C<foo bar> should be
the sub call C<foo(bar)> or the method call C<< "bar"->foo >>.

=item *

C<CORE::foo::bar> is no longer treated specially, allowing global overrides
to be called directly via C<CORE::GLOBAL::uc(...)> [perl #113016].

=item *

Calling an undefined sub whose typeglob has been undefined now produces the
customary "Undefined subroutine called" error, instead of "Not a CODE
reference".

=item *

Two bugs involving @ISA have been fixed.  C<*ISA = *glob_without_array> and
C<undef *ISA; @{*ISA}> would prevent future modifications to @ISA from
updating the internal caches used to look up methods.  The
*glob_without_array case was a regression from Perl 5.12.

=item *

Regular expression optimisations sometimes caused C<$> with C</m> to
produce failed or incorrect matches [perl #114068].

=item *

C<__SUB__> now works in a C<sort> block when the enclosing subroutine is
predeclared with C<sub foo;> syntax [perl #113710].

=item *

Unicode properties only apply to Unicode code points, which leads to
some subtleties when regular expressions are matched against
above-Unicode code points.  There is a warning generated to draw your
attention to this.  However, this warning was being generated
inappropriately in some cases, such as when a program was being parsed.
Non-Unicode matches such as C<\w> and C<[:word;]> should not generate the
warning, as their definitions don't limit them to apply to only Unicode
code points.  Now the message is only generated when matching against
C<\p{}> and C<\P{}>.  There remains a bug, [perl #114148], for the very
few properties in Unicode that match just a single code point.  The
warning is not generated if they are matched against an above-Unicode
code point.

=back

=head1 Acknowledgements

Perl 5.17.2 represents approximately 4 weeks of development since Perl 5.17.1
and contains approximately 15,000 lines of changes across 320 files from 34
authors.

Perl continues to flourish into its third decade thanks to a vibrant community
of users and developers. The following people are known to have contributed the
improvements that became Perl 5.17.2:

Aristotle Pagaltzis, Brian Fraser, Chip Salzenberg, Chris 'BinGOs' Williams,
Colin Kuskie, Craig A. Berry, Daniel Dragan, Daniel Perrett, Darin McBride,
David Golden, David Mitchell, Dominic Hargreaves, E. Choroba, Eric Brine,
Father Chrysostomos, François Perrad, H.Merijn Brand, Jan Dubois, Jesse
Luehrs, Karl Williamson, Lukas Mai, Matthew Horsfall, Nicholas Clark, Oleg
Nesterov, Reini Urban, Ricardo Signes, Robin Barker, Shirakata Kentaro, Shlomi
Fish, Steve Hay, Tony Cook, Vincent Pit, Walt Mankowski, Yves Orton.

The list above is almost certainly incomplete as it is automatically generated
from version control history. In particular, it does not include the names of
the (very much appreciated) contributors who reported issues to the Perl bug
tracker.

Many of the changes included in this version originated in the CPAN modules
included in Perl's core. We're grateful to the entire CPAN community for
helping Perl to flourish.

For a more complete list of all of Perl's historical contributors, please see
the F<AUTHORS> file in the Perl source distribution.

=head1 Reporting Bugs

If you find what you think is a bug, you might check the articles
recently posted to the comp.lang.perl.misc newsgroup and the perl
bug database at http://rt.perl.org/perlbug/ .  There may also be
information at http://www.perl.org/ , the Perl Home Page.

If you believe you have an unreported bug, please run the L<perlbug>
program included with your release.  Be sure to trim your bug down
to a tiny but sufficient test case.  Your bug report, along with the
output of C<perl -V>, will be sent off to perlbug@perl.org to be
analysed by the Perl porting team.

If the bug you are reporting has security implications, which make it
inappropriate to send to a publicly archived mailing list, then please send
it to perl5-security-report@perl.org. This points to a closed subscription
unarchived mailing list, which includes
all the core committers, who will be able
to help assess the impact of issues, figure out a resolution, and help
co-ordinate the release of patches to mitigate or fix the problem across all
platforms on which Perl is supported. Please only use this address for
security issues in the Perl core, not for modules independently
distributed on CPAN.

=head1 SEE ALSO

The F<Changes> file for an explanation of how to view exhaustive details
on what changed.

The F<INSTALL> file for how to build Perl.

The F<README> file for general stuff.

The F<Artistic> and F<Copying> files for copyright information.

=cut