-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathperl5220delta.html
2602 lines (1614 loc) · 170 KB
/
perl5220delta.html
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
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>perl5220delta - what is new for perl v5.22.0</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:[email protected]" />
</head>
<body>
<ul id="index">
<li><a href="#NAME">NAME</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
<li><a href="#Core-Enhancements">Core Enhancements</a>
<ul>
<li><a href="#New-bitwise-operators">New bitwise operators</a></li>
<li><a href="#New-double-diamond-operator">New double-diamond operator</a></li>
<li><a href="#New-b-boundaries-in-regular-expressions">New \b boundaries in regular expressions</a>
<ul>
<li><a href="#qr-b-gcb">qr/\b{gcb}/</a></li>
<li><a href="#qr-b-wb">qr/\b{wb}/</a></li>
<li><a href="#qr-b-sb">qr/\b{sb}/</a></li>
</ul>
</li>
<li><a href="#Non-Capturing-Regular-Expression-Flag">Non-Capturing Regular Expression Flag</a></li>
<li><a href="#use-re-strict">use re 'strict'</a></li>
<li><a href="#Unicode-7.0-with-correction-is-now-supported">Unicode 7.0 (with correction) is now supported</a></li>
<li><a href="#use-locale-can-restrict-which-locale-categories-are-affected">use locale can restrict which locale categories are affected</a></li>
<li><a href="#Perl-now-supports-POSIX-2008-locale-currency-additions">Perl now supports POSIX 2008 locale currency additions</a></li>
<li><a href="#Better-heuristics-on-older-platforms-for-determining-locale-UTF-8ness">Better heuristics on older platforms for determining locale UTF-8ness</a></li>
<li><a href="#Aliasing-via-reference">Aliasing via reference</a></li>
<li><a href="#prototype-with-no-arguments">prototype with no arguments</a></li>
<li><a href="#New-:const-subroutine-attribute">New :const subroutine attribute</a></li>
<li><a href="#fileno-now-works-on-directory-handles">fileno now works on directory handles</a></li>
<li><a href="#List-form-of-pipe-open-implemented-for-Win32">List form of pipe open implemented for Win32</a></li>
<li><a href="#Assignment-to-list-repetition">Assignment to list repetition</a></li>
<li><a href="#Infinity-and-NaN-not-a-number-handling-improved">Infinity and NaN (not-a-number) handling improved</a></li>
<li><a href="#Floating-point-parsing-has-been-improved">Floating point parsing has been improved</a></li>
<li><a href="#Packing-infinity-or-not-a-number-into-a-character-is-now-fatal">Packing infinity or not-a-number into a character is now fatal</a></li>
<li><a href="#Experimental-C-Backtrace-API">Experimental C Backtrace API</a></li>
</ul>
</li>
<li><a href="#Security">Security</a>
<ul>
<li><a href="#Perl-is-now-compiled-with--fstack-protector-strong-if-available">Perl is now compiled with -fstack-protector-strong if available</a></li>
<li><a href="#The-Safe-module-could-allow-outside-packages-to-be-replaced">The Safe module could allow outside packages to be replaced</a></li>
<li><a href="#Perl-is-now-always-compiled-with--D_FORTIFY_SOURCE-2-if-available">Perl is now always compiled with -D_FORTIFY_SOURCE=2 if available</a></li>
</ul>
</li>
<li><a href="#Incompatible-Changes">Incompatible Changes</a>
<ul>
<li><a href="#Subroutine-signatures-moved-before-attributes">Subroutine signatures moved before attributes</a></li>
<li><a href="#and-prototypes-accepts-only-subs">& and \& prototypes accepts only subs</a></li>
<li><a href="#use-encoding-is-now-lexical">use encoding is now lexical</a></li>
<li><a href="#List-slices-returning-empty-lists">List slices returning empty lists</a></li>
<li><a href="#N-with-a-sequence-of-multiple-spaces-is-now-a-fatal-error">\N{} with a sequence of multiple spaces is now a fatal error</a></li>
<li><a href="#use-UNIVERSAL-...-is-now-a-fatal-error">use UNIVERSAL '...' is now a fatal error</a></li>
<li><a href="#In-double-quotish-cX-X-must-now-be-a-printable-ASCII-character">In double-quotish \cX, X must now be a printable ASCII character</a></li>
<li><a href="#Splitting-the-tokens-and-in-regular-expressions-is-now-a-fatal-compilation-error">Splitting the tokens (? and (* in regular expressions is now a fatal compilation error.</a></li>
<li><a href="#qr-foo-x-now-ignores-all-Unicode-pattern-white-space">qr/foo/x now ignores all Unicode pattern white space</a></li>
<li><a href="#Comment-lines-within-are-now-ended-only-by-a-n">Comment lines within (?[ ]) are now ended only by a \n</a></li>
<li><a href="#operators-now-follow-standard-Perl-precedence">(?[...]) operators now follow standard Perl precedence</a></li>
<li><a href="#Omitting-and-on-hash-and-array-names-is-no-longer-permitted">Omitting % and @ on hash and array names is no longer permitted</a></li>
<li><a href="#text-is-now-in-English-outside-the-scope-of-use-locale">"$!" text is now in English outside the scope of use locale</a></li>
<li><a href="#text-will-be-returned-in-UTF-8-when-appropriate">"$!" text will be returned in UTF-8 when appropriate</a></li>
<li><a href="#Support-for-PATTERN-without-explicit-operator-has-been-removed">Support for ?PATTERN? without explicit operator has been removed</a></li>
<li><a href="#defined-array-and-defined-hash-are-now-fatal-errors">defined(@array) and defined(%hash) are now fatal errors</a></li>
<li><a href="#Using-a-hash-or-an-array-as-a-reference-are-now-fatal-errors">Using a hash or an array as a reference are now fatal errors</a></li>
<li><a href="#Changes-to-the-prototype">Changes to the * prototype</a></li>
</ul>
</li>
<li><a href="#Deprecations">Deprecations</a>
<ul>
<li><a href="#Setting-ENCODING-to-anything-but-undef">Setting ${^ENCODING} to anything but undef</a></li>
<li><a href="#Use-of-non-graphic-characters-in-single-character-variable-names">Use of non-graphic characters in single-character variable names</a></li>
<li><a href="#Inlining-of-sub-var-with-observable-side-effects">Inlining of sub () { $var } with observable side-effects</a></li>
<li><a href="#Use-of-multiple-x-regexp-modifiers">Use of multiple /x regexp modifiers</a></li>
<li><a href="#Using-a-NO-BREAK-space-in-a-character-alias-for-N-...-is-now-deprecated">Using a NO-BREAK space in a character alias for \N{...} is now deprecated</a></li>
<li><a href="#A-literal-should-now-be-escaped-in-a-pattern">A literal "{" should now be escaped in a pattern</a></li>
<li><a href="#Making-all-warnings-fatal-is-discouraged">Making all warnings fatal is discouraged</a></li>
</ul>
</li>
<li><a href="#Performance-Enhancements">Performance Enhancements</a></li>
<li><a href="#Modules-and-Pragmata">Modules and Pragmata</a>
<ul>
<li><a href="#Updated-Modules-and-Pragmata">Updated Modules and Pragmata</a></li>
<li><a href="#Removed-Modules-and-Pragmata">Removed Modules and Pragmata</a></li>
</ul>
</li>
<li><a href="#Documentation">Documentation</a>
<ul>
<li><a href="#New-Documentation">New Documentation</a>
<ul>
<li><a href="#perlunicook">perlunicook</a></li>
</ul>
</li>
<li><a href="#Changes-to-Existing-Documentation">Changes to Existing Documentation</a>
<ul>
<li><a href="#perlaix">perlaix</a></li>
<li><a href="#perlapi">perlapi</a></li>
<li><a href="#perldata">perldata</a></li>
<li><a href="#perlebcdic">perlebcdic</a></li>
<li><a href="#perlfilter">perlfilter</a></li>
<li><a href="#perlfunc">perlfunc</a></li>
<li><a href="#perlguts">perlguts</a></li>
<li><a href="#perlhack">perlhack</a></li>
<li><a href="#perlhacktips">perlhacktips</a></li>
<li><a href="#perlhpux">perlhpux</a></li>
<li><a href="#perllocale">perllocale</a></li>
<li><a href="#perlmodstyle">perlmodstyle</a></li>
<li><a href="#perlop">perlop</a></li>
<li><a href="#perlpodspec">perlpodspec</a></li>
<li><a href="#perlpolicy">perlpolicy</a></li>
<li><a href="#perlport">perlport</a></li>
<li><a href="#perlre">perlre</a></li>
<li><a href="#perlrebackslash">perlrebackslash</a></li>
<li><a href="#perlrecharclass">perlrecharclass</a></li>
<li><a href="#perlref">perlref</a></li>
<li><a href="#perlsec">perlsec</a></li>
<li><a href="#perlsyn">perlsyn</a></li>
<li><a href="#perlunicode">perlunicode</a></li>
<li><a href="#perluniintro">perluniintro</a></li>
<li><a href="#perlvar">perlvar</a></li>
<li><a href="#perlvms">perlvms</a></li>
<li><a href="#perlxs">perlxs</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#Diagnostics">Diagnostics</a>
<ul>
<li><a href="#New-Diagnostics">New Diagnostics</a>
<ul>
<li><a href="#New-Errors">New Errors</a></li>
<li><a href="#New-Warnings">New Warnings</a></li>
</ul>
</li>
<li><a href="#Changes-to-Existing-Diagnostics">Changes to Existing Diagnostics</a></li>
<li><a href="#Diagnostic-Removals">Diagnostic Removals</a></li>
</ul>
</li>
<li><a href="#Utility-Changes">Utility Changes</a>
<ul>
<li><a href="#find2perl-s2p-and-a2p-removal">find2perl, s2p and a2p removal</a></li>
<li><a href="#h2ph">h2ph</a></li>
<li><a href="#encguess">encguess</a></li>
</ul>
</li>
<li><a href="#Configuration-and-Compilation">Configuration and Compilation</a></li>
<li><a href="#Testing">Testing</a></li>
<li><a href="#Platform-Support">Platform Support</a>
<ul>
<li><a href="#Regained-Platforms">Regained Platforms</a></li>
<li><a href="#Discontinued-Platforms">Discontinued Platforms</a></li>
<li><a href="#Platform-Specific-Notes">Platform-Specific Notes</a></li>
</ul>
</li>
<li><a href="#Internal-Changes">Internal Changes</a></li>
<li><a href="#Selected-Bug-Fixes">Selected Bug Fixes</a></li>
<li><a href="#Known-Problems">Known Problems</a></li>
<li><a href="#Obituary">Obituary</a></li>
<li><a href="#Acknowledgements">Acknowledgements</a></li>
<li><a href="#Reporting-Bugs">Reporting Bugs</a></li>
<li><a href="#SEE-ALSO">SEE ALSO</a></li>
</ul>
<h1 id="NAME">NAME</h1>
<p>perl5220delta - what is new for perl v5.22.0</p>
<h1 id="DESCRIPTION">DESCRIPTION</h1>
<p>This document describes differences between the 5.20.0 release and the 5.22.0 release.</p>
<p>If you are upgrading from an earlier release such as 5.18.0, first read <a href="/cperl/perl5200delta.html">perl5200delta</a>, which describes differences between 5.18.0 and 5.20.0.</p>
<h1 id="Core-Enhancements">Core Enhancements</h1>
<h2 id="New-bitwise-operators">New bitwise operators</h2>
<p>A new experimental facility has been added that makes the four standard bitwise operators (<code>& | ^ ~</code>) treat their operands consistently as numbers, and introduces four new dotted operators (<code>&. |. ^. ~.</code>) that treat their operands consistently as strings. The same applies to the assignment variants (<code>&= |= ^= &.= |.= ^.=</code>).</p>
<p>To use this, enable the "bitwise" feature and disable the "experimental::bitwise" warnings category. See <a href="/cperl/perlop.html#Bitwise-String-Operators">"Bitwise String Operators" in perlop</a> for details. <a href="https://rt.perl.org/Ticket/Display.html?id=123466">[perl #123466]</a>.</p>
<h2 id="New-double-diamond-operator">New double-diamond operator</h2>
<p><code><<>></code> is like <code><></code> but uses three-argument <code>open</code> to open each file in <code>@ARGV</code>. This means that each element of <code>@ARGV</code> will be treated as an actual file name, and <code>"|foo"</code> won't be treated as a pipe open.</p>
<h2 id="New-b-boundaries-in-regular-expressions">New <code>\b</code> boundaries in regular expressions</h2>
<h3 id="qr-b-gcb"><code>qr/\b{gcb}/</code></h3>
<p><code>gcb</code> stands for Grapheme Cluster Boundary. It is a Unicode property that finds the boundary between sequences of characters that look like a single character to a native speaker of a language. Perl has long had the ability to deal with these through the <code>\X</code> regular escape sequence. Now, there is an alternative way of handling these. See <a href="/cperl/perlrebackslash.html#b-b-B-B">"\b{}, \b, \B{}, \B" in perlrebackslash</a> for details.</p>
<h3 id="qr-b-wb"><code>qr/\b{wb}/</code></h3>
<p><code>wb</code> stands for Word Boundary. It is a Unicode property that finds the boundary between words. This is similar to the plain <code>\b</code> (without braces) but is more suitable for natural language processing. It knows, for example, that apostrophes can occur in the middle of words. See <a href="/cperl/perlrebackslash.html#b-b-B-B">"\b{}, \b, \B{}, \B" in perlrebackslash</a> for details.</p>
<h3 id="qr-b-sb"><code>qr/\b{sb}/</code></h3>
<p><code>sb</code> stands for Sentence Boundary. It is a Unicode property to aid in parsing natural language sentences. See <a href="/cperl/perlrebackslash.html#b-b-B-B">"\b{}, \b, \B{}, \B" in perlrebackslash</a> for details.</p>
<h2 id="Non-Capturing-Regular-Expression-Flag">Non-Capturing Regular Expression Flag</h2>
<p>Regular expressions now support a <code>/n</code> flag that disables capturing and filling in <code>$1</code>, <code>$2</code>, etc inside of groups:</p>
<pre><code> "hello" =~ /(hi|hello)/n; # $1 is not set</code></pre>
<p>This is equivalent to putting <code>?:</code> at the beginning of every capturing group.</p>
<p>See <a href="/cperl/perlre.html#n">"n" in perlre</a> for more information.</p>
<h2 id="use-re-strict"><code>use re 'strict'</code></h2>
<p>This applies stricter syntax rules to regular expression patterns compiled within its scope. This will hopefully alert you to typos and other unintentional behavior that backwards-compatibility issues prevent us from reporting in normal regular expression compilations. Because the behavior of this is subject to change in future Perl releases as we gain experience, using this pragma will raise a warning of category <code>experimental::re_strict</code>. See <a href="/cperl/lib/re.html#strict-mode">'strict' in re</a>.</p>
<h2 id="Unicode-7.0-with-correction-is-now-supported">Unicode 7.0 (with correction) is now supported</h2>
<p>For details on what is in this release, see <a href="http://www.unicode.org/versions/Unicode7.0.0/">http://www.unicode.org/versions/Unicode7.0.0/</a>. The version of Unicode 7.0 that comes with Perl includes a correction dealing with glyph shaping in Arabic (see <a href="http://www.unicode.org/errata/#current_errata">http://www.unicode.org/errata/#current_errata</a>).</p>
<h2 id="use-locale-can-restrict-which-locale-categories-are-affected"><span style="white-space: nowrap;"><code>use locale</code></span> can restrict which locale categories are affected</h2>
<p>It is now possible to pass a parameter to <span style="white-space: nowrap;"><code>use locale</code></span> to specify a subset of locale categories to be locale-aware, with the remaining ones unaffected. See <a href="/cperl/perllocale.html#The-use-locale-pragma">"The "use locale" pragma" in perllocale</a> for details.</p>
<h2 id="Perl-now-supports-POSIX-2008-locale-currency-additions">Perl now supports POSIX 2008 locale currency additions</h2>
<p>On platforms that are able to handle POSIX.1-2008, the hash returned by <a href="/cperl/perllocale.html#The-localeconv-function"><code>POSIX::localeconv()</code></a> includes the international currency fields added by that version of the POSIX standard. These are <code>int_n_cs_precedes</code>, <code>int_n_sep_by_space</code>, <code>int_n_sign_posn</code>, <code>int_p_cs_precedes</code>, <code>int_p_sep_by_space</code>, and <code>int_p_sign_posn</code>.</p>
<h2 id="Better-heuristics-on-older-platforms-for-determining-locale-UTF-8ness">Better heuristics on older platforms for determining locale UTF-8ness</h2>
<p>On platforms that implement neither the C99 standard nor the POSIX 2001 standard, determining if the current locale is UTF-8 or not depends on heuristics. These are improved in this release.</p>
<h2 id="Aliasing-via-reference">Aliasing via reference</h2>
<p>Variables and subroutines can now be aliased by assigning to a reference:</p>
<pre><code> \$c = \$d;
\&x = \&y;</code></pre>
<p>Aliasing can also be accomplished by using a backslash before a <code>foreach</code> iterator variable; this is perhaps the most useful idiom this feature provides:</p>
<pre><code> foreach \%hash (@array_of_hash_refs) { ... }</code></pre>
<p>This feature is experimental and must be enabled via <span style="white-space: nowrap;"><code>use feature 'refaliasing'</code></span>. It will warn unless the <code>experimental::refaliasing</code> warnings category is disabled.</p>
<p>See <a href="/cperl/perlref.html#Assigning-to-References">"Assigning to References" in perlref</a></p>
<h2 id="prototype-with-no-arguments"><code>prototype</code> with no arguments</h2>
<p><code>prototype()</code> with no arguments now infers <code>$_</code>. <a href="https://rt.perl.org/Ticket/Display.html?id=123514">[perl #123514]</a>.</p>
<h2 id="New-:const-subroutine-attribute">New <code>:const</code> subroutine attribute</h2>
<p>The <code>const</code> attribute can be applied to an anonymous subroutine. It causes the new sub to be executed immediately whenever one is created (<i>i.e.</i> when the <code>sub</code> expression is evaluated). Its value is captured and used to create a new constant subroutine that is returned. This feature is experimental. See <a href="/cperl/perlsub.html#Constant-Functions">"Constant Functions" in perlsub</a>.</p>
<h2 id="fileno-now-works-on-directory-handles"><code>fileno</code> now works on directory handles</h2>
<p>When the relevant support is available in the operating system, the <code>fileno</code> builtin now works on directory handles, yielding the underlying file descriptor in the same way as for filehandles. On operating systems without such support, <code>fileno</code> on a directory handle continues to return the undefined value, as before, but also sets <code>$!</code> to indicate that the operation is not supported.</p>
<p>Currently, this uses either a <code>dd_fd</code> member in the OS <code>DIR</code> structure, or a <code>dirfd(3)</code> function as specified by POSIX.1-2008.</p>
<h2 id="List-form-of-pipe-open-implemented-for-Win32">List form of pipe open implemented for Win32</h2>
<p>The list form of pipe:</p>
<pre><code> open my $fh, "-|", "program", @arguments;</code></pre>
<p>is now implemented on Win32. It has the same limitations as <code>system LIST</code> on Win32, since the Win32 API doesn't accept program arguments as a list.</p>
<h2 id="Assignment-to-list-repetition">Assignment to list repetition</h2>
<p><code>(...) x ...</code> can now be used within a list that is assigned to, as long as the left-hand side is a valid lvalue. This allows <span style="white-space: nowrap;"><code>(undef,undef,$foo) = that_function()</code></span> to be written as <span style="white-space: nowrap;"><code>((undef)x2, $foo) = that_function()</code></span>.</p>
<h2 id="Infinity-and-NaN-not-a-number-handling-improved">Infinity and NaN (not-a-number) handling improved</h2>
<p>Floating point values are able to hold the special values infinity, negative infinity, and NaN (not-a-number). Now we more robustly recognize and propagate the value in computations, and on output normalize them to the strings <code>Inf</code>, <code>-Inf</code>, and <code>NaN</code>.</p>
<p>See also the <a href="/cperl/lib/POSIX.html">POSIX</a> enhancements.</p>
<h2 id="Floating-point-parsing-has-been-improved">Floating point parsing has been improved</h2>
<p>Parsing and printing of floating point values has been improved.</p>
<p>As a completely new feature, hexadecimal floating point literals (like <code>0x1.23p-4</code>) are now supported, and they can be output with <span style="white-space: nowrap;"><code>printf "%a"</code></span>. See <a href="/cperl/perldata.html#Scalar-value-constructors">"Scalar value constructors" in perldata</a> for more details.</p>
<h2 id="Packing-infinity-or-not-a-number-into-a-character-is-now-fatal">Packing infinity or not-a-number into a character is now fatal</h2>
<p>Before, when trying to pack infinity or not-a-number into a (signed) character, Perl would warn, and assumed you tried to pack <code>0xFF</code>; if you gave it as an argument to <code>chr</code>, <code>U+FFFD</code> was returned.</p>
<p>But now, all such actions (<code>pack</code>, <code>chr</code>, and <code>print '%c'</code>) result in a fatal error.</p>
<h2 id="Experimental-C-Backtrace-API">Experimental C Backtrace API</h2>
<p>Perl now supports (via a C level API) retrieving the C level backtrace (similar to what symbolic debuggers like gdb do).</p>
<p>The backtrace returns the stack trace of the C call frames, with the symbol names (function names), the object names (like "perl"), and if it can, also the source code locations (file:line).</p>
<p>The supported platforms are Linux and OS X (some *BSD might work at least partly, but they have not yet been tested).</p>
<p>The feature needs to be enabled with <code>Configure -Dusecbacktrace</code>.</p>
<p>See <a href="/cperl/perlhacktips.html#C-backtrace">"C backtrace" in perlhacktips</a> for more information.</p>
<h1 id="Security">Security</h1>
<h2 id="Perl-is-now-compiled-with--fstack-protector-strong-if-available">Perl is now compiled with <code>-fstack-protector-strong</code> if available</h2>
<p>Perl has been compiled with the anti-stack-smashing option <code>-fstack-protector</code> since 5.10.1. Now Perl uses the newer variant called <code>-fstack-protector-strong</code>, if available.</p>
<h2 id="The-Safe-module-could-allow-outside-packages-to-be-replaced">The <a href="/cperl/lib/Safe.html">Safe</a> module could allow outside packages to be replaced</h2>
<p>Critical bugfix: outside packages could be replaced. <a href="/cperl/lib/Safe.html">Safe</a> has been patched to 2.38 to address this.</p>
<h2 id="Perl-is-now-always-compiled-with--D_FORTIFY_SOURCE-2-if-available">Perl is now always compiled with <code>-D_FORTIFY_SOURCE=2</code> if available</h2>
<p>The 'code hardening' option called <code>_FORTIFY_SOURCE</code>, available in gcc 4.*, is now always used for compiling Perl, if available.</p>
<p>Note that this isn't necessarily a huge step since in many platforms the step had already been taken several years ago: many Linux distributions (like Fedora) have been using this option for Perl, and OS X has enforced the same for many years.</p>
<h1 id="Incompatible-Changes">Incompatible Changes</h1>
<h2 id="Subroutine-signatures-moved-before-attributes">Subroutine signatures moved before attributes</h2>
<p>The experimental sub signatures feature, as introduced in 5.20, parsed signatures after attributes. In this release, following feedback from users of the experimental feature, the positioning has been moved such that signatures occur after the subroutine name (if any) and before the attribute list (if any).</p>
<h2 id="and-prototypes-accepts-only-subs"><code>&</code> and <code>\&</code> prototypes accepts only subs</h2>
<p>The <code>&</code> prototype character now accepts only anonymous subs (<code>sub {...}</code>), things beginning with <code>\&</code>, or an explicit <code>undef</code>. Formerly it erroneously also allowed references to arrays, hashes, and lists. <a href="https://rt.perl.org/Ticket/Display.html?id=4539">[perl #4539]</a>. <a href="https://rt.perl.org/Ticket/Display.html?id=123062">[perl #123062]</a>. <a href="https://rt.perl.org/Ticket/Display.html?id=123475">[perl #123062]</a>.</p>
<p>In addition, the <code>\&</code> prototype was allowing subroutine calls, whereas now it only allows subroutines: <code>&foo</code> is still permitted as an argument, while <code>&foo()</code> and <code>foo()</code> no longer are. <a href="https://rt.perl.org/Ticket/Display.html?id=77860">[perl #77860]</a>.</p>
<h2 id="use-encoding-is-now-lexical"><code>use encoding</code> is now lexical</h2>
<p>The <a href="/cperl/lib/encoding.html">encoding</a> pragma's effect is now limited to lexical scope. This pragma is deprecated, but in the meantime, it could adversely affect unrelated modules that are included in the same program; this change fixes that.</p>
<h2 id="List-slices-returning-empty-lists">List slices returning empty lists</h2>
<p>List slices now return an empty list only if the original list was empty (or if there are no indices). Formerly, a list slice would return an empty list if all indices fell outside the original list; now it returns a list of <code>undef</code> values in that case. <a href="https://rt.perl.org/Ticket/Display.html?id=114498">[perl #114498]</a>.</p>
<h2 id="N-with-a-sequence-of-multiple-spaces-is-now-a-fatal-error"><code>\N{}</code> with a sequence of multiple spaces is now a fatal error</h2>
<p>E.g. <span style="white-space: nowrap;"><code>\N{TOO MANY SPACES}</code></span> or <span style="white-space: nowrap;"><code>\N{TRAILING SPACE }</code></span>. This has been deprecated since v5.18.</p>
<h2 id="use-UNIVERSAL-...-is-now-a-fatal-error"><span style="white-space: nowrap;"><code>use UNIVERSAL '...'</code></span> is now a fatal error</h2>
<p>Importing functions from <code>UNIVERSAL</code> has been deprecated since v5.12, and is now a fatal error. <span style="white-space: nowrap;"><code>use UNIVERSAL</code></span> without any arguments is still allowed.</p>
<h2 id="In-double-quotish-cX-X-must-now-be-a-printable-ASCII-character">In double-quotish <code>\c<i>X</i></code>, <i>X</i> must now be a printable ASCII character</h2>
<p>In prior releases, failure to do this raised a deprecation warning.</p>
<h2 id="Splitting-the-tokens-and-in-regular-expressions-is-now-a-fatal-compilation-error">Splitting the tokens <code>(?</code> and <code>(*</code> in regular expressions is now a fatal compilation error.</h2>
<p>These had been deprecated since v5.18.</p>
<h2 id="qr-foo-x-now-ignores-all-Unicode-pattern-white-space"><code>qr/foo/x</code> now ignores all Unicode pattern white space</h2>
<p>The <code>/x</code> regular expression modifier allows the pattern to contain white space and comments (both of which are ignored) for improved readability. Until now, not all the white space characters that Unicode designates for this purpose were handled. The additional ones now recognized are:</p>
<pre><code> U+0085 NEXT LINE
U+200E LEFT-TO-RIGHT MARK
U+200F RIGHT-TO-LEFT MARK
U+2028 LINE SEPARATOR
U+2029 PARAGRAPH SEPARATOR</code></pre>
<p>The use of these characters with <code>/x</code> outside bracketed character classes and when not preceded by a backslash has raised a deprecation warning since v5.18. Now they will be ignored.</p>
<h2 id="Comment-lines-within-are-now-ended-only-by-a-n">Comment lines within <span style="white-space: nowrap;"><code>(?[ ])</code></span> are now ended only by a <code>\n</code></h2>
<p><span style="white-space: nowrap;"><code>(?[ ])</code></span> is an experimental feature, introduced in v5.18. It operates as if <code>/x</code> is always enabled. But there was a difference: comment lines (following a <code>#</code> character) were terminated by anything matching <code>\R</code> which includes all vertical whitespace, such as form feeds. For consistency, this is now changed to match what terminates comment lines outside <span style="white-space: nowrap;"><code>(?[ ])</code></span>, namely a <code>\n</code> (even if escaped), which is the same as what terminates a heredoc string and formats.</p>
<h2 id="operators-now-follow-standard-Perl-precedence"><code>(?[...])</code> operators now follow standard Perl precedence</h2>
<p>This experimental feature allows set operations in regular expression patterns. Prior to this, the intersection operator had the same precedence as the other binary operators. Now it has higher precedence. This could lead to different outcomes than existing code expects (though the documentation has always noted that this change might happen, recommending fully parenthesizing the expressions). See <a href="/cperl/perlrecharclass.html#Extended-Bracketed-Character-Classes">"Extended Bracketed Character Classes" in perlrecharclass</a>.</p>
<h2 id="Omitting-and-on-hash-and-array-names-is-no-longer-permitted">Omitting <code>%</code> and <code>@</code> on hash and array names is no longer permitted</h2>
<p>Really old Perl let you omit the <code>@</code> on array names and the <code>%</code> on hash names in some spots. This has issued a deprecation warning since Perl 5.000, and is no longer permitted.</p>
<h2 id="text-is-now-in-English-outside-the-scope-of-use-locale"><code>"$!"</code> text is now in English outside the scope of <code>use locale</code></h2>
<p>Previously, the text, unlike almost everything else, always came out based on the current underlying locale of the program. (Also affected on some systems is <code>"$^E"</code>.) For programs that are unprepared to handle locale differences, this can cause garbage text to be displayed. It's better to display text that is translatable via some tool than garbage text which is much harder to figure out.</p>
<h2 id="text-will-be-returned-in-UTF-8-when-appropriate"><code>"$!"</code> text will be returned in UTF-8 when appropriate</h2>
<p>The stringification of <code>$!</code> and <code>$^E</code> will have the UTF-8 flag set when the text is actually non-ASCII UTF-8. This will enable programs that are set up to be locale-aware to properly output messages in the user's native language. Code that needs to continue the 5.20 and earlier behavior can do the stringification within the scopes of both <span style="white-space: nowrap;"><code>use bytes</code></span> and <span style="white-space: nowrap;"><code>use locale ":messages"</code></span>. Within these two scopes, no other Perl operations will be affected by locale; only <code>$!</code> and <code>$^E</code> stringification. The <code>bytes</code> pragma causes the UTF-8 flag to not be set, just as in previous Perl releases. This resolves <a href="https://rt.perl.org/Ticket/Display.html?id=112208">[perl #112208]</a>.</p>
<h2 id="Support-for-PATTERN-without-explicit-operator-has-been-removed">Support for <code>?PATTERN?</code> without explicit operator has been removed</h2>
<p>The <code>m?PATTERN?</code> construct, which allows matching a regex only once, previously had an alternative form that was written directly with a question mark delimiter, omitting the explicit <code>m</code> operator. This usage has produced a deprecation warning since 5.14.0. It is now a syntax error, so that the question mark can be available for use in new operators.</p>
<h2 id="defined-array-and-defined-hash-are-now-fatal-errors"><code>defined(@array)</code> and <code>defined(%hash)</code> are now fatal errors</h2>
<p>These have been deprecated since v5.6.1 and have raised deprecation warnings since v5.16.</p>
<h2 id="Using-a-hash-or-an-array-as-a-reference-are-now-fatal-errors">Using a hash or an array as a reference are now fatal errors</h2>
<p>For example, <code>%foo->{"bar"}</code> now causes a fatal compilation error. These have been deprecated since before v5.8, and have raised deprecation warnings since then.</p>
<h2 id="Changes-to-the-prototype">Changes to the <code>*</code> prototype</h2>
<p>The <code>*</code> character in a subroutine's prototype used to allow barewords to take precedence over most, but not all, subroutine names. It was never consistent and exhibited buggy behavior.</p>
<p>Now it has been changed, so subroutines always take precedence over barewords, which brings it into conformity with similarly prototyped built-in functions:</p>
<pre><code> sub splat(*) { ... }
sub foo { ... }
splat(foo); # now always splat(foo())
splat(bar); # still splat('bar') as before
close(foo); # close(foo())
close(bar); # close('bar')</code></pre>
<h1 id="Deprecations">Deprecations</h1>
<h2 id="Setting-ENCODING-to-anything-but-undef">Setting <code>${^ENCODING}</code> to anything but <code>undef</code></h2>
<p>This variable allows Perl scripts to be written in an encoding other than ASCII or UTF-8. However, it affects all modules globally, leading to wrong answers and segmentation faults. New scripts should be written in UTF-8; old scripts should be converted to UTF-8, which is easily done with the <a>piconv</a> utility.</p>
<h2 id="Use-of-non-graphic-characters-in-single-character-variable-names">Use of non-graphic characters in single-character variable names</h2>
<p>The syntax for single-character variable names is more lenient than for longer variable names, allowing the one-character name to be a punctuation character or even invisible (a non-graphic). Perl v5.20 deprecated the ASCII-range controls as such a name. Now, all non-graphic characters that formerly were allowed are deprecated. The practical effect of this occurs only when not under <code><span style="white-space: nowrap;">use utf8</span></code>, and affects just the C1 controls (code points 0x80 through 0xFF), NO-BREAK SPACE, and SOFT HYPHEN.</p>
<h2 id="Inlining-of-sub-var-with-observable-side-effects">Inlining of <code>sub () { $var }</code> with observable side-effects</h2>
<p>In many cases Perl makes <span style="white-space: nowrap;"><code>sub () { $var }</code></span> into an inlinable constant subroutine, capturing the value of <code>$var</code> at the time the <code>sub</code> expression is evaluated. This can break the closure behavior in those cases where <code>$var</code> is subsequently modified, since the subroutine won't return the changed value. (Note that this all only applies to anonymous subroutines with an empty prototype (<span style="white-space: nowrap;"><code>sub ()</code></span>).)</p>
<p>This usage is now deprecated in those cases where the variable could be modified elsewhere. Perl detects those cases and emits a deprecation warning. Such code will likely change in the future and stop producing a constant.</p>
<p>If your variable is only modified in the place where it is declared, then Perl will continue to make the sub inlinable with no warnings.</p>
<pre><code> sub make_constant {
my $var = shift;
return sub () { $var }; # fine
}
sub make_constant_deprecated {
my $var;
$var = shift;
return sub () { $var }; # deprecated
}
sub make_constant_deprecated2 {
my $var = shift;
log_that_value($var); # could modify $var
return sub () { $var }; # deprecated
}</code></pre>
<p>In the second example above, detecting that <code>$var</code> is assigned to only once is too hard to detect. That it happens in a spot other than the <code>my</code> declaration is enough for Perl to find it suspicious.</p>
<p>This deprecation warning happens only for a simple variable for the body of the sub. (A <code>BEGIN</code> block or <code>use</code> statement inside the sub is ignored, because it does not become part of the sub's body.) For more complex cases, such as <span style="white-space: nowrap;"><code>sub () { do_something() if 0; $var }</code></span> the behavior has changed such that inlining does not happen if the variable is modifiable elsewhere. Such cases should be rare.</p>
<h2 id="Use-of-multiple-x-regexp-modifiers">Use of multiple <code>/x</code> regexp modifiers</h2>
<p>It is now deprecated to say something like any of the following:</p>
<pre><code> qr/foo/xx;
/(?xax:foo)/;
use re qw(/amxx);</code></pre>
<p>That is, now <code>x</code> should only occur once in any string of contiguous regular expression pattern modifiers. We do not believe there are any occurrences of this in all of CPAN. This is in preparation for a future Perl release having <code>/xx</code> permit white-space for readability in bracketed character classes (those enclosed in square brackets: <code>[...]</code>).</p>
<h2 id="Using-a-NO-BREAK-space-in-a-character-alias-for-N-...-is-now-deprecated">Using a NO-BREAK space in a character alias for <code>\N{...}</code> is now deprecated</h2>
<p>This non-graphic character is essentially indistinguishable from a regular space, and so should not be allowed. See <a href="/cperl/lib/charnames.html#CUSTOM-ALIASES">"CUSTOM ALIASES" in charnames</a>.</p>
<h2 id="A-literal-should-now-be-escaped-in-a-pattern">A literal <code>"{"</code> should now be escaped in a pattern</h2>
<p>If you want a literal left curly bracket (also called a left brace) in a regular expression pattern, you should now escape it by either preceding it with a backslash (<code>"\{"</code>) or enclosing it within square brackets <code>"[{]"</code>, or by using <code>\Q</code>; otherwise a deprecation warning will be raised. This was first announced as forthcoming in the v5.16 release; it will allow future extensions to the language to happen.</p>
<h2 id="Making-all-warnings-fatal-is-discouraged">Making all warnings fatal is discouraged</h2>
<p>The documentation for <a href="/cperl/lib/warnings.html#Fatal-Warnings">fatal warnings</a> notes that <code>use warnings FATAL => 'all'</code> is discouraged, and provides stronger language about the risks of fatal warnings in general.</p>
<h1 id="Performance-Enhancements">Performance Enhancements</h1>
<ul>
<li><p>If a method or class name is known at compile time, a hash is precomputed to speed up run-time method lookup. Also, compound method names like <code>SUPER::new</code> are parsed at compile time, to save having to parse them at run time.</p>
</li>
<li><p>Array and hash lookups (especially nested ones) that use only constants or simple variables as keys, are now considerably faster. See <a href="#Internal-Changes">"Internal Changes"</a> for more details.</p>
</li>
<li><p><code>(...)x1</code>, <code>("constant")x0</code> and <code>($scalar)x0</code> are now optimised in list context. If the right-hand argument is a constant 1, the repetition operator disappears. If the right-hand argument is a constant 0, the whole expression is optimised to the empty list, so long as the left-hand argument is a simple scalar or constant. (That is, <code>(foo())x0</code> is not subject to this optimisation.)</p>
</li>
<li><p><code>substr</code> assignment is now optimised into 4-argument <code>substr</code> at the end of a subroutine (or as the argument to <code>return</code>). Previously, this optimisation only happened in void context.</p>
</li>
<li><p>In <code>"\L..."</code>, <code>"\Q..."</code>, etc., the extra "stringify" op is now optimised away, making these just as fast as <code>lcfirst</code>, <code>quotemeta</code>, etc.</p>
</li>
<li><p>Assignment to an empty list is now sometimes faster. In particular, it never calls <code>FETCH</code> on tied arguments on the right-hand side, whereas it used to sometimes.</p>
</li>
<li><p>There is a performance improvement of up to 20% when <code>length</code> is applied to a non-magical, non-tied string, and either <code>use bytes</code> is in scope or the string doesn't use UTF-8 internally.</p>
</li>
<li><p>On most perl builds with 64-bit integers, memory usage for non-magical, non-tied scalars containing only a floating point value has been reduced by between 8 and 32 bytes, depending on OS.</p>
</li>
<li><p>In <code>@array = split</code>, the assignment can be optimized away, so that <code>split</code> writes directly to the array. This optimisation was happening only for package arrays other than <code>@_</code>, and only sometimes. Now this optimisation happens almost all the time.</p>
</li>
<li><p><code>join</code> is now subject to constant folding. So for example <span style="white-space: nowrap;"><code>join "-", "a", "b"</code></span> is converted at compile-time to <code>"a-b"</code>. Moreover, <code>join</code> with a scalar or constant for the separator and a single-item list to join is simplified to a stringification, and the separator doesn't even get evaluated.</p>
</li>
<li><p><code>qq(@array)</code> is implemented using two ops: a stringify op and a join op. If the <code>qq</code> contains nothing but a single array, the stringification is optimized away.</p>
</li>
<li><p><span style="white-space: nowrap;"><code>our $var</code></span> and <span style="white-space: nowrap;"><code>our($s,@a,%h)</code></span> in void context are no longer evaluated at run time. Even a whole sequence of <span style="white-space: nowrap;"><code>our $foo;</code></span> statements will simply be skipped over. The same applies to <code>state</code> variables.</p>
</li>
<li><p>Many internal functions have been refactored to improve performance and reduce their memory footprints. <a href="https://rt.perl.org/Ticket/Display.html?id=121436">[perl #121436]</a> <a href="https://rt.perl.org/Ticket/Display.html?id=121906">[perl #121906]</a> <a href="https://rt.perl.org/Ticket/Display.html?id=121969">[perl #121969]</a></p>
</li>
<li><p><code>-T</code> and <code>-B</code> filetests will return sooner when an empty file is detected. <a href="https://rt.perl.org/Ticket/Display.html?id=121489">[perl #121489]</a></p>
</li>
<li><p>Hash lookups where the key is a constant are faster.</p>
</li>
<li><p>Subroutines with an empty prototype and a body containing just <code>undef</code> are now eligible for inlining. <a href="https://rt.perl.org/Ticket/Display.html?id=122728">[perl #122728]</a></p>
</li>
<li><p>Subroutines in packages no longer need to be stored in typeglobs: declaring a subroutine will now put a simple sub reference directly in the stash if possible, saving memory. The typeglob still notionally exists, so accessing it will cause the stash entry to be upgraded to a typeglob (<i>i.e.</i> this is just an internal implementation detail). This optimization does not currently apply to XSUBs or exported subroutines, and method calls will undo it, since they cache things in typeglobs. <a href="https://rt.perl.org/Ticket/Display.html?id=120441">[perl #120441]</a></p>
</li>
<li><p>The functions <code>utf8::native_to_unicode()</code> and <code>utf8::unicode_to_native()</code> (see <a href="/cperl/lib/utf8.html">utf8</a>) are now optimized out on ASCII platforms. There is now not even a minimal performance hit in writing code portable between ASCII and EBCDIC platforms.</p>
</li>
<li><p>Win32 Perl uses 8 KB less of per-process memory than before for every perl process, because some data is now memory mapped from disk and shared between processes from the same perl binary.</p>
</li>
</ul>
<h1 id="Modules-and-Pragmata">Modules and Pragmata</h1>
<h2 id="Updated-Modules-and-Pragmata">Updated Modules and Pragmata</h2>
<p>Many of the libraries distributed with perl have been upgraded since v5.20.0. For a complete list of changes, run:</p>
<pre><code> corelist --diff 5.20.0 5.22.0</code></pre>
<p>You can substitute your favorite version in place of 5.20.0, too.</p>
<p>Some notable changes include:</p>
<ul>
<li><p><a href="/cperl/lib/Archive/Tar.html">Archive::Tar</a> has been upgraded to version 2.04.</p>
<p>Tests can now be run in parallel.</p>
</li>
<li><p><a href="/cperl/lib/attributes.html">attributes</a> has been upgraded to version 0.27.</p>
<p>The usage of <code>memEQs</code> in the XS has been corrected. <a href="https://rt.perl.org/Ticket/Display.html?id=122701">[perl #122701]</a></p>
<p>Avoid reading beyond the end of a buffer. [perl #122629]</p>
</li>
<li><p><a href="/cperl/lib/B.html">B</a> has been upgraded to version 1.58.</p>
<p>It provides a new <code>B::safename</code> function, based on the existing <code>B::GV->SAFENAME</code>, that converts <code>\cOPEN</code> to <code>^OPEN</code>.</p>
<p>Nulled COPs are now of class <code>B::COP</code>, rather than <code>B::OP</code>.</p>
<p><code>B::REGEXP</code> objects now provide a <code>qr_anoncv</code> method for accessing the implicit CV associated with <code>qr//</code> things containing code blocks, and a <code>compflags</code> method that returns the pertinent flags originating from the <code>qr//blahblah</code> op.</p>
<p><code>B::PMOP</code> now provides a <code>pmregexp</code> method returning a <code>B::REGEXP</code> object. Two new classes, <code>B::PADNAME</code> and <code>B::PADNAMELIST</code>, have been introduced.</p>
<p>A bug where, after an ithread creation or psuedofork, special/immortal SVs in the child ithread/psuedoprocess did not have the correct class of <code>B::SPECIAL</code>, has been fixed. The <code>id</code> and <code>outid</code> PADLIST methods have been added.</p>
</li>
<li><p><a href="/cperl/lib/B/Concise.html">B::Concise</a> has been upgraded to version 0.996.</p>
<p>Null ops that are part of the execution chain are now given sequence numbers.</p>
<p>Private flags for nulled ops are now dumped with mnemonics as they would be for the non-nulled counterparts.</p>
</li>
<li><p><a href="/cperl/lib/B/Deparse.html">B::Deparse</a> has been upgraded to version 1.35.</p>
<p>It now deparses <code>+sub : attr { ... }</code> correctly at the start of a statement. Without the initial <code>+</code>, <code>sub</code> would be a statement label.</p>
<p><code>BEGIN</code> blocks are now emitted in the right place most of the time, but the change unfortunately introduced a regression, in that <code>BEGIN</code> blocks occurring just before the end of the enclosing block may appear below it instead.</p>
<p><code>B::Deparse</code> no longer puts erroneous <code>local</code> here and there, such as for <code>LIST = tr/a//d</code>. [perl #119815]</p>
<p>Adjacent <code>use</code> statements are no longer accidentally nested if one contains a <code>do</code> block. [perl #115066]</p>
<p>Parenthesised arrays in lists passed to <code>\</code> are now correctly deparsed with parentheses (<i>e.g.</i>, <code>\(@a, (@b), @c)</code> now retains the parentheses around @b), thus preserving the flattening behavior of referenced parenthesised arrays. Formerly, it only worked for one array: <code>\(@a)</code>.</p>
<p><code>local our</code> is now deparsed correctly, with the <code>our</code> included.</p>
<p><code>for($foo; !$bar; $baz) {...}</code> was deparsed without the <code>!</code> (or <code>not</code>). This has been fixed.</p>
<p>Core keywords that conflict with lexical subroutines are now deparsed with the <code>CORE::</code> prefix.</p>
<p><code>foreach state $x (...) {...}</code> now deparses correctly with <code>state</code> and not <code>my</code>.</p>
<p><code>our @array = split(...)</code> now deparses correctly with <code>our</code> in those cases where the assignment is optimized away.</p>
<p>It now deparses <code>our(<i>LIST</i>)</code> and typed lexical (<code>my Dog $spot</code>) correctly.</p>
<p>Deparse <code>$#_</code> as that instead of as <code>$#{_}</code>. <a href="https://rt.perl.org/Ticket/Display.html?id=123947">[perl #123947]</a></p>
<p>BEGIN blocks at the end of the enclosing scope are now deparsed in the right place. [perl #77452]</p>
<p>BEGIN blocks were sometimes deparsed as __ANON__, but are now always called BEGIN.</p>
<p>Lexical subroutines are now fully deparsed. [perl #116553]</p>
<p><code>Anything =~ y///r</code> with <code>/r</code> no longer omits the left-hand operand.</p>
<p>The op trees that make up regexp code blocks are now deparsed for real. Formerly, the original string that made up the regular expression was used. That caused problems with <code>qr/(?{<<heredoc})/</code> and multiline code blocks, which were deparsed incorrectly. [perl #123217] [perl #115256]</p>
<p><code>$;</code> at the end of a statement no longer loses its semicolon. [perl #123357]</p>
<p>Some cases of subroutine declarations stored in the stash in shorthand form were being omitted.</p>
<p>Non-ASCII characters are now consistently escaped in strings, instead of some of the time. (There are still outstanding problems with regular expressions and identifiers that have not been fixed.)</p>
<p>When prototype sub calls are deparsed with <code>&</code> (<i>e.g.</i>, under the <b>-P</b> option), <code>scalar</code> is now added where appropriate, to force the scalar context implied by the prototype.</p>
<p><code>require(foo())</code>, <code>do(foo())</code>, <code>goto(foo())</code> and similar constructs with loop controls are now deparsed correctly. The outer parentheses are not optional.</p>
<p>Whitespace is no longer escaped in regular expressions, because it was getting erroneously escaped within <code>(?x:...)</code> sections.</p>
<p><code>sub foo { foo() }</code> is now deparsed with those mandatory parentheses.</p>
<p><code>/@array/</code> is now deparsed as a regular expression, and not just <code>@array</code>.</p>
<p><code>/@{-}/</code>, <code>/@{+}/</code> and <code>$#{1}</code> are now deparsed with the braces, which are mandatory in these cases.</p>
<p>In deparsing feature bundles, <code>B::Deparse</code> was emitting <code>no feature;</code> first instead of <code>no feature ':all';</code>. This has been fixed.</p>
<p><code>chdir FH</code> is now deparsed without quotation marks.</p>
<p><code>\my @a</code> is now deparsed without parentheses. (Parenthese would flatten the array.)</p>
<p><code>system</code> and <code>exec</code> followed by a block are now deparsed correctly. Formerly there was an erroneous <code>do</code> before the block.</p>
<p><code>use constant QR => qr/.../flags</code> followed by <code>"" =~ QR</code> is no longer without the flags.</p>
<p>Deparsing <code>BEGIN { undef &foo }</code> with the <b>-w</b> switch enabled started to emit 'uninitialized' warnings in Perl 5.14. This has been fixed.</p>
<p>Deparsing calls to subs with a <code>(;+)</code> prototype resulted in an infinite loop. The <code>(;$</code>) <code>(_)</code> and <code>(;_)</code> prototypes were given the wrong precedence, causing <code>foo($a<$b)</code> to be deparsed without the parentheses.</p>
<p>Deparse now provides a defined state sub in inner subs.</p>
</li>
<li><p><a href="/cperl/lib/B/Op_private.html">B::Op_private</a> has been added.</p>
<p><a href="/cperl/lib/B/Op_private.html">B::Op_private</a> provides detailed information about the flags used in the <code>op_private</code> field of perl opcodes.</p>
</li>
<li><p><a href="/cperl/lib/bigint.html">bigint</a>, <a href="/cperl/lib/bignum.html">bignum</a>, <a href="/cperl/lib/bigrat.html">bigrat</a> have been upgraded to version 0.39.</p>
<p>Document in CAVEATS that using strings as numbers won't always invoke the big number overloading, and how to invoke it. [rt.perl.org #123064]</p>
</li>
<li><p><a href="/cperl/lib/Carp.html">Carp</a> has been upgraded to version 1.36.</p>
<p><code>Carp::Heavy</code> now ignores version mismatches with Carp if Carp is newer than 1.12, since <code>Carp::Heavy</code>'s guts were merged into Carp at that point. <a href="https://rt.perl.org/Ticket/Display.html?id=121574">[perl #121574]</a></p>
<p>Carp now handles non-ASCII platforms better.</p>
<p>Off-by-one error fix for Perl < 5.14.</p>
</li>
<li><p><a href="/cperl/lib/constant.html">constant</a> has been upgraded to version 1.33.</p>
<p>It now accepts fully-qualified constant names, allowing constants to be defined in packages other than the caller.</p>
</li>
<li><p><a href="/cperl/lib/CPAN.html">CPAN</a> has been upgraded to version 2.11.</p>
<p>Add support for <code>Cwd::getdcwd()</code> and introduce workaround for a misbehavior seen on Strawberry Perl 5.20.1.</p>
<p>Fix <code>chdir()</code> after building dependencies bug.</p>
<p>Introduce experimental support for plugins/hooks.</p>
<p>Integrate the <code>App::Cpan</code> sources.</p>
<p>Do not check recursion on optional dependencies.</p>
<p>Sanity check <i>META.yml</i> to contain a hash. <a href="https://rt.cpan.org/Ticket/Display.html?id=95271">[cpan #95271]</a></p>
</li>
<li><p><a href="/cperl/lib/CPAN/Meta/Requirements.html">CPAN::Meta::Requirements</a> has been upgraded to version 2.132.</p>
<p>Works around limitations in <code>version::vpp</code> detecting v-string magic and adds support for forthcoming <a href="/cperl/lib/ExtUtils/MakeMaker.html">ExtUtils::MakeMaker</a> bootstrap <i>version.pm</i> for Perls older than 5.10.0.</p>
</li>
<li><p><a href="/cperl/lib/Data/Dumper.html">Data::Dumper</a> has been upgraded to version 2.158.</p>
<p>Fixes CVE-2014-4330 by adding a configuration variable/option to limit recursion when dumping deep data structures.</p>
<p>Changes to resolve Coverity issues. XS dumps incorrectly stored the name of code references stored in a GLOB. <a href="https://rt.perl.org/Ticket/Display.html?id=122070">[perl #122070]</a></p>
</li>
<li><p><a href="/cperl/lib/DynaLoader.html">DynaLoader</a> has been upgraded to version 1.32.</p>
<p>Remove <code>dl_nonlazy</code> global if unused in Dynaloader. [perl #122926]</p>
</li>
<li><p><a href="/cperl/lib/Encode.html">Encode</a> has been upgraded to version 2.72.</p>
<p><code>piconv</code> now has better error handling when the encoding name is nonexistent, and a build breakage when upgrading <a href="/cperl/lib/Encode.html">Encode</a> in perl-5.8.2 and earlier has been fixed.</p>
<p>Building in C++ mode on Windows now works.</p>
</li>
<li><p><a href="/cperl/lib/Errno.html">Errno</a> has been upgraded to version 1.23.</p>
<p>Add <code>-P</code> to the preprocessor command-line on GCC 5. GCC added extra line directives, breaking parsing of error code definitions. [rt.perl.org #123784]</p>
</li>
<li><p><a href="/cperl/lib/experimental.html">experimental</a> has been upgraded to version 0.013.</p>
<p>Hardcodes features for Perls older than 5.15.7.</p>
</li>
<li><p><a href="/cperl/lib/ExtUtils/CBuilder.html">ExtUtils::CBuilder</a> has been upgraded to version 0.280221.</p>
<p>Fixes a regression on Android. <a href="https://rt.perl.org/Ticket/Display.html?id=122675">[perl #122675]</a></p>
</li>
<li><p><a href="/cperl/lib/ExtUtils/Manifest.html">ExtUtils::Manifest</a> has been upgraded to version 1.70.</p>
<p>Fixes a bug with <code>maniread()</code>'s handling of quoted filenames and improves <code>manifind()</code> to follow symlinks. <a href="https://rt.perl.org/Ticket/Display.html?id=122415">[perl #122415]</a></p>
</li>
<li><p><a href="/cperl/lib/ExtUtils/ParseXS.html">ExtUtils::ParseXS</a> has been upgraded to version 3.28.</p>
<p>Only declare <code>file</code> unused if we actually define it. Improve generated <code>RETVAL</code> code generation to avoid repeated references to <code>ST(0)</code>. [perl #123278] Broaden and document the <code>/OBJ$/</code> to <code>/REF$/</code> typemap optimization for the <code>DESTROY</code> method. [perl #123418]</p>
</li>
<li><p><a href="/cperl/lib/Fcntl.html">Fcntl</a> has been upgraded to version 1.13.</p>
<p>Add support for the Linux pipe buffer size <code>fcntl()</code> commands.</p>
</li>
<li><p><a href="/cperl/lib/File/Find.html">File::Find</a> has been upgraded to version 1.29.</p>
<p><code>find()</code> and <code>finddepth()</code> will now warn if passed inappropriate or misspelled options.</p>
</li>
<li><p><a href="/cperl/lib/File/Glob.html">File::Glob</a> has been upgraded to version 1.24.</p>
<p>Avoid <code>SvIV()</code> expanding to call <code>get_sv()</code> three times in a few places. [perl #123606]</p>
</li>
<li><p><a href="/cperl/lib/HTTP/Tiny.html">HTTP::Tiny</a> has been upgraded to version 0.054.</p>
<p><code>keep_alive</code> is now fork-safe and thread-safe.</p>
</li>
<li><p><a href="/cperl/lib/IO.html">IO</a> has been upgraded to version 1.35.</p>
<p>The XS implementation has been fixed for the sake of older Perls.</p>
</li>
<li><p><a href="/cperl/lib/IO/Socket.html">IO::Socket</a> has been upgraded to version 1.38.</p>
<p>Document the limitations of the <code>connected()</code> method. [perl #123096]</p>
</li>
<li><p><a href="/cperl/lib/IO/Socket/IP.html">IO::Socket::IP</a> has been upgraded to version 0.37.</p>
<p>A better fix for subclassing <code>connect()</code>. <a href="https://rt.cpan.org/Ticket/Display.html?id=95983">[cpan #95983]</a> <a href="https://rt.cpan.org/Ticket/Display.html?id=97050">[cpan #97050]</a></p>
<p>Implements Timeout for <code>connect()</code>. <a href="https://rt.cpan.org/Ticket/Display.html?id=92075">[cpan #92075]</a></p>
</li>
<li><p>The libnet collection of modules has been upgraded to version 3.05.</p>
<p>Support for IPv6 and SSL to <code>Net::FTP</code>, <code>Net::NNTP</code>, <code>Net::POP3</code> and <code>Net::SMTP</code>. Improvements in <code>Net::SMTP</code> authentication.</p>
</li>
<li><p><a>Locale::Codes</a> has been upgraded to version 3.34.</p>
<p>Fixed a bug in the scripts used to extract data from spreadsheets that prevented the SHP currency code from being found. <a href="https://rt.cpan.org/Ticket/Display.html?id=94229">[cpan #94229]</a></p>
<p>New codes have been added.</p>
</li>
<li><p><a href="/cperl/lib/Math/BigInt.html">Math::BigInt</a> has been upgraded to version 1.9997.</p>
<p>Synchronize POD changes from the CPAN release. <code>Math::BigFloat->blog(x)</code> would sometimes return <code>blog(2*x)</code> when the accuracy was greater than 70 digits. The result of <code>Math::BigFloat->bdiv()</code> in list context now satisfies <code>x = quotient * divisor + remainder</code>.</p>
<p>Correct handling of subclasses. <a href="https://rt.cpan.org/Ticket/Display.html?id=96254">[cpan #96254]</a> <a href="https://rt.cpan.org/Ticket/Display.html?id=96329">[cpan #96329]</a></p>
</li>
<li><p><a href="/cperl/lib/Module/Metadata.html">Module::Metadata</a> has been upgraded to version 1.000026.</p>
<p>Support installations on older perls with an <a href="/cperl/lib/ExtUtils/MakeMaker.html">ExtUtils::MakeMaker</a> earlier than 6.63_03</p>
</li>
<li><p><a href="/cperl/lib/overload.html">overload</a> has been upgraded to version 1.26.</p>
<p>A redundant <code>ref $sub</code> check has been removed.</p>
</li>
<li><p>The PathTools module collection has been upgraded to version 3.56.</p>
<p>A warning from the <b>gcc</b> compiler is now avoided when building the XS.</p>
<p>Don't turn leading <code>//</code> into <code>/</code> on Cygwin. [perl #122635]</p>
</li>
<li><p><a>perl5db.pl</a> has been upgraded to version 1.49.</p>
<p>The debugger would cause an assertion failure. <a href="https://rt.perl.org/Ticket/Display.html?id=124127">[perl #124127]</a></p>
<p><code>fork()</code> in the debugger under <code>tmux</code> will now create a new window for the forked process. <a href="https://rt.perl.org/Ticket/Display.html?id=121333">[perl #121333]</a></p>
<p>The debugger now saves the current working directory on startup and restores it when you restart your program with <code>R</code> or <code>rerun</code>. <a href="https://rt.perl.org/Ticket/Display.html?id=121509">[perl #121509]</a></p>
</li>
<li><p><a href="/cperl/lib/PerlIO/scalar.html">PerlIO::scalar</a> has been upgraded to version 0.22.</p>
<p>Reading from a position well past the end of the scalar now correctly returns end of file. [perl #123443]</p>
<p>Seeking to a negative position still fails, but no longer leaves the file position set to a negation location.</p>
<p><code>eof()</code> on a <code>PerlIO::scalar</code> handle now properly returns true when the file position is past the 2GB mark on 32-bit systems.</p>
<p>Attempting to write at file positions impossible for the platform now fail early rather than wrapping at 4GB.</p>
</li>
<li><p><a href="/cperl/lib/Pod/Perldoc.html">Pod::Perldoc</a> has been upgraded to version 3.25.</p>
<p>Filehandles opened for reading or writing now have <code>:encoding(UTF-8)</code> set. <a href="https://rt.cpan.org/Ticket/Display.html?id=98019">[cpan #98019]</a></p>
</li>
<li><p><a href="/cperl/lib/POSIX.html">POSIX</a> has been upgraded to version 1.53.</p>
<p>The C99 math functions and constants (for example <code>acosh</code>, <code>isinf</code>, <code>isnan</code>, <code>round</code>, <code>trunc</code>; <code>M_E</code>, <code>M_SQRT2</code>, <code>M_PI</code>) have been added.</p>
<p><code>POSIX::tmpnam()</code> now produces a deprecation warning. [perl #122005]</p>
</li>
<li><p><a href="/cperl/lib/Safe.html">Safe</a> has been upgraded to version 2.39.</p>
<p><code>reval</code> was not propagating void context properly.</p>
</li>
<li><p>Scalar-List-Utils has been upgraded to version 1.41.</p>
<p>A new module, <a href="/cperl/lib/Sub/Util.html">Sub::Util</a>, has been added, containing functions related to CODE refs, including <code>subname</code> (inspired by <code>Sub::Identity</code>) and <code>set_subname</code> (copied and renamed from <code>Sub::Name</code>). The use of <code>GetMagic</code> in <code>List::Util::reduce()</code> has also been fixed. <a href="https://rt.cpan.org/Ticket/Display.html?id=63211">[cpan #63211]</a></p>
</li>
<li><p><a href="/cperl/lib/SDBM_File.html">SDBM_File</a> has been upgraded to version 1.13.</p>
<p>Simplified the build process. [perl #123413]</p>
</li>
<li><p><a href="/cperl/lib/Time/Piece.html">Time::Piece</a> has been upgraded to version 1.29.</p>
<p>When pretty printing negative <code>Time::Seconds</code>, the "minus" is no longer lost.</p>
</li>
<li><p><a href="/cperl/lib/Unicode/Collate.html">Unicode::Collate</a> has been upgraded to version 1.12.</p>
<p>Version 0.67's improved discontiguous contractions is invalidated by default and is supported as a parameter <code>long_contraction</code>.</p>
</li>
<li><p><a href="/cperl/lib/Unicode/Normalize.html">Unicode::Normalize</a> has been upgraded to version 1.18.</p>
<p>The XSUB implementation has been removed in favor of pure Perl.</p>
</li>
<li><p><a href="/cperl/lib/Unicode/UCD.html">Unicode::UCD</a> has been upgraded to version 0.61.</p>
<p>A new function <a href="/cperl/lib/Unicode/UCD.html#prop_values">property_values()</a> has been added to return a given property's possible values.</p>
<p>A new function <a href="/cperl/lib/Unicode/UCD.html#charprop">charprop()</a> has been added to return the value of a given property for a given code point.</p>
<p>A new function <a href="/cperl/lib/Unicode/UCD.html#charprops_all">charprops_all()</a> has been added to return the values of all Unicode properties for a given code point.</p>
<p>A bug has been fixed so that <a href="/cperl/lib/Unicode/UCD.html#prop_aliases">propaliases()</a> returns the correct short and long names for the Perl extensions where it was incorrect.</p>
<p>A bug has been fixed so that <a href="/cperl/lib/Unicode/UCD.html#prop_value_aliases">prop_value_aliases()</a> returns <code>undef</code> instead of a wrong result for properties that are Perl extensions.</p>
<p>This module now works on EBCDIC platforms.</p>
</li>
<li><p><a href="/cperl/lib/utf8.html">utf8</a> has been upgraded to version 1.17</p>
<p>A mismatch between the documentation and the code in <code>utf8::downgrade()</code> was fixed in favor of the documentation. The optional second argument is now correctly treated as a perl boolean (true/false semantics) and not as an integer.</p>
</li>
<li><p><a href="/cperl/lib/version.html">version</a> has been upgraded to version 0.9909.</p>
<p>Numerous changes. See the <i>Changes</i> file in the CPAN distribution for details.</p>
</li>
<li><p><a href="/cperl/lib/File/Spec/Win32.html">Win32</a> has been upgraded to version 0.51.</p>
<p><code>GetOSName()</code> now supports Windows 8.1, and building in C++ mode now works.</p>
</li>
<li><p><a>Win32API::File</a> has been upgraded to version 0.1202</p>
<p>Building in C++ mode now works.</p>
</li>
<li><p><a href="/cperl/lib/XSLoader.html">XSLoader</a> has been upgraded to version 0.20.</p>
<p>Allow XSLoader to load modules from a different namespace. [perl #122455]</p>
</li>
</ul>
<h2 id="Removed-Modules-and-Pragmata">Removed Modules and Pragmata</h2>
<p>The following modules (and associated modules) have been removed from the core perl distribution:</p>
<ul>
<li><p><a>CGI</a></p>
</li>
<li><p><a>Module::Build</a></p>
</li>
</ul>
<h1 id="Documentation">Documentation</h1>
<h2 id="New-Documentation">New Documentation</h2>
<h3 id="perlunicook"><a href="/cperl/perlunicook.html">perlunicook</a></h3>
<p>This document, by Tom Christiansen, provides examples of handling Unicode in Perl.</p>
<h2 id="Changes-to-Existing-Documentation">Changes to Existing Documentation</h2>
<h3 id="perlaix"><a href="/cperl/perlaix.html">perlaix</a></h3>
<ul>
<li><p>A note on long doubles has been added.</p>
</li>
</ul>
<h3 id="perlapi"><a href="/cperl/perlapi.html">perlapi</a></h3>
<ul>
<li><p>Note that <code>SvSetSV</code> doesn't do set magic.</p>
</li>
<li><p><code>sv_usepvn_flags</code> - fix documentation to mention the use of <code>Newx</code> instead of <code>malloc</code>.</p>
<p><a href="https://rt.perl.org/Ticket/Display.html?id=121869">[perl #121869]</a></p>
</li>
<li><p>Clarify where <code>NUL</code> may be embedded or is required to terminate a string.</p>
</li>
<li><p>Some documentation that was previously missing due to formatting errors is now included.</p>
</li>
<li><p>Entries are now organized into groups rather than by the file where they are found.</p>
</li>
<li><p>Alphabetical sorting of entries is now done consistently (automatically by the POD generator) to make entries easier to find when scanning.</p>
</li>
</ul>
<h3 id="perldata"><a href="/cperl/perldata.html">perldata</a></h3>
<ul>
<li><p>The syntax of single-character variable names has been brought up-to-date and more fully explained.</p>
</li>
<li><p>Hexadecimal floating point numbers are described, as are infinity and NaN.</p>
</li>
</ul>
<h3 id="perlebcdic"><a href="/cperl/perlebcdic.html">perlebcdic</a></h3>
<ul>
<li><p>This document has been significantly updated in the light of recent improvements to EBCDIC support.</p>
</li>
</ul>