-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathperl5180delta.html
2569 lines (1601 loc) · 151 KB
/
perl5180delta.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>perl5180delta - what is new for perl v5.18.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-mechanism-for-experimental-features">New mechanism for experimental features</a></li>
<li><a href="#Hash-overhaul">Hash overhaul</a>
<ul>
<li><a href="#Hash-randomization">Hash randomization</a></li>
<li><a href="#New-hash-functions">New hash functions</a></li>
<li><a href="#PERL_HASH_SEED-environment-variable-now-takes-a-hex-value">PERL_HASH_SEED environment variable now takes a hex value</a></li>
<li><a href="#PERL_PERTURB_KEYS-environment-variable-added">PERL_PERTURB_KEYS environment variable added</a></li>
<li><a href="#Hash::Util::hash_seed-now-returns-a-string">Hash::Util::hash_seed() now returns a string</a></li>
<li><a href="#Output-of-PERL_HASH_SEED_DEBUG-has-been-changed">Output of PERL_HASH_SEED_DEBUG has been changed</a></li>
</ul>
</li>
<li><a href="#Upgrade-to-Unicode-6.2">Upgrade to Unicode 6.2</a></li>
<li><a href="#Character-name-aliases-may-now-include-non-Latin1-range-characters">Character name aliases may now include non-Latin1-range characters</a></li>
<li><a href="#New-DTrace-probes">New DTrace probes</a></li>
<li><a href="#LAST_FH">${^LAST_FH}</a></li>
<li><a href="#Regular-Expression-Set-Operations">Regular Expression Set Operations</a></li>
<li><a href="#Lexical-subroutines">Lexical subroutines</a></li>
<li><a href="#Computed-Labels">Computed Labels</a></li>
<li><a href="#More-CORE::-subs">More CORE:: subs</a></li>
<li><a href="#kill-with-negative-signal-names">kill with negative signal names</a></li>
</ul>
</li>
<li><a href="#Security">Security</a>
<ul>
<li><a href="#See-also:-hash-overhaul">See also: hash overhaul</a></li>
<li><a href="#Storable-security-warning-in-documentation">Storable security warning in documentation</a></li>
<li><a href="#Locale::Maketext-allowed-code-injection-via-a-malicious-template">Locale::Maketext allowed code injection via a malicious template</a></li>
<li><a href="#Avoid-calling-memset-with-a-negative-count">Avoid calling memset with a negative count</a></li>
</ul>
</li>
<li><a href="#Incompatible-Changes">Incompatible Changes</a>
<ul>
<li><a href="#See-also:-hash-overhaul1">See also: hash overhaul</a></li>
<li><a href="#An-unknown-character-name-in-N-...-is-now-a-syntax-error">An unknown character name in \N{...} is now a syntax error</a></li>
<li><a href="#Formerly-deprecated-characters-in-N-character-name-aliases-are-now-errors">Formerly deprecated characters in \N{} character name aliases are now errors.</a></li>
<li><a href="#N-BELL-now-refers-to-U-1F514-instead-of-U-0007">\N{BELL} now refers to U+1F514 instead of U+0007</a></li>
<li><a href="#New-Restrictions-in-Multi-Character-Case-Insensitive-Matching-in-Regular-Expression-Bracketed-Character-Classes">New Restrictions in Multi-Character Case-Insensitive Matching in Regular Expression Bracketed Character Classes</a></li>
<li><a href="#Explicit-rules-for-variable-names-and-identifiers">Explicit rules for variable names and identifiers</a></li>
<li><a href="#Vertical-tabs-are-now-whitespace">Vertical tabs are now whitespace</a></li>
<li><a href="#and-have-been-heavily-reworked">/(?{})/ and /(??{})/ have been heavily reworked</a></li>
<li><a href="#Stricter-parsing-of-substitution-replacement">Stricter parsing of substitution replacement</a></li>
<li><a href="#given-now-aliases-the-global-_">given now aliases the global $_</a></li>
<li><a href="#The-smartmatch-family-of-features-are-now-experimental">The smartmatch family of features are now experimental</a></li>
<li><a href="#Lexical-_-is-now-experimental">Lexical $_ is now experimental</a></li>
<li><a href="#readline-with-N-now-reads-N-characters-not-N-bytes">readline() with $/ = \N now reads N characters, not N bytes</a></li>
<li><a href="#Overridden-glob-is-now-passed-one-argument">Overridden glob is now passed one argument</a></li>
<li><a href="#Here-doc-parsing">Here doc parsing</a></li>
<li><a href="#Alphanumeric-operators-must-now-be-separated-from-the-closing-delimiter-of-regular-expressions">Alphanumeric operators must now be separated from the closing delimiter of regular expressions</a></li>
<li><a href="#qw-...-can-no-longer-be-used-as-parentheses">qw(...) can no longer be used as parentheses</a></li>
<li><a href="#Interaction-of-lexical-and-default-warnings">Interaction of lexical and default warnings</a></li>
<li><a href="#state-sub-and-our-sub">state sub and our sub</a></li>
<li><a href="#Defined-values-stored-in-environment-are-forced-to-byte-strings">Defined values stored in environment are forced to byte strings</a></li>
<li><a href="#require-dies-for-unreadable-files">require dies for unreadable files</a></li>
<li><a href="#gv_fetchmeth_-and-SUPER">gv_fetchmeth_* and SUPER</a></li>
<li><a href="#splits-first-argument-is-more-consistently-interpreted">split's first argument is more consistently interpreted</a></li>
</ul>
</li>
<li><a href="#Deprecations">Deprecations</a>
<ul>
<li><a href="#Module-removals">Module removals</a></li>
<li><a href="#Deprecated-Utilities">Deprecated Utilities</a></li>
<li><a href="#PL_sv_objcount">PL_sv_objcount</a></li>
<li><a href="#Five-additional-characters-should-be-escaped-in-patterns-with-x">Five additional characters should be escaped in patterns with /x</a></li>
<li><a href="#User-defined-charnames-with-surprising-whitespace">User-defined charnames with surprising whitespace</a></li>
<li><a href="#Various-XS-callable-functions-are-now-deprecated">Various XS-callable functions are now deprecated</a></li>
<li><a href="#Certain-rare-uses-of-backslashes-within-regexes-are-now-deprecated">Certain rare uses of backslashes within regexes are now deprecated</a></li>
<li><a href="#Splitting-the-tokens-and-in-regular-expressions">Splitting the tokens (? and (* in regular expressions</a></li>
<li><a href="#Pre-PerlIO-IO-implementations">Pre-PerlIO IO implementations</a></li>
</ul>
</li>
<li><a href="#Future-Deprecations">Future Deprecations</a></li>
<li><a href="#Performance-Enhancements">Performance Enhancements</a></li>
<li><a href="#Modules-and-Pragmata">Modules and Pragmata</a>
<ul>
<li><a href="#New-Modules-and-Pragmata">New Modules and Pragmata</a></li>
<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="#Changes-to-Existing-Documentation">Changes to Existing Documentation</a>
<ul>
<li><a href="#perlcheat">perlcheat</a></li>
<li><a href="#perldata">perldata</a></li>
<li><a href="#perldiag">perldiag</a></li>
<li><a href="#perlfaq">perlfaq</a></li>
<li><a href="#perlfunc">perlfunc</a></li>
<li><a href="#perlop">perlop</a></li>
<li><a href="#Diagnostics">Diagnostics</a></li>
</ul>
</li>
<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>
</ul>
</li>
<li><a href="#Utility-Changes">Utility Changes</a>
<ul>
<li>
<ul>
<li><a href="#h2xs">h2xs</a></li>
</ul>
</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="#Discontinued-Platforms">Discontinued Platforms</a></li>
<li><a href="#Platform-Specific-Notes">Platform-Specific Notes</a>
<ul>
<li><a href="#AIX">AIX</a></li>
<li><a href="#clang">clang++</a></li>
<li><a href="#C">C++</a></li>
<li><a href="#Darwin">Darwin</a></li>
<li><a href="#Haiku">Haiku</a></li>
<li><a href="#MidnightBSD">MidnightBSD</a></li>
<li><a href="#Solaris">Solaris</a></li>
<li><a href="#VMS">VMS</a></li>
<li><a href="#Win32">Win32</a></li>
<li><a href="#WinCE">WinCE</a></li>
</ul>
</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>perl5180delta - what is new for perl v5.18.0</p>
<h1 id="DESCRIPTION">DESCRIPTION</h1>
<p>This document describes differences between the v5.16.0 release and the v5.18.0 release.</p>
<p>If you are upgrading from an earlier release such as v5.14.0, first read <a href="/cperl/perl5160delta.html">perl5160delta</a>, which describes differences between v5.14.0 and v5.16.0.</p>
<h1 id="Core-Enhancements">Core Enhancements</h1>
<h2 id="New-mechanism-for-experimental-features">New mechanism for experimental features</h2>
<p>Newly-added experimental features will now require this incantation:</p>
<pre><code> no warnings "experimental::feature_name";
use feature "feature_name"; # would warn without the prev line</code></pre>
<p>There is a new warnings category, called "experimental", containing warnings that the <a href="/cperl/lib/feature.html">feature</a> pragma emits when enabling experimental features.</p>
<p>Newly-added experimental features will also be given special warning IDs, which consist of "experimental::" followed by the name of the feature. (The plan is to extend this mechanism eventually to all warnings, to allow them to be enabled or disabled individually, and not just by category.)</p>
<p>By saying</p>
<pre><code> no warnings "experimental::feature_name";</code></pre>
<p>you are taking responsibility for any breakage that future changes to, or removal of, the feature may cause.</p>
<p>Since some features (like <code>~~</code> or <code>my $_</code>) now emit experimental warnings, and you may want to disable them in code that is also run on perls that do not recognize these warning categories, consider using the <code>if</code> pragma like this:</p>
<pre><code> no if $] >= 5.018, warnings => "experimental::feature_name";</code></pre>
<p>Existing experimental features may begin emitting these warnings, too. Please consult <a href="/cperl/perlexperiment.html">perlexperiment</a> for information on which features are considered experimental.</p>
<h2 id="Hash-overhaul">Hash overhaul</h2>
<p>Changes to the implementation of hashes in perl v5.18.0 will be one of the most visible changes to the behavior of existing code.</p>
<p>By default, two distinct hash variables with identical keys and values may now provide their contents in a different order where it was previously identical.</p>
<p>When encountering these changes, the key to cleaning up from them is to accept that <b>hashes are unordered collections</b> and to act accordingly.</p>
<h3 id="Hash-randomization">Hash randomization</h3>
<p>The seed used by Perl's hash function is now random. This means that the order which keys/values will be returned from functions like <code>keys()</code>, <code>values()</code>, and <code>each()</code> will differ from run to run.</p>
<p>This change was introduced to make Perl's hashes more robust to algorithmic complexity attacks, and also because we discovered that it exposes hash ordering dependency bugs and makes them easier to track down.</p>
<p>Toolchain maintainers might want to invest in additional infrastructure to test for things like this. Running tests several times in a row and then comparing results will make it easier to spot hash order dependencies in code. Authors are strongly encouraged not to expose the key order of Perl's hashes to insecure audiences.</p>
<p>Further, every hash has its own iteration order, which should make it much more difficult to determine what the current hash seed is.</p>
<h3 id="New-hash-functions">New hash functions</h3>
<p>Perl v5.18 includes support for multiple hash functions, and changed the default (to ONE_AT_A_TIME_HARD), you can choose a different algorithm by defining a symbol at compile time. For a current list, consult the <i>INSTALL</i> document. Note that as of Perl v5.18 we can only recommend use of the default or SIPHASH. All the others are known to have security issues and are for research purposes only.</p>
<h3 id="PERL_HASH_SEED-environment-variable-now-takes-a-hex-value">PERL_HASH_SEED environment variable now takes a hex value</h3>
<p><code>PERL_HASH_SEED</code> no longer accepts an integer as a parameter; instead the value is expected to be a binary value encoded in a hex string, such as "0xf5867c55039dc724". This is to make the infrastructure support hash seeds of arbitrary lengths, which might exceed that of an integer. (SipHash uses a 16 byte seed.)</p>
<h3 id="PERL_PERTURB_KEYS-environment-variable-added">PERL_PERTURB_KEYS environment variable added</h3>
<p>The <code>PERL_PERTURB_KEYS</code> environment variable allows one to control the level of randomization applied to <code>keys</code> and friends.</p>
<p>When <code>PERL_PERTURB_KEYS</code> is 0, perl will not randomize the key order at all. The chance that <code>keys</code> changes due to an insert will be the same as in previous perls, basically only when the bucket size is changed.</p>
<p>When <code>PERL_PERTURB_KEYS</code> is 1, perl will randomize keys in a non-repeatable way. The chance that <code>keys</code> changes due to an insert will be very high. This is the most secure and default mode.</p>
<p>When <code>PERL_PERTURB_KEYS</code> is 2, perl will randomize keys in a repeatable way. Repeated runs of the same program should produce the same output every time.</p>
<p><code>PERL_HASH_SEED</code> implies a non-default <code>PERL_PERTURB_KEYS</code> setting. Setting <code>PERL_HASH_SEED=0</code> (exactly one 0) implies <code>PERL_PERTURB_KEYS=0</code> (hash key randomization disabled); setting <code>PERL_HASH_SEED</code> to any other value implies <code>PERL_PERTURB_KEYS=2</code> (deterministic and repeatable hash key randomization). Specifying <code>PERL_PERTURB_KEYS</code> explicitly to a different level overrides this behavior.</p>
<h3 id="Hash::Util::hash_seed-now-returns-a-string">Hash::Util::hash_seed() now returns a string</h3>
<p>Hash::Util::hash_seed() now returns a string instead of an integer. This is to make the infrastructure support hash seeds of arbitrary lengths which might exceed that of an integer. (SipHash uses a 16 byte seed.)</p>
<h3 id="Output-of-PERL_HASH_SEED_DEBUG-has-been-changed">Output of PERL_HASH_SEED_DEBUG has been changed</h3>
<p>The environment variable PERL_HASH_SEED_DEBUG now makes perl show both the hash function perl was built with, <i>and</i> the seed, in hex, in use for that process. Code parsing this output, should it exist, must change to accommodate the new format. Example of the new format:</p>
<pre><code> $ PERL_HASH_SEED_DEBUG=1 ./perl -e1
HASH_FUNCTION = MURMUR3 HASH_SEED = 0x1476bb9f</code></pre>
<h2 id="Upgrade-to-Unicode-6.2">Upgrade to Unicode 6.2</h2>
<p>Perl now supports Unicode 6.2. A list of changes from Unicode 6.1 is at <a href="http://www.unicode.org/versions/Unicode6.2.0">http://www.unicode.org/versions/Unicode6.2.0</a>.</p>
<h2 id="Character-name-aliases-may-now-include-non-Latin1-range-characters">Character name aliases may now include non-Latin1-range characters</h2>
<p>It is possible to define your own names for characters for use in <code>\N{...}</code>, <code>charnames::vianame()</code>, etc. These names can now be comprised of characters from the whole Unicode range. This allows for names to be in your native language, and not just English. Certain restrictions apply to the characters that may be used (you can't define a name that has punctuation in it, for example). See <a href="/cperl/lib/charnames.html#CUSTOM-ALIASES">"CUSTOM ALIASES" in charnames</a>.</p>
<h2 id="New-DTrace-probes">New DTrace probes</h2>
<p>The following new DTrace probes have been added:</p>
<ul>
<li><p><code>op-entry</code></p>
</li>
<li><p><code>loading-file</code></p>
</li>
<li><p><code>loaded-file</code></p>
</li>
</ul>
<h2 id="LAST_FH"><code>${^LAST_FH}</code></h2>
<p>This new variable provides access to the filehandle that was last read. This is the handle used by <code>$.</code> and by <code>tell</code> and <code>eof</code> without arguments.</p>
<h2 id="Regular-Expression-Set-Operations">Regular Expression Set Operations</h2>
<p>This is an <b>experimental</b> feature to allow matching against the union, intersection, etc., of sets of code points, similar to <a>Unicode::Regex::Set</a>. It can also be used to extend <code>/x</code> processing to [bracketed] character classes, and as a replacement of user-defined properties, allowing more complex expressions than they do. See <a href="/cperl/perlrecharclass.html#Extended-Bracketed-Character-Classes">"Extended Bracketed Character Classes" in perlrecharclass</a>.</p>
<h2 id="Lexical-subroutines">Lexical subroutines</h2>
<p>This new feature is still considered <b>experimental</b>. To enable it:</p>
<pre><code> use 5.018;
no warnings "experimental::lexical_subs";
use feature "lexical_subs";</code></pre>
<p>You can now declare subroutines with <code>state sub foo</code>, <code>my sub foo</code>, and <code>our sub foo</code>. (<code>state sub</code> requires that the "state" feature be enabled, unless you write it as <code>CORE::state sub foo</code>.)</p>
<p><code>state sub</code> creates a subroutine visible within the lexical scope in which it is declared. The subroutine is shared between calls to the outer sub.</p>
<p><code>my sub</code> declares a lexical subroutine that is created each time the enclosing block is entered. <code>state sub</code> is generally slightly faster than <code>my sub</code>.</p>
<p><code>our sub</code> declares a lexical alias to the package subroutine of the same name.</p>
<p>For more information, see <a href="/cperl/perlsub.html#Lexical-Subroutines">"Lexical Subroutines" in perlsub</a>.</p>
<h2 id="Computed-Labels">Computed Labels</h2>
<p>The loop controls <code>next</code>, <code>last</code> and <code>redo</code>, and the special <code>dump</code> operator, now allow arbitrary expressions to be used to compute labels at run time. Previously, any argument that was not a constant was treated as the empty string.</p>
<h2 id="More-CORE::-subs">More CORE:: subs</h2>
<p>Several more built-in functions have been added as subroutines to the CORE:: namespace - namely, those non-overridable keywords that can be implemented without custom parsers: <code>defined</code>, <code>delete</code>, <code>exists</code>, <code>glob</code>, <code>pos</code>, <code>prototype</code>, <code>scalar</code>, <code>split</code>, <code>study</code>, and <code>undef</code>.</p>
<p>As some of these have prototypes, <code>prototype('CORE::...')</code> has been changed to not make a distinction between overridable and non-overridable keywords. This is to make <code>prototype('CORE::pos')</code> consistent with <code>prototype(&CORE::pos)</code>.</p>
<h2 id="kill-with-negative-signal-names"><code>kill</code> with negative signal names</h2>
<p><code>kill</code> 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 <code>-INT</code> are supported and treated the same way as -2 [perl #112990].</p>
<h1 id="Security">Security</h1>
<h2 id="See-also:-hash-overhaul">See also: hash overhaul</h2>
<p>Some of the changes in the <a href="#Hash-overhaul">hash overhaul</a> were made to enhance security. Please read that section.</p>
<h2 id="Storable-security-warning-in-documentation"><code>Storable</code> security warning in documentation</h2>
<p>The documentation for <code>Storable</code> now includes a section which warns readers of the danger of accepting Storable documents from untrusted sources. The short version is that deserializing certain types of data can lead to loading modules and other code execution. This is documented behavior and wanted behavior, but this opens an attack vector for malicious entities.</p>
<h2 id="Locale::Maketext-allowed-code-injection-via-a-malicious-template"><code>Locale::Maketext</code> allowed code injection via a malicious template</h2>
<p>If users could provide a translation string to Locale::Maketext, this could be used to invoke arbitrary Perl subroutines available in the current process.</p>
<p>This has been fixed, but it is still possible to invoke any method provided by <code>Locale::Maketext</code> itself or a subclass that you are using. One of these methods in turn will invoke the Perl core's <code>sprintf</code> subroutine.</p>
<p>In summary, allowing users to provide translation strings without auditing them is a bad idea.</p>
<p>This vulnerability is documented in CVE-2012-6329.</p>
<h2 id="Avoid-calling-memset-with-a-negative-count">Avoid calling memset with a negative count</h2>
<p>Poorly written perl code that allows an attacker to specify the count to perl's <code>x</code> string repeat operator can already cause a memory exhaustion denial-of-service attack. A flaw in versions of perl before v5.15.5 can escalate that into a heap buffer overrun; coupled with versions of glibc before 2.16, it possibly allows the execution of arbitrary code.</p>
<p>The flaw addressed to this commit has been assigned identifier CVE-2012-5195 and was researched by Tim Brown.</p>
<h1 id="Incompatible-Changes">Incompatible Changes</h1>
<h2 id="See-also:-hash-overhaul1">See also: hash overhaul</h2>
<p>Some of the changes in the <a href="#Hash-overhaul">hash overhaul</a> are not fully compatible with previous versions of perl. Please read that section.</p>
<h2 id="An-unknown-character-name-in-N-...-is-now-a-syntax-error">An unknown character name in <code>\N{...}</code> is now a syntax error</h2>
<p>Previously, it warned, and the Unicode REPLACEMENT CHARACTER was substituted. Unicode now recommends that this situation be a syntax error. Also, the previous behavior led to some confusing warnings and behaviors, and since the REPLACEMENT CHARACTER has no use other than as a stand-in for some unknown character, any code that has this problem is buggy.</p>
<h2 id="Formerly-deprecated-characters-in-N-character-name-aliases-are-now-errors">Formerly deprecated characters in <code>\N{}</code> character name aliases are now errors.</h2>
<p>Since v5.12.0, it has been deprecated to use certain characters in user-defined <code>\N{...}</code> character names. These now cause a syntax error. For example, it is now an error to begin a name with a digit, such as in</p>
<pre><code> my $undraftable = "\N{4F}"; # Syntax error!</code></pre>
<p>or to have commas anywhere in the name. See <a href="/cperl/lib/charnames.html#CUSTOM-ALIASES">"CUSTOM ALIASES" in charnames</a>.</p>
<h2 id="N-BELL-now-refers-to-U-1F514-instead-of-U-0007"><code>\N{BELL}</code> now refers to U+1F514 instead of U+0007</h2>
<p>Unicode 6.0 reused the name "BELL" for a different code point than it traditionally had meant. Since Perl v5.14, use of this name still referred to U+0007, but would raise a deprecation warning. Now, "BELL" refers to U+1F514, and the name for U+0007 is "ALERT". All the functions in <a href="/cperl/lib/charnames.html">charnames</a> have been correspondingly updated.</p>
<h2 id="New-Restrictions-in-Multi-Character-Case-Insensitive-Matching-in-Regular-Expression-Bracketed-Character-Classes">New Restrictions in Multi-Character Case-Insensitive Matching in Regular Expression Bracketed Character Classes</h2>
<p>Unicode has now withdrawn their previous recommendation for regular expressions to automatically handle cases where a single character can match multiple characters case-insensitively, for example, the letter LATIN SMALL LETTER SHARP S and the sequence <code>ss</code>. This is because it turns out to be impracticable to do this correctly in all circumstances. Because Perl has tried to do this as best it can, it will continue to do so. (We are considering an option to turn it off.) However, a new restriction is being added on such matches when they occur in [bracketed] character classes. People were specifying things such as <code>/[\0-\xff]/i</code>, and being surprised that it matches the two character sequence <code>ss</code> (since LATIN SMALL LETTER SHARP S occurs in this range). This behavior is also inconsistent with using a property instead of a range: <code>\p{Block=Latin1}</code> also includes LATIN SMALL LETTER SHARP S, but <code>/[\p{Block=Latin1}]/i</code> does not match <code>ss</code>. The new rule is that for there to be a multi-character case-insensitive match within a bracketed character class, the character must be explicitly listed, and not as an end point of a range. This more closely obeys the Principle of Least Astonishment. See <a href="/cperl/perlrecharclass.html#Bracketed-Character-Classes">"Bracketed Character Classes" in perlrecharclass</a>. Note that a bug [perl #89774], now fixed as part of this change, prevented the previous behavior from working fully.</p>
<h2 id="Explicit-rules-for-variable-names-and-identifiers">Explicit rules for variable names and identifiers</h2>
<p>Due to an oversight, single character variable names in v5.16 were completely unrestricted. This opened the door to several kinds of insanity. As of v5.18, these now follow the rules of other identifiers, in addition to accepting characters that match the <code>\p{POSIX_Punct}</code> property.</p>
<p>There is no longer any difference in the parsing of identifiers specified by using braces versus without braces. For instance, perl used to allow <code>${foo:bar}</code> (with a single colon) but not <code>$foo:bar</code>. Now that both are handled by a single code path, they are both treated the same way: both are forbidden. Note that this change is about the range of permissible literal identifiers, not other expressions.</p>
<h2 id="Vertical-tabs-are-now-whitespace">Vertical tabs are now whitespace</h2>
<p>No one could recall why <code>\s</code> didn't match <code>\cK</code>, the vertical tab. Now it does. Given the extreme rarity of that character, very little breakage is expected. That said, here's what it means:</p>
<p><code>\s</code> in a regex now matches a vertical tab in all circumstances.</p>
<p>Literal vertical tabs in a regex literal are ignored when the <code>/x</code> modifier is used.</p>
<p>Leading vertical tabs, alone or mixed with other whitespace, are now ignored when interpreting a string as a number. For example:</p>
<pre><code> $dec = " \cK \t 123";
$hex = " \cK \t 0xF";
say 0 + $dec; # was 0 with warning, now 123
say int $dec; # was 0, now 123
say oct $hex; # was 0, now 15</code></pre>
<h2 id="and-have-been-heavily-reworked"><code>/(?{})/</code> and <code>/(??{})/</code> have been heavily reworked</h2>
<p>The implementation of this feature has been almost completely rewritten. Although its main intent is to fix bugs, some behaviors, especially related to the scope of lexical variables, will have changed. This is described more fully in the <a href="#Selected-Bug-Fixes">"Selected Bug Fixes"</a> section.</p>
<h2 id="Stricter-parsing-of-substitution-replacement">Stricter parsing of substitution replacement</h2>
<p>It is no longer possible to abuse the way the parser parses <code>s///e</code> like this:</p>
<pre><code> %_=(_,"Just another ");
$_="Perl hacker,\n";
s//_}->{_/e;print</code></pre>
<h2 id="given-now-aliases-the-global-_"><code>given</code> now aliases the global <code>$_</code></h2>
<p>Instead of assigning to an implicit lexical <code>$_</code>, <code>given</code> now makes the global <code>$_</code> an alias for its argument, just like <code>foreach</code>. However, it still uses lexical <code>$_</code> if there is lexical <code>$_</code> in scope (again, just like <code>foreach</code>) [perl #114020].</p>
<h2 id="The-smartmatch-family-of-features-are-now-experimental">The smartmatch family of features are now experimental</h2>
<p>Smart match, added in v5.10.0 and significantly revised in v5.10.1, has been a regular point of complaint. Although there are a number of ways in which it is useful, it has also proven problematic and confusing for both users and implementors of Perl. There have been a number of proposals on how to best address the problem. It is clear that smartmatch is almost certainly either going to change or go away in the future. Relying on its current behavior is not recommended.</p>
<p>Warnings will now be issued when the parser sees <code>~~</code>, <code>given</code>, or <code>when</code>. To disable these warnings, you can add this line to the appropriate scope:</p>
<pre><code> no if $] >= 5.018, warnings => "experimental::smartmatch";</code></pre>
<p>Consider, though, replacing the use of these features, as they may change behavior again before becoming stable.</p>
<h2 id="Lexical-_-is-now-experimental">Lexical <code>$_</code> is now experimental</h2>
<p>Since it was introduced in Perl v5.10, it has caused much confusion with no obvious solution:</p>
<ul>
<li><p>Various modules (e.g., List::Util) expect callback routines to use the global <code>$_</code>. <code>use List::Util 'first'; my $_; first { $_ == 1 } @list</code> does not work as one would expect.</p>
</li>
<li><p>A <code>my $_</code> declaration earlier in the same file can cause confusing closure warnings.</p>
</li>
<li><p>The "_" subroutine prototype character allows called subroutines to access your lexical <code>$_</code>, so it is not really private after all.</p>
</li>
<li><p>Nevertheless, subroutines with a "(@)" prototype and methods cannot access the caller's lexical <code>$_</code>, unless they are written in XS.</p>
</li>
<li><p>But even XS routines cannot access a lexical <code>$_</code> declared, not in the calling subroutine, but in an outer scope, iff that subroutine happened not to mention <code>$_</code> or use any operators that default to <code>$_</code>.</p>
</li>
</ul>
<p>It is our hope that lexical <code>$_</code> can be rehabilitated, but this may cause changes in its behavior. Please use it with caution until it becomes stable.</p>
<h2 id="readline-with-N-now-reads-N-characters-not-N-bytes">readline() with <code>$/ = \N</code> now reads N characters, not N bytes</h2>
<p>Previously, when reading from a stream with I/O layers such as <code>encoding</code>, the readline() function, otherwise known as the <code><></code> operator, would read <i>N</i> bytes from the top-most layer. [perl #79960]</p>
<p>Now, <i>N</i> characters are read instead.</p>
<p>There is no change in behaviour when reading from streams with no extra layers, since bytes map exactly to characters.</p>
<h2 id="Overridden-glob-is-now-passed-one-argument">Overridden <code>glob</code> is now passed one argument</h2>
<p><code>glob</code> overrides used to be passed a magical undocumented second argument that identified the caller. Nothing on CPAN was using this, and it got in the way of a bug fix, so it was removed. If you really need to identify the caller, see <a>Devel::Callsite</a> on CPAN.</p>
<h2 id="Here-doc-parsing">Here doc parsing</h2>
<p>The body of a here document inside a quote-like operator now always begins on the line after the "<<foo" marker. Previously, it was documented to begin on the line following the containing quote-like operator, but that was only sometimes the case [perl #114040].</p>
<h2 id="Alphanumeric-operators-must-now-be-separated-from-the-closing-delimiter-of-regular-expressions">Alphanumeric operators must now be separated from the closing delimiter of regular expressions</h2>
<p>You may no longer write something like:</p>
<pre><code> m/a/and 1</code></pre>
<p>Instead you must write</p>
<pre><code> m/a/ and 1</code></pre>
<p>with whitespace separating the operator from the closing delimiter of the regular expression. Not having whitespace has resulted in a deprecation warning since Perl v5.14.0.</p>
<h2 id="qw-...-can-no-longer-be-used-as-parentheses">qw(...) can no longer be used as parentheses</h2>
<p><code>qw</code> lists used to fool the parser into thinking they were always surrounded by parentheses. This permitted some surprising constructions such as <code>foreach $x qw(a b c) {...}</code>, which should really be written <code>foreach $x (qw(a b c)) {...}</code>. These would sometimes get the lexer into the wrong state, so they didn't fully work, and the similar <code>foreach qw(a b c) {...}</code> that one might expect to be permitted never worked at all.</p>
<p>This side effect of <code>qw</code> has now been abolished. It has been deprecated since Perl v5.13.11. It is now necessary to use real parentheses everywhere that the grammar calls for them.</p>
<h2 id="Interaction-of-lexical-and-default-warnings">Interaction of lexical and default warnings</h2>
<p>Turning on any lexical warnings used first to disable all default warnings if lexical warnings were not already enabled:</p>
<pre><code> $*; # deprecation warning
use warnings "void";
$#; # void warning; no deprecation warning</code></pre>
<p>Now, the <code>debugging</code>, <code>deprecated</code>, <code>glob</code>, <code>inplace</code> and <code>malloc</code> warnings categories are left on when turning on lexical warnings (unless they are turned off by <code>no warnings</code>, of course).</p>
<p>This may cause deprecation warnings to occur in code that used to be free of warnings.</p>
<p>Those are the only categories consisting only of default warnings. Default warnings in other categories are still disabled by <code>use warnings "category"</code>, as we do not yet have the infrastructure for controlling individual warnings.</p>
<h2 id="state-sub-and-our-sub"><code>state sub</code> and <code>our sub</code></h2>
<p>Due to an accident of history, <code>state sub</code> and <code>our sub</code> were equivalent to a plain <code>sub</code>, so one could even create an anonymous sub with <code>our sub { ... }</code>. These are now disallowed outside of the "lexical_subs" feature. Under the "lexical_subs" feature they have new meanings described in <a href="/cperl/perlsub.html#Lexical-Subroutines">"Lexical Subroutines" in perlsub</a>.</p>
<h2 id="Defined-values-stored-in-environment-are-forced-to-byte-strings">Defined values stored in environment are forced to byte strings</h2>
<p>A value stored in an environment variable has always been stringified when inherited by child processes.</p>
<p>In this release, when assigning to <code>%ENV</code>, values are immediately stringified, and converted to be only a byte string.</p>
<p>First, it is forced to be only a string. Then if the string is utf8 and the equivalent of <code>utf8::downgrade()</code> works, that result is used; otherwise, the equivalent of <code>utf8::encode()</code> is used, and a warning is issued about wide characters (<a href="#Diagnostics">"Diagnostics"</a>).</p>
<h2 id="require-dies-for-unreadable-files"><code>require</code> dies for unreadable files</h2>
<p>When <code>require</code> encounters an unreadable file, it now dies. It used to ignore the file and continue searching the directories in <code>@INC</code> [perl #113422].</p>
<h2 id="gv_fetchmeth_-and-SUPER"><code>gv_fetchmeth_*</code> and SUPER</h2>
<p>The various <code>gv_fetchmeth_*</code> XS functions used to treat a package whose named ended with <code>::SUPER</code> specially. A method lookup on the <code>Foo::SUPER</code> package would be treated as a <code>SUPER</code> method lookup on the <code>Foo</code> package. This is no longer the case. To do a <code>SUPER</code> lookup, pass the <code>Foo</code> stash and the <code>GV_SUPER</code> flag.</p>
<h2 id="splits-first-argument-is-more-consistently-interpreted"><code>split</code>'s first argument is more consistently interpreted</h2>
<p>After some changes earlier in v5.17, <code>split</code>'s behavior has been simplified: if the PATTERN argument evaluates to a string containing one space, it is treated the way that a <i>literal</i> string containing one space once was.</p>
<h1 id="Deprecations">Deprecations</h1>
<h2 id="Module-removals">Module removals</h2>
<p>The following modules will be removed from the core distribution in a future release, and will at that time need to be installed from CPAN. Distributions on CPAN which require these modules will need to list them as prerequisites.</p>
<p>The core versions of these modules will now issue <code>"deprecated"</code>-category warnings to alert you to this fact. To silence these deprecation warnings, install the modules in question from CPAN.</p>
<p>Note that these are (with rare exceptions) fine modules that you are encouraged to continue to use. Their disinclusion from core primarily hinges on their necessity to bootstrapping a fully functional, CPAN-capable Perl installation, not usually on concerns over their design.</p>
<dl>
<dt id="encoding"><a href="/cperl/lib/encoding.html">encoding</a></dt>
<dd>
<p>The use of this pragma is now strongly discouraged. It conflates the encoding of source text with the encoding of I/O data, reinterprets escape sequences in source text (a questionable choice), and introduces the UTF-8 bug to all runtime handling of character strings. It is broken as designed and beyond repair.</p>
<p>For using non-ASCII literal characters in source text, please refer to <a href="/cperl/lib/utf8.html">utf8</a>. For dealing with textual I/O data, please refer to <a href="/cperl/lib/Encode.html">Encode</a> and <a href="/cperl/lib/open.html">open</a>.</p>
</dd>
<dt id="Archive::Extract"><a>Archive::Extract</a></dt>
<dd>
</dd>
<dt id="B::Lint"><a>B::Lint</a></dt>
<dd>
</dd>
<dt id="B::Lint::Debug"><a>B::Lint::Debug</a></dt>
<dd>
</dd>
<dt id="CPANPLUS-and-all-included-CPANPLUS::-modules"><a>CPANPLUS</a> and all included <code>CPANPLUS::*</code> modules</dt>
<dd>
</dd>
<dt id="Devel::InnerPackage"><a>Devel::InnerPackage</a></dt>
<dd>
</dd>
<dt id="Log::Message"><a>Log::Message</a></dt>
<dd>
</dd>
<dt id="Log::Message::Config"><a>Log::Message::Config</a></dt>
<dd>
</dd>
<dt id="Log::Message::Handlers"><a>Log::Message::Handlers</a></dt>
<dd>
</dd>
<dt id="Log::Message::Item"><a>Log::Message::Item</a></dt>
<dd>
</dd>
<dt id="Log::Message::Simple"><a>Log::Message::Simple</a></dt>
<dd>
</dd>
<dt id="Module::Pluggable"><a>Module::Pluggable</a></dt>
<dd>
</dd>
<dt id="Module::Pluggable::Object"><a>Module::Pluggable::Object</a></dt>
<dd>
</dd>
<dt id="Object::Accessor"><a>Object::Accessor</a></dt>
<dd>
</dd>
<dt id="Pod::LaTeX"><a>Pod::LaTeX</a></dt>
<dd>
</dd>
<dt id="Term::UI"><a>Term::UI</a></dt>
<dd>
</dd>
<dt id="Term::UI::History"><a>Term::UI::History</a></dt>
<dd>
</dd>
</dl>
<h2 id="Deprecated-Utilities">Deprecated Utilities</h2>
<p>The following utilities will be removed from the core distribution in a future release as their associated modules have been deprecated. They will remain available with the applicable CPAN distribution.</p>
<dl>
<dt id="cpanp"><a>cpanp</a></dt>
<dd>
</dd>
<dt id="cpanp-run-perl"><code>cpanp-run-perl</code></dt>
<dd>
</dd>
<dt id="cpan2dist"><a>cpan2dist</a></dt>
<dd>
<p>These items are part of the <code>CPANPLUS</code> distribution.</p>
</dd>
<dt id="pod2latex"><a>pod2latex</a></dt>
<dd>
<p>This item is part of the <code>Pod::LaTeX</code> distribution.</p>
</dd>
</dl>
<h2 id="PL_sv_objcount">PL_sv_objcount</h2>
<p>This interpreter-global variable used to track the total number of Perl objects in the interpreter. It is no longer maintained and will be removed altogether in Perl v5.20.</p>
<h2 id="Five-additional-characters-should-be-escaped-in-patterns-with-x">Five additional characters should be escaped in patterns with <code>/x</code></h2>
<p>When a regular expression pattern is compiled with <code>/x</code>, Perl treats 6 characters as white space to ignore, such as SPACE and TAB. However, Unicode recommends 11 characters be treated thusly. We will conform with this in a future Perl version. In the meantime, use of any of the missing characters will raise a deprecation warning, unless turned off. The five characters 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>
<h2 id="User-defined-charnames-with-surprising-whitespace">User-defined charnames with surprising whitespace</h2>
<p>A user-defined character name with trailing or multiple spaces in a row is likely a typo. This now generates a warning when defined, on the assumption that uses of it will be unlikely to include the excess whitespace.</p>
<h2 id="Various-XS-callable-functions-are-now-deprecated">Various XS-callable functions are now deprecated</h2>
<p>All the functions used to classify characters will be removed from a future version of Perl, and should not be used. With participating C compilers (e.g., gcc), compiling any file that uses any of these will generate a warning. These were not intended for public use; there are equivalent, faster, macros for most of them.</p>
<p>See <a href="/cperl/perlapi.html#Character-classes">"Character classes" in perlapi</a>. The complete list is:</p>
<p><code>is_uni_alnum</code>, <code>is_uni_alnumc</code>, <code>is_uni_alnumc_lc</code>, <code>is_uni_alnum_lc</code>, <code>is_uni_alpha</code>, <code>is_uni_alpha_lc</code>, <code>is_uni_ascii</code>, <code>is_uni_ascii_lc</code>, <code>is_uni_blank</code>, <code>is_uni_blank_lc</code>, <code>is_uni_cntrl</code>, <code>is_uni_cntrl_lc</code>, <code>is_uni_digit</code>, <code>is_uni_digit_lc</code>, <code>is_uni_graph</code>, <code>is_uni_graph_lc</code>, <code>is_uni_idfirst</code>, <code>is_uni_idfirst_lc</code>, <code>is_uni_lower</code>, <code>is_uni_lower_lc</code>, <code>is_uni_print</code>, <code>is_uni_print_lc</code>, <code>is_uni_punct</code>, <code>is_uni_punct_lc</code>, <code>is_uni_space</code>, <code>is_uni_space_lc</code>, <code>is_uni_upper</code>, <code>is_uni_upper_lc</code>, <code>is_uni_xdigit</code>, <code>is_uni_xdigit_lc</code>, <code>is_utf8_alnum</code>, <code>is_utf8_alnumc</code>, <code>is_utf8_alpha</code>, <code>is_utf8_ascii</code>, <code>is_utf8_blank</code>, <code>is_utf8_char</code>, <code>is_utf8_cntrl</code>, <code>is_utf8_digit</code>, <code>is_utf8_graph</code>, <code>is_utf8_idcont</code>, <code>is_utf8_idfirst</code>, <code>is_utf8_lower</code>, <code>is_utf8_mark</code>, <code>is_utf8_perl_space</code>, <code>is_utf8_perl_word</code>, <code>is_utf8_posix_digit</code>, <code>is_utf8_print</code>, <code>is_utf8_punct</code>, <code>is_utf8_space</code>, <code>is_utf8_upper</code>, <code>is_utf8_xdigit</code>, <code>is_utf8_xidcont</code>, <code>is_utf8_xidfirst</code>.</p>
<p>In addition these three functions that have never worked properly are deprecated: <code>to_uni_lower_lc</code>, <code>to_uni_title_lc</code>, and <code>to_uni_upper_lc</code>.</p>
<h2 id="Certain-rare-uses-of-backslashes-within-regexes-are-now-deprecated">Certain rare uses of backslashes within regexes are now deprecated</h2>
<p>There are three pairs of characters that Perl recognizes as metacharacters in regular expression patterns: <code>{}</code>, <code>[]</code>, and <code>()</code>. These can be used as well to delimit patterns, as in:</p>
<pre><code> m{foo}
s(foo)(bar)</code></pre>
<p>Since they are metacharacters, they have special meaning to regular expression patterns, and it turns out that you can't turn off that special meaning by the normal means of preceding them with a backslash, if you use them, paired, within a pattern delimited by them. For example, in</p>
<pre><code> m{foo\{1,3\}}</code></pre>
<p>the backslashes do not change the behavior, and this matches <span style="white-space: nowrap;"><code>"f o"</code></span> followed by one to three more occurrences of <code>"o"</code>.</p>
<p>Usages like this, where they are interpreted as metacharacters, are exceedingly rare; we think there are none, for example, in all of CPAN. Hence, this deprecation should affect very little code. It does give notice, however, that any such code needs to change, which will in turn allow us to change the behavior in future Perl versions so that the backslashes do have an effect, and without fear that we are silently breaking any existing code.</p>
<h2 id="Splitting-the-tokens-and-in-regular-expressions">Splitting the tokens <code>(?</code> and <code>(*</code> in regular expressions</h2>
<p>A deprecation warning is now raised if the <code>(</code> and <code>?</code> are separated by white space or comments in <code>(?...)</code> regular expression constructs. Similarly, if the <code>(</code> and <code>*</code> are separated in <code>(*VERB...)</code> constructs.</p>
<h2 id="Pre-PerlIO-IO-implementations">Pre-PerlIO IO implementations</h2>
<p>In theory, you can currently build perl without PerlIO. Instead, you'd use a wrapper around stdio or sfio. In practice, this isn't very useful. It's not well tested, and without any support for IO layers or (thus) Unicode, it's not much of a perl. Building without PerlIO will most likely be removed in the next version of perl.</p>
<p>PerlIO supports a <code>stdio</code> layer if stdio use is desired. Similarly a sfio layer could be produced in the future, if needed.</p>
<h1 id="Future-Deprecations">Future Deprecations</h1>
<ul>
<li><p>Platforms without support infrastructure</p>
<p>Both Windows CE and z/OS have been historically under-maintained, and are currently neither successfully building nor regularly being smoke tested. Efforts are underway to change this situation, but it should not be taken for granted that the platforms are safe and supported. If they do not become buildable and regularly smoked, support for them may be actively removed in future releases. If you have an interest in these platforms and you can lend your time, expertise, or hardware to help support these platforms, please let the perl development effort know by emailing <code>[email protected]</code>.</p>
<p>Some platforms that appear otherwise entirely dead are also on the short list for removal between now and v5.20.0:</p>
<dl>
<dt id="DG-UX">DG/UX</dt>
<dd>
</dd>
<dt id="NeXT">NeXT</dt>
<dd>
</dd>
</dl>
<p>We also think it likely that current versions of Perl will no longer build AmigaOS, DJGPP, NetWare (natively), OS/2 and Plan 9. If you are using Perl on such a platform and have an interest in ensuring Perl's future on them, please contact us.</p>
<p>We believe that Perl has long been unable to build on mixed endian architectures (such as PDP-11s), and intend to remove any remaining support code. Similarly, code supporting the long umaintained GNU dld will be removed soon if no-one makes themselves known as an active user.</p>
</li>
<li><p>Swapping of $< and $></p>
<p>Perl has supported the idiom of swapping $< and $> (and likewise $( and $)) to temporarily drop permissions since 5.0, like this:</p>
<pre><code> ($<, $>) = ($>, $<);</code></pre>
<p>However, this idiom modifies the real user/group id, which can have undesirable side-effects, is no longer useful on any platform perl supports and complicates the implementation of these variables and list assignment in general.</p>
<p>As an alternative, assignment only to <code>$></code> is recommended:</p>
<pre><code> local $> = $<;</code></pre>
<p>See also: <a href="http://www.cs.berkeley.edu/~daw/papers/setuid-usenix02.pdf">Setuid Demystified</a>.</p>
</li>
<li><p><code>microperl</code>, long broken and of unclear present purpose, will be removed.</p>
</li>
<li><p>Revamping <code>"\Q"</code> semantics in double-quotish strings when combined with other escapes.</p>
<p>There are several bugs and inconsistencies involving combinations of <code>\Q</code> and escapes like <code>\x</code>, <code>\L</code>, etc., within a <code>\Q...\E</code> pair. These need to be fixed, and doing so will necessarily change current behavior. The changes have not yet been settled.</p>
</li>
<li><p>Use of <code>$x</code>, where <code>x</code> stands for any actual (non-printing) C0 control character will be disallowed in a future Perl version. Use <code>${x}</code> instead (where again <code>x</code> stands for a control character), or better, <code>$^A</code> , where <code>^</code> is a caret (CIRCUMFLEX ACCENT), and <code>A</code> stands for any of the characters listed at the end of <a href="/cperl/perlebcdic.html#OPERATOR-DIFFERENCES">"OPERATOR DIFFERENCES" in perlebcdic</a>.</p>
</li>
</ul>
<h1 id="Performance-Enhancements">Performance Enhancements</h1>
<ul>
<li><p>Lists of lexical variable declarations (<code>my($x, $y)</code>) are now optimised down to a single op and are hence faster than before.</p>
</li>
<li><p>A new C preprocessor define <code>NO_TAINT_SUPPORT</code> was added that, if set, disables Perl's taint support altogether. Using the -T or -t command line flags will cause a fatal error. Beware that both core tests as well as many a CPAN distribution's tests will fail with this change. On the upside, it provides a small performance benefit due to reduced branching.</p>
<p><b>Do not enable this unless you know exactly what you are getting yourself into.</b></p>
</li>
<li><p><code>pack</code> with constant arguments is now constant folded in most cases [perl #113470].</p>
</li>
<li><p>Speed up in regular expression matching against Unicode properties. The largest gain is for <code>\X</code>, the Unicode "extended grapheme cluster." The gain for it is about 35% - 40%. Bracketed character classes, e.g., <code>[0-9\x{100}]</code> containing code points above 255 are also now faster.</p>
</li>
<li><p>On platforms supporting it, several former macros are now implemented as static inline functions. This should speed things up slightly on non-GCC platforms.</p>
</li>
<li><p>The optimisation of hashes in boolean context has been extended to affect <code>scalar(%hash)</code>, <code>%hash ? ... : ...</code>, and <code>sub { %hash || ... }</code>.</p>
</li>
<li><p>Filetest operators manage the stack in a fractionally more efficient manner.</p>
</li>
<li><p>Globs used in a numeric context are now numified directly in most cases, rather than being numified via stringification.</p>
</li>
<li><p>The <code>x</code> repetition operator is now folded to a single constant at compile time if called in scalar context with constant operands and no parentheses around the left operand.</p>
</li>
</ul>
<h1 id="Modules-and-Pragmata">Modules and Pragmata</h1>
<h2 id="New-Modules-and-Pragmata">New Modules and Pragmata</h2>
<ul>
<li><p><a href="/cperl/lib/Config/Perl/V.html">Config::Perl::V</a> version 0.16 has been added as a dual-lifed module. It provides structured data retrieval of <code>perl -V</code> output including information only known to the <code>perl</code> binary and not available via <a href="/cperl/lib/Config.html">Config</a>.</p>
</li>
</ul>
<h2 id="Updated-Modules-and-Pragmata">Updated Modules and Pragmata</h2>
<p>For a complete list of updates, run:</p>
<pre><code> $ corelist --diff 5.16.0 5.18.0</code></pre>
<p>You can substitute your favorite version in place of <code>5.16.0</code>, too.</p>
<ul>
<li><p><a>Archive::Extract</a> has been upgraded to 0.68.</p>
<p>Work around an edge case on Linux with Busybox's unzip.</p>
</li>
<li><p><a href="/cperl/lib/Archive/Tar.html">Archive::Tar</a> has been upgraded to 1.90.</p>
<p>ptar now supports the -T option as well as dashless options [rt.cpan.org #75473], [rt.cpan.org #75475].</p>
<p>Auto-encode filenames marked as UTF-8 [rt.cpan.org #75474].</p>
<p>Don't use <code>tell</code> on <a href="/cperl/lib/IO/Zlib.html">IO::Zlib</a> handles [rt.cpan.org #64339].</p>
<p>Don't try to <code>chown</code> on symlinks.</p>
</li>
<li><p><a href="/cperl/lib/autodie.html">autodie</a> has been upgraded to 2.13.</p>
<p><code>autodie</code> now plays nicely with the 'open' pragma.</p>
</li>
<li><p><a href="/cperl/lib/B.html">B</a> has been upgraded to 1.42.</p>
<p>The <code>stashoff</code> method of COPs has been added. This provides access to an internal field added in perl 5.16 under threaded builds [perl #113034].</p>
<p><code>B::COP::stashpv</code> now supports UTF-8 package names and embedded NULs.</p>
<p>All <code>CVf_*</code> and <code>GVf_*</code> and more SV-related flag values are now provided as constants in the <code>B::</code> namespace and available for export. The default export list has not changed.</p>
<p>This makes the module work with the new pad API.</p>
</li>
<li><p><a href="/cperl/lib/B/Concise.html">B::Concise</a> has been upgraded to 0.95.</p>
<p>The <code>-nobanner</code> option has been fixed, and <code>format</code>s can now be dumped. When passed a sub name to dump, it will check also to see whether it is the name of a format. If a sub and a format share the same name, it will dump both.</p>
<p>This adds support for the new <code>OpMAYBE_TRUEBOOL</code> and <code>OPpTRUEBOOL</code> flags.</p>
</li>
<li><p><a>B::Debug</a> has been upgraded to 1.18.</p>
<p>This adds support (experimentally) for <code>B::PADLIST</code>, which was added in Perl 5.17.4.</p>
</li>
<li><p><a href="/cperl/lib/B/Deparse.html">B::Deparse</a> has been upgraded to 1.20.</p>
<p>Avoid warning when run under <code>perl -w</code>.</p>
<p>It now deparses loop controls with the correct precedence, and multiple statements in a <code>format</code> line are also now deparsed correctly.</p>
<p>This release suppresses trailing semicolons in formats.</p>
<p>This release adds stub deparsing for lexical subroutines.</p>
<p>It no longer dies when deparsing <code>sort</code> without arguments. It now correctly omits the comma for <code>system $prog @args</code> and <code>exec $prog @args</code>.</p>
</li>
<li><p><a href="/cperl/lib/bignum.html">bignum</a>, <a href="/cperl/lib/bigint.html">bigint</a> and <a href="/cperl/lib/bigrat.html">bigrat</a> have been upgraded to 0.33.</p>
<p>The overrides for <code>hex</code> and <code>oct</code> have been rewritten, eliminating several problems, and making one incompatible change:</p>
<ul>
<li><p>Formerly, whichever of <code>use bigint</code> or <code>use bigrat</code> was compiled later would take precedence over the other, causing <code>hex</code> and <code>oct</code> not to respect the other pragma when in scope.</p>
</li>
<li><p>Using any of these three pragmata would cause <code>hex</code> and <code>oct</code> anywhere else in the program to evaluate their arguments in list context and prevent them from inferring $_ when called without arguments.</p>
</li>
<li><p>Using any of these three pragmata would make <code>oct("1234")</code> return 1234 (for any number not beginning with 0) anywhere in the program. Now "1234" is translated from octal to decimal, whether within the pragma's scope or not.</p>
</li>
<li><p>The global overrides that facilitate lexical use of <code>hex</code> and <code>oct</code> now respect any existing overrides that were in place before the new overrides were installed, falling back to them outside of the scope of <code>use bignum</code>.</p>
</li>
<li><p><code>use bignum "hex"</code>, <code>use bignum "oct"</code> and similar invocations for bigint and bigrat now export a <code>hex</code> or <code>oct</code> function, instead of providing a global override.</p>
</li>
</ul>
</li>
<li><p><a href="/cperl/lib/Carp.html">Carp</a> has been upgraded to 1.29.</p>
<p>Carp is no longer confused when <code>caller</code> returns undef for a package that has been deleted.</p>
<p>The <code>longmess()</code> and <code>shortmess()</code> functions are now documented.</p>
</li>
<li><p><a>CGI</a> has been upgraded to 3.63.</p>
<p>Unrecognized HTML escape sequences are now handled better, problematic trailing newlines are no longer inserted after <form> tags by <code>startform()</code> or <code>start_form()</code>, and bogus "Insecure Dependency" warnings appearing with some versions of perl are now worked around.</p>
</li>
<li><p><a href="/cperl/lib/Class/Struct.html">Class::Struct</a> has been upgraded to 0.64.</p>
<p>The constructor now respects overridden accessor methods [perl #29230].</p>
</li>
<li><p><a href="/cperl/lib/Compress/Raw/Bzip2.html">Compress::Raw::Bzip2</a> has been upgraded to 2.060.</p>
<p>The misuse of Perl's "magic" API has been fixed.</p>
</li>
<li><p><a href="/cperl/lib/Compress/Raw/Zlib.html">Compress::Raw::Zlib</a> has been upgraded to 2.060.</p>
<p>Upgrade bundled zlib to version 1.2.7.</p>
<p>Fix build failures on Irix, Solaris, and Win32, and also when building as C++ [rt.cpan.org #69985], [rt.cpan.org #77030], [rt.cpan.org #75222].</p>
<p>The misuse of Perl's "magic" API has been fixed.</p>
<p><code>compress()</code>, <code>uncompress()</code>, <code>memGzip()</code> and <code>memGunzip()</code> have been speeded up by making parameter validation more efficient.</p>
</li>
<li><p><a href="/cperl/lib/CPAN/Meta/Requirements.html">CPAN::Meta::Requirements</a> has been upgraded to 2.122.</p>
<p>Treat undef requirements to <code>from_string_hash</code> as 0 (with a warning).</p>
<p>Added <code>requirements_for_module</code> method.</p>
</li>
<li><p><a>CPANPLUS</a> has been upgraded to 0.9135.</p>
<p>Allow adding <i>blib/script</i> to PATH.</p>
<p>Save the history between invocations of the shell.</p>
<p>Handle multiple <code>makemakerargs</code> and <code>makeflags</code> arguments better.</p>
<p>This resolves issues with the SQLite source engine.</p>
</li>
<li><p><a href="/cperl/lib/Data/Dumper.html">Data::Dumper</a> has been upgraded to 2.145.</p>
<p>It has been optimized to only build a seen-scalar hash as necessary, thereby speeding up serialization drastically.</p>
<p>Additional tests were added in order to improve statement, branch, condition and subroutine coverage. On the basis of the coverage analysis, some of the internals of Dumper.pm were refactored. Almost all methods are now documented.</p>
</li>
<li><p><a href="/cperl/lib/DB_File.html">DB_File</a> has been upgraded to 1.827.</p>
<p>The main Perl module no longer uses the <code>"@_"</code> construct.</p>
</li>
<li><p><a href="/cperl/lib/Devel/Peek.html">Devel::Peek</a> has been upgraded to 1.11.</p>
<p>This fixes compilation with C++ compilers and makes the module work with the new pad API.</p>
</li>
<li><p><a href="/cperl/lib/Digest/MD5.html">Digest::MD5</a> has been upgraded to 2.52.</p>
<p>Fix <code>Digest::Perl::MD5</code> OO fallback [rt.cpan.org #66634].</p>
</li>
<li><p><a href="/cperl/lib/Digest/SHA.html">Digest::SHA</a> has been upgraded to 5.84.</p>
<p>This fixes a double-free bug, which might have caused vulnerabilities in some cases.</p>
</li>
<li><p><a href="/cperl/lib/DynaLoader.html">DynaLoader</a> has been upgraded to 1.18.</p>
<p>This is due to a minor code change in the XS for the VMS implementation.</p>
<p>This fixes warnings about using <code>CODE</code> sections without an <code>OUTPUT</code> section.</p>
</li>
<li><p><a href="/cperl/lib/Encode.html">Encode</a> has been upgraded to 2.49.</p>
<p>The Mac alias x-mac-ce has been added, and various bugs have been fixed in Encode::Unicode, Encode::UTF7 and Encode::GSM0338.</p>
</li>
<li><p><a href="/cperl/lib/Env.html">Env</a> has been upgraded to 1.04.</p>
<p>Its SPLICE implementation no longer misbehaves in list context.</p>
</li>
<li><p><a href="/cperl/lib/ExtUtils/CBuilder.html">ExtUtils::CBuilder</a> has been upgraded to 0.280210.</p>
<p>Manifest files are now correctly embedded for those versions of VC++ which make use of them. [perl #111782, #111798].</p>
<p>A list of symbols to export can now be passed to <code>link()</code> when on Windows, as on other OSes [perl #115100].</p>
</li>
<li><p><a href="/cperl/lib/ExtUtils/ParseXS.html">ExtUtils::ParseXS</a> has been upgraded to 3.18.</p>
<p>The generated C code now avoids unnecessarily incrementing <code>PL_amagic_generation</code> on Perl versions where it's done automatically (or on current Perl where the variable no longer exists).</p>
<p>This avoids a bogus warning for initialised XSUB non-parameters [perl #112776].</p>
</li>
<li><p><a href="/cperl/lib/File/Copy.html">File::Copy</a> has been upgraded to 2.26.</p>
<p><code>copy()</code> no longer zeros files when copying into the same directory, and also now fails (as it has long been documented to do) when attempting to copy a file over itself.</p>
</li>
<li><p><a href="/cperl/lib/File/DosGlob.html">File::DosGlob</a> has been upgraded to 1.10.</p>
<p>The internal cache of file names that it keeps for each caller is now freed when that caller is freed. This means <code>use File::DosGlob 'glob'; eval 'scalar <*>'</code> no longer leaks memory.</p>
</li>
<li><p><a href="/cperl/lib/File/Fetch.html">File::Fetch</a> has been upgraded to 0.38.</p>
<p>Added the 'file_default' option for URLs that do not have a file component.</p>
<p>Use <code>File::HomeDir</code> when available, and provide <code>PERL5_CPANPLUS_HOME</code> to override the autodetection.</p>
<p>Always re-fetch <i>CHECKSUMS</i> if <code>fetchdir</code> is set.</p>
</li>
<li><p><a href="/cperl/lib/File/Find.html">File::Find</a> has been upgraded to 1.23.</p>
<p>This fixes inconsistent unixy path handling on VMS.</p>
<p>Individual files may now appear in list of directories to be searched [perl #59750].</p>
</li>
<li><p><a href="/cperl/lib/File/Glob.html">File::Glob</a> has been upgraded to 1.20.</p>