-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathperl5160delta.html
2843 lines (1809 loc) · 172 KB
/
perl5160delta.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>perl5160delta - what is new for perl v5.16.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="#Notice">Notice</a></li>
<li><a href="#Core-Enhancements">Core Enhancements</a>
<ul>
<li><a href="#use-VERSION">use VERSION</a></li>
<li><a href="#SUB__">__SUB__</a></li>
<li><a href="#New-and-Improved-Built-ins">New and Improved Built-ins</a>
<ul>
<li><a href="#More-consistent-eval">More consistent eval</a></li>
<li><a href="#substr-lvalue-revamp">substr lvalue revamp</a></li>
<li><a href="#Return-value-of-tied">Return value of tied</a></li>
</ul>
</li>
<li><a href="#Unicode-Support">Unicode Support</a>
<ul>
<li><a href="#Supports-almost-Unicode-6.1">Supports (almost) Unicode 6.1</a></li>
<li><a href="#use-charnames-is-no-longer-needed-for-N-name">use charnames is no longer needed for \N{name}</a></li>
<li><a href="#N-...-can-now-have-Unicode-loose-name-matching">\N{...} can now have Unicode loose name matching</a></li>
<li><a href="#Unicode-Symbol-Names">Unicode Symbol Names</a></li>
<li><a href="#Improved-ability-to-mix-locales-and-Unicode-including-UTF-8-locales">Improved ability to mix locales and Unicode, including UTF-8 locales</a></li>
<li><a href="#New-function-fc-and-corresponding-escape-sequence-F-for-Unicode-foldcase">New function fc and corresponding escape sequence \F for Unicode foldcase</a></li>
<li><a href="#The-Unicode-Script_Extensions-property-is-now-supported">The Unicode Script_Extensions property is now supported.</a></li>
</ul>
</li>
<li><a href="#XS-Changes">XS Changes</a>
<ul>
<li><a href="#Improved-typemaps-for-Some-Builtin-Types">Improved typemaps for Some Builtin Types</a></li>
<li><a href="#is_utf8_char">is_utf8_char()</a></li>
<li><a href="#Added-is_utf8_char_buf">Added is_utf8_char_buf()</a></li>
<li><a href="#Other-is_utf8_foo-functions-as-well-as-utf8_to_foo-etc">Other is_utf8_foo() functions, as well as utf8_to_foo(), etc.</a></li>
<li><a href="#New-Pad-API">New Pad API</a></li>
</ul>
</li>
<li><a href="#Changes-to-Special-Variables">Changes to Special Variables</a>
<ul>
<li><a href="#can-be-assigned-to">$$ can be assigned to</a></li>
<li><a href="#X-converted-to-an-absolute-path-on-FreeBSD-OS-X-and-Solaris">$^X converted to an absolute path on FreeBSD, OS X and Solaris</a></li>
</ul>
</li>
<li><a href="#Debugger-Changes">Debugger Changes</a>
<ul>
<li><a href="#Features-inside-the-debugger">Features inside the debugger</a></li>
<li><a href="#New-option-for-the-debuggers-t-command">New option for the debugger's t command</a></li>
<li><a href="#enable-and-disable">enable and disable</a></li>
<li><a href="#Breakpoints-with-file-names">Breakpoints with file names</a></li>
</ul>
</li>
<li><a href="#The-CORE-Namespace">The CORE Namespace</a>
<ul>
<li><a href="#The-CORE::-prefix">The CORE:: prefix</a></li>
<li><a href="#Subroutines-in-the-CORE-namespace">Subroutines in the CORE namespace</a></li>
</ul>
</li>
<li><a href="#Other-Changes">Other Changes</a>
<ul>
<li><a href="#Anonymous-handles">Anonymous handles</a></li>
<li><a href="#Autoloaded-sort-Subroutines">Autoloaded sort Subroutines</a></li>
<li><a href="#continue-no-longer-requires-the-switch-feature">continue no longer requires the "switch" feature</a></li>
<li><a href="#DTrace-probes-for-interpreter-phase-change">DTrace probes for interpreter phase change</a></li>
<li><a href="#FILE__-Syntax">__FILE__() Syntax</a></li>
<li><a href="#The-prototype-accepts-any-scalar-lvalue">The \$ prototype accepts any scalar lvalue</a></li>
<li><a href="#in-subroutine-prototypes">_ in subroutine prototypes</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#Security">Security</a>
<ul>
<li><a href="#Use-is_utf8_char_buf-and-not-is_utf8_char">Use is_utf8_char_buf() and not is_utf8_char()</a></li>
<li><a href="#Malformed-UTF-8-input-could-cause-attempts-to-read-beyond-the-end-of-the-buffer">Malformed UTF-8 input could cause attempts to read beyond the end of the buffer</a></li>
<li><a href="#File::Glob::bsd_glob-memory-error-with-GLOB_ALTDIRFUNC-CVE-2011-2728">File::Glob::bsd_glob() memory error with GLOB_ALTDIRFUNC (CVE-2011-2728).</a></li>
<li><a href="#Privileges-are-now-set-correctly-when-assigning-to">Privileges are now set correctly when assigning to $(</a></li>
</ul>
</li>
<li><a href="#Deprecations">Deprecations</a>
<ul>
<li><a href="#Dont-read-the-Unicode-data-base-files-in-lib-unicore">Don't read the Unicode data base files in lib/unicore</a></li>
<li><a href="#XS-functions-is_utf8_char-utf8_to_uvchr-and-utf8_to_uvuni">XS functions is_utf8_char(), utf8_to_uvchr() and utf8_to_uvuni()</a></li>
</ul>
</li>
<li><a href="#Future-Deprecations">Future Deprecations</a>
<ul>
<li><a href="#Core-Modules">Core Modules</a></li>
<li><a href="#Platforms-with-no-supporting-programmers">Platforms with no supporting programmers</a></li>
<li><a href="#Other-Future-Deprecations">Other Future Deprecations</a></li>
</ul>
</li>
<li><a href="#Incompatible-Changes">Incompatible Changes</a>
<ul>
<li><a href="#Special-blocks-called-in-void-context">Special blocks called in void context</a></li>
<li><a href="#The-overloading-pragma-and-regexp-objects">The overloading pragma and regexp objects</a></li>
<li><a href="#Two-XS-typemap-Entries-removed">Two XS typemap Entries removed</a></li>
<li><a href="#Unicode-6.1-has-incompatibilities-with-Unicode-6.0">Unicode 6.1 has incompatibilities with Unicode 6.0</a></li>
<li><a href="#Borland-compiler">Borland compiler</a></li>
<li><a href="#Certain-deprecated-Unicode-properties-are-no-longer-supported-by-default">Certain deprecated Unicode properties are no longer supported by default</a></li>
<li><a href="#Dereferencing-IO-thingies-as-typeglobs">Dereferencing IO thingies as typeglobs</a></li>
<li><a href="#User-defined-case-changing-operations">User-defined case-changing operations</a></li>
<li><a href="#XSUBs-are-now-static">XSUBs are now 'static'</a></li>
<li><a href="#Weakening-read-only-references">Weakening read-only references</a></li>
<li><a href="#Tying-scalars-that-hold-typeglobs">Tying scalars that hold typeglobs</a></li>
<li><a href="#IPC::Open3-no-longer-provides-xfork-xclose_on_exec-and-xpipe_anon">IPC::Open3 no longer provides xfork(), xclose_on_exec() and xpipe_anon()</a></li>
<li><a href="#no-longer-caches-PID">$$ no longer caches PID</a></li>
<li><a href="#and-getppid-no-longer-emulate-POSIX-semantics-under-LinuxThreads">$$ and getppid() no longer emulate POSIX semantics under LinuxThreads</a></li>
<li><a href="#and-are-no-longer-cached">$<, $>, $( and $) are no longer cached</a></li>
<li><a href="#Which-Non-ASCII-characters-get-quoted-by-quotemeta-and-Q-has-changed">Which Non-ASCII characters get quoted by quotemeta and \Q has changed</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="#Deprecated-Modules">Deprecated Modules</a></li>
<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="#New-Documentation">New Documentation</a>
<ul>
<li><a href="#perldtrace">perldtrace</a></li>
<li><a href="#perlexperiment">perlexperiment</a></li>
<li><a href="#perlootut">perlootut</a></li>
<li><a href="#perlxstypemap">perlxstypemap</a></li>
</ul>
</li>
<li><a href="#Changes-to-Existing-Documentation">Changes to Existing Documentation</a>
<ul>
<li><a href="#perlapi">perlapi</a></li>
<li><a href="#perlfunc">perlfunc</a></li>
<li><a href="#perlguts">perlguts</a></li>
<li><a href="#perlobj">perlobj</a></li>
<li><a href="#perlop">perlop</a></li>
<li><a href="#perlpragma">perlpragma</a></li>
<li><a href="#Laundering-and-Detecting-Tainted-Data-in-perlsec">"Laundering and Detecting Tainted Data" in perlsec</a></li>
<li><a href="#perllol">perllol</a></li>
<li><a href="#perlmod">perlmod</a></li>
<li><a href="#perlpodstyle">perlpodstyle</a></li>
<li><a href="#perlre">perlre</a></li>
<li><a href="#perlrun">perlrun</a></li>
<li><a href="#perlsub">perlsub</a></li>
<li><a href="#perltie">perltie</a></li>
<li><a href="#perlvar">perlvar</a></li>
<li><a href="#Other-Changes1">Other Changes</a></li>
</ul>
</li>
<li><a href="#Removed-Documentation">Removed Documentation</a>
<ul>
<li><a href="#Old-OO-Documentation">Old OO Documentation</a></li>
<li><a href="#Development-Deltas">Development Deltas</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="#Removed-Errors">Removed Errors</a></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="#h2ph">h2ph</a></li>
<li><a href="#splain">splain</a></li>
<li><a href="#zipdetails">zipdetails</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#Configuration-and-Compilation">Configuration and Compilation</a></li>
<li><a href="#Platform-Support">Platform Support</a>
<ul>
<li><a href="#Platform-Specific-Notes">Platform-Specific Notes</a>
<ul>
<li><a href="#Cygwin">Cygwin</a></li>
<li><a href="#HP-UX">HP-UX</a></li>
<li><a href="#VMS">VMS</a></li>
<li><a href="#GNU-Hurd">GNU/Hurd</a></li>
<li><a href="#OpenVOS">OpenVOS</a></li>
<li><a href="#SunOS">SunOS</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>
<ul>
<li><a href="#Array-and-hash">Array and hash</a></li>
<li><a href="#C-API-fixes">C API fixes</a></li>
<li><a href="#Compile-time-hints">Compile-time hints</a></li>
<li><a href="#Copy-on-write-scalars">Copy-on-write scalars</a></li>
<li><a href="#The-debugger">The debugger</a></li>
<li><a href="#Dereferencing-operators">Dereferencing operators</a></li>
<li><a href="#Filehandle-last-accessed">Filehandle, last-accessed</a></li>
<li><a href="#Filetests-and-stat">Filetests and stat</a></li>
<li><a href="#Formats">Formats</a></li>
<li><a href="#given-and-when">given and when</a></li>
<li><a href="#The-glob-operator">The glob operator</a></li>
<li><a href="#Lvalue-subroutines">Lvalue subroutines</a></li>
<li><a href="#Overloading">Overloading</a></li>
<li><a href="#Prototypes-of-built-in-keywords">Prototypes of built-in keywords</a></li>
<li><a href="#Regular-expressions">Regular expressions</a></li>
<li><a href="#Smartmatching">Smartmatching</a></li>
<li><a href="#The-sort-operator">The sort operator</a></li>
<li><a href="#The-substr-operator">The substr operator</a></li>
<li><a href="#Support-for-embedded-nulls">Support for embedded nulls</a></li>
<li><a href="#Threading-bugs">Threading bugs</a></li>
<li><a href="#Tied-variables">Tied variables</a></li>
<li><a href="#Version-objects-and-vstrings">Version objects and vstrings</a></li>
<li><a href="#Warnings-redefinition">Warnings, redefinition</a></li>
<li><a href="#Warnings-Uninitialized">Warnings, "Uninitialized"</a></li>
<li><a href="#Weak-references">Weak references</a></li>
<li><a href="#Other-notable-fixes">Other notable fixes</a></li>
</ul>
</li>
<li><a href="#Known-Problems">Known Problems</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>perl5160delta - what is new for perl v5.16.0</p>
<h1 id="DESCRIPTION">DESCRIPTION</h1>
<p>This document describes differences between the 5.14.0 release and the 5.16.0 release.</p>
<p>If you are upgrading from an earlier release such as 5.12.0, first read <a href="/cperl/perl5140delta.html">perl5140delta</a>, which describes differences between 5.12.0 and 5.14.0.</p>
<p>Some bug fixes in this release have been backported to later releases of 5.14.x. Those are indicated with the 5.14.x version in parentheses.</p>
<h1 id="Notice">Notice</h1>
<p>With the release of Perl 5.16.0, the 5.12.x series of releases is now out of its support period. There may be future 5.12.x releases, but only in the event of a critical security issue. Users of Perl 5.12 or earlier should consider upgrading to a more recent release of Perl.</p>
<p>This policy is described in greater detail in <a href="/cperl/perlpolicy.html#MAINTENANCE-AND-SUPPORT">perlpolicy</a>.</p>
<h1 id="Core-Enhancements">Core Enhancements</h1>
<h2 id="use-VERSION"><code>use <i>VERSION</i></code></h2>
<p>As of this release, version declarations like <code>use v5.16</code> now disable all features before enabling the new feature bundle. This means that the following holds true:</p>
<pre><code> use 5.016;
# only 5.16 features enabled here
use 5.014;
# only 5.14 features enabled here (not 5.16)</code></pre>
<p><code>use v5.12</code> and higher continue to enable strict, but explicit <code>use strict</code> and <code>no strict</code> now override the version declaration, even when they come first:</p>
<pre><code> no strict;
use 5.012;
# no strict here</code></pre>
<p>There is a new ":default" feature bundle that represents the set of features enabled before any version declaration or <code>use feature</code> has been seen. Version declarations below 5.10 now enable the ":default" feature set. This does not actually change the behavior of <code>use v5.8</code>, because features added to the ":default" set are those that were traditionally enabled by default, before they could be turned off.</p>
<p><code>no feature</code> now resets to the default feature set. To disable all features (which is likely to be a pretty special-purpose request, since it presumably won't match any named set of semantics) you can now write <code>no feature ':all'</code>.</p>
<p><code>$[</code> is now disabled under <code>use v5.16</code>. It is part of the default feature set and can be turned on or off explicitly with <code>use feature 'array_base'</code>.</p>
<h2 id="SUB__"><code>__SUB__</code></h2>
<p>The new <code>__SUB__</code> token, available under the <code>current_sub</code> feature (see <a href="/cperl/lib/feature.html">feature</a>) or <code>use v5.16</code>, returns a reference to the current subroutine, making it easier to write recursive closures.</p>
<h2 id="New-and-Improved-Built-ins">New and Improved Built-ins</h2>
<h3 id="More-consistent-eval">More consistent <code>eval</code></h3>
<p>The <code>eval</code> operator sometimes treats a string argument as a sequence of characters and sometimes as a sequence of bytes, depending on the internal encoding. The internal encoding is not supposed to make any difference, but there is code that relies on this inconsistency.</p>
<p>The new <code>unicode_eval</code> and <code>evalbytes</code> features (enabled under <code>use 5.16.0</code>) resolve this. The <code>unicode_eval</code> feature causes <code>eval $string</code> to treat the string always as Unicode. The <code>evalbytes</code> features provides a function, itself called <code>evalbytes</code>, which evaluates its argument always as a string of bytes.</p>
<p>These features also fix oddities with source filters leaking to outer dynamic scopes.</p>
<p>See <a href="/cperl/lib/feature.html">feature</a> for more detail.</p>
<h3 id="substr-lvalue-revamp"><code>substr</code> lvalue revamp</h3>
<p>When <code>substr</code> is called in lvalue or potential lvalue context with two or three arguments, a special lvalue scalar is returned that modifies the original string (the first argument) when assigned to.</p>
<p>Previously, the offsets (the second and third arguments) passed to <code>substr</code> would be converted immediately to match the string, negative offsets being translated to positive and offsets beyond the end of the string being truncated.</p>
<p>Now, the offsets are recorded without modification in the special lvalue scalar that is returned, and the original string is not even looked at by <code>substr</code> itself, but only when the returned lvalue is read or modified.</p>
<p>These changes result in an incompatible change:</p>
<p>If the original string changes length after the call to <code>substr</code> but before assignment to its return value, negative offsets will remember their position from the end of the string, affecting code like this:</p>
<pre><code> my $string = "string";
my $lvalue = \substr $string, -4, 2;
print $$lvalue, "\n"; # prints "ri"
$string = "bailing twine";
print $$lvalue, "\n"; # prints "wi"; used to print "il"</code></pre>
<p>The same thing happens with an omitted third argument. The returned lvalue will always extend to the end of the string, even if the string becomes longer.</p>
<p>Since this change also allowed many bugs to be fixed (see <a href="#The-substr-operator">"The <code>substr</code> operator"</a>), and since the behavior of negative offsets has never been specified, the change was deemed acceptable.</p>
<h3 id="Return-value-of-tied">Return value of <code>tied</code></h3>
<p>The value returned by <code>tied</code> on a tied variable is now the actual scalar that holds the object to which the variable is tied. This lets ties be weakened with <code>Scalar::Util::weaken(tied $tied_variable)</code>.</p>
<h2 id="Unicode-Support">Unicode Support</h2>
<h3 id="Supports-almost-Unicode-6.1">Supports (<i>almost</i>) Unicode 6.1</h3>
<p>Besides the addition of whole new scripts, and new characters in existing scripts, this new version of Unicode, as always, makes some changes to existing characters. One change that may trip up some applications is that the General Category of two characters in the Latin-1 range, PILCROW SIGN and SECTION SIGN, has been changed from Other_Symbol to Other_Punctuation. The same change has been made for a character in each of Tibetan, Ethiopic, and Aegean. The code points U+3248..U+324F (CIRCLED NUMBER TEN ON BLACK SQUARE through CIRCLED NUMBER EIGHTY ON BLACK SQUARE) have had their General Category changed from Other_Symbol to Other_Numeric. The Line Break property has changes for Hebrew and Japanese; and because of other changes in 6.1, the Perl regular expression construct <code>\X</code> now works differently for some characters in Thai and Lao.</p>
<p>New aliases (synonyms) have been defined for many property values; these, along with the previously existing ones, are all cross-indexed in <a href="/cperl/perluniprops.html">perluniprops</a>.</p>
<p>The return value of <code>charnames::viacode()</code> is affected by other changes:</p>
<pre><code> Code point Old Name New Name
U+000A LINE FEED (LF) LINE FEED
U+000C FORM FEED (FF) FORM FEED
U+000D CARRIAGE RETURN (CR) CARRIAGE RETURN
U+0085 NEXT LINE (NEL) NEXT LINE
U+008E SINGLE-SHIFT 2 SINGLE-SHIFT-2
U+008F SINGLE-SHIFT 3 SINGLE-SHIFT-3
U+0091 PRIVATE USE 1 PRIVATE USE-1
U+0092 PRIVATE USE 2 PRIVATE USE-2
U+2118 SCRIPT CAPITAL P WEIERSTRASS ELLIPTIC FUNCTION</code></pre>
<p>Perl will accept any of these names as input, but <code>charnames::viacode()</code> now returns the new name of each pair. The change for U+2118 is considered by Unicode to be a correction, that is the original name was a mistake (but again, it will remain forever valid to use it to refer to U+2118). But most of these changes are the fallout of the mistake Unicode 6.0 made in naming a character used in Japanese cell phones to be "BELL", which conflicts with the longstanding industry use of (and Unicode's recommendation to use) that name to mean the ASCII control character at U+0007. Therefore, that name has been deprecated in Perl since v5.14, and any use of it will raise a warning message (unless turned off). The name "ALERT" is now the preferred name for this code point, with "BEL" an acceptable short form. The name for the new cell phone character, at code point U+1F514, remains undefined in this version of Perl (hence we don't implement quite all of Unicode 6.1), but starting in v5.18, BELL will mean this character, and not U+0007.</p>
<p>Unicode has taken steps to make sure that this sort of mistake does not happen again. The Standard now includes all generally accepted names and abbreviations for control characters, whereas previously it didn't (though there were recommended names for most of them, which Perl used). This means that most of those recommended names are now officially in the Standard. Unicode did not recommend names for the four code points listed above between U+008E and U+008F, and in standardizing them Unicode subtly changed the names that Perl had previously given them, by replacing the final blank in each name by a hyphen. Unicode also officially accepts names that Perl had deprecated, such as FILE SEPARATOR. Now the only deprecated name is BELL. Finally, Perl now uses the new official names instead of the old (now considered obsolete) names for the first four code points in the list above (the ones which have the parentheses in them).</p>
<p>Now that the names have been placed in the Unicode standard, these kinds of changes should not happen again, though corrections, such as to U+2118, are still possible.</p>
<p>Unicode also added some name abbreviations, which Perl now accepts: SP for SPACE; TAB for CHARACTER TABULATION; NEW LINE, END OF LINE, NL, and EOL for LINE FEED; LOCKING-SHIFT ONE for SHIFT OUT; LOCKING-SHIFT ZERO for SHIFT IN; and ZWNBSP for ZERO WIDTH NO-BREAK SPACE.</p>
<p>More details on this version of Unicode are provided in <a href="http://www.unicode.org/versions/Unicode6.1.0/">http://www.unicode.org/versions/Unicode6.1.0/</a>.</p>
<h3 id="use-charnames-is-no-longer-needed-for-N-name"><code>use charnames</code> is no longer needed for <code>\N{<i>name</i>}</code></h3>
<p>When <code>\N{<i>name</i>}</code> is encountered, the <code>charnames</code> module is now automatically loaded when needed as if the <code>:full</code> and <code>:short</code> options had been specified. See <a href="/cperl/lib/charnames.html">charnames</a> for more information.</p>
<h3 id="N-...-can-now-have-Unicode-loose-name-matching"><code>\N{...}</code> can now have Unicode loose name matching</h3>
<p>This is described in the <code>charnames</code> item in <a href="#Updated-Modules-and-Pragmata">"Updated Modules and Pragmata"</a> below.</p>
<h3 id="Unicode-Symbol-Names">Unicode Symbol Names</h3>
<p>Perl now has proper support for Unicode in symbol names. It used to be that <code>*{$foo}</code> would ignore the internal UTF8 flag and use the bytes of the underlying representation to look up the symbol. That meant that <code>*{"\x{100}"}</code> and <code>*{"\xc4\x80"}</code> would return the same thing. All these parts of Perl have been fixed to account for Unicode:</p>
<ul>
<li><p>Method names (including those passed to <code>use overload</code>)</p>
</li>
<li><p>Typeglob names (including names of variables, subroutines, and filehandles)</p>
</li>
<li><p>Package names</p>
</li>
<li><p><code>goto</code></p>
</li>
<li><p>Symbolic dereferencing</p>
</li>
<li><p>Second argument to <code>bless()</code> and <code>tie()</code></p>
</li>
<li><p>Return value of <code>ref()</code></p>
</li>
<li><p>Subroutine prototypes</p>
</li>
<li><p>Attributes</p>
</li>
<li><p>Various warnings and error messages that mention variable names or values, methods, etc.</p>
</li>
</ul>
<p>In addition, a parsing bug has been fixed that prevented <code>*{é}</code> from implicitly quoting the name, but instead interpreted it as <code>*{+é}</code>, which would cause a strict violation.</p>
<p><code>*{"*a::b"}</code> automatically strips off the * if it is followed by an ASCII letter. That has been extended to all Unicode identifier characters.</p>
<p>One-character non-ASCII non-punctuation variables (like <code>$é</code>) are now subject to "Used only once" warnings. They used to be exempt, as they were treated as punctuation variables.</p>
<p>Also, single-character Unicode punctuation variables (like <code>$‰</code>) are now supported [perl #69032].</p>
<h3 id="Improved-ability-to-mix-locales-and-Unicode-including-UTF-8-locales">Improved ability to mix locales and Unicode, including UTF-8 locales</h3>
<p>An optional parameter has been added to <code>use locale</code></p>
<pre><code> use locale ':not_characters';</code></pre>
<p>which tells Perl to use all but the <code>LC_CTYPE</code> and <code>LC_COLLATE</code> portions of the current locale. Instead, the character set is assumed to be Unicode. This lets locales and Unicode be seamlessly mixed, including the increasingly frequent UTF-8 locales. When using this hybrid form of locales, the <code>:locale</code> layer to the <a href="/cperl/lib/open.html">open</a> pragma can be used to interface with the file system, and there are CPAN modules available for ARGV and environment variable conversions.</p>
<p>Full details are in <a href="/cperl/perllocale.html">perllocale</a>.</p>
<h3 id="New-function-fc-and-corresponding-escape-sequence-F-for-Unicode-foldcase">New function <code>fc</code> and corresponding escape sequence <code>\F</code> for Unicode foldcase</h3>
<p>Unicode foldcase is an extension to lowercase that gives better results when comparing two strings case-insensitively. It has long been used internally in regular expression <code>/i</code> matching. Now it is available explicitly through the new <code>fc</code> function call (enabled by <span style="white-space: nowrap;"><code>"use feature 'fc'"</code></span>, or <code>use v5.16</code>, or explicitly callable via <code>CORE::fc</code>) or through the new <code>\F</code> sequence in double-quotish strings.</p>
<p>Full details are in <a href="/cperl/perlfunc.html#fc">"fc" in perlfunc</a>.</p>
<h3 id="The-Unicode-Script_Extensions-property-is-now-supported">The Unicode <code>Script_Extensions</code> property is now supported.</h3>
<p>New in Unicode 6.0, this is an improved <code>Script</code> property. Details are in <a href="/cperl/perlunicode.html#Scripts">"Scripts" in perlunicode</a>.</p>
<h2 id="XS-Changes">XS Changes</h2>
<h3 id="Improved-typemaps-for-Some-Builtin-Types">Improved typemaps for Some Builtin Types</h3>
<p>Most XS authors will know there is a longstanding bug in the OUTPUT typemap for T_AVREF (<code>AV*</code>), T_HVREF (<code>HV*</code>), T_CVREF (<code>CV*</code>), and T_SVREF (<code>SVREF</code> or <code>\$foo</code>) that requires manually decrementing the reference count of the return value instead of the typemap taking care of this. For backwards-compatibility, this cannot be changed in the default typemaps. But we now provide additional typemaps <code>T_AVREF_REFCOUNT_FIXED</code>, etc. that do not exhibit this bug. Using them in your extension is as simple as having one line in your <code>TYPEMAP</code> section:</p>
<pre><code> HV* T_HVREF_REFCOUNT_FIXED</code></pre>
<h3 id="is_utf8_char"><code>is_utf8_char()</code></h3>
<p>The XS-callable function <code>is_utf8_char()</code>, when presented with malformed UTF-8 input, can read up to 12 bytes beyond the end of the string. This cannot be fixed without changing its API, and so its use is now deprecated. Use <code>is_utf8_char_buf()</code> (described just below) instead.</p>
<h3 id="Added-is_utf8_char_buf">Added <code>is_utf8_char_buf()</code></h3>
<p>This function is designed to replace the deprecated <a href="#is_utf8_char">"is_utf8_char()"</a> function. It includes an extra parameter to make sure it doesn't read past the end of the input buffer.</p>
<h3 id="Other-is_utf8_foo-functions-as-well-as-utf8_to_foo-etc">Other <code>is_utf8_foo()</code> functions, as well as <code>utf8_to_foo()</code>, etc.</h3>
<p>Most other XS-callable functions that take UTF-8 encoded input implicitly assume that the UTF-8 is valid (not malformed) with respect to buffer length. Do not do things such as change a character's case or see if it is alphanumeric without first being sure that it is valid UTF-8. This can be safely done for a whole string by using one of the functions <code>is_utf8_string()</code>, <code>is_utf8_string_loc()</code>, and <code>is_utf8_string_loclen()</code>.</p>
<h3 id="New-Pad-API">New Pad API</h3>
<p>Many new functions have been added to the API for manipulating lexical pads. See <a href="/cperl/perlapi.html#Pad-Data-Structures">"Pad Data Structures" in perlapi</a> for more information.</p>
<h2 id="Changes-to-Special-Variables">Changes to Special Variables</h2>
<h3 id="can-be-assigned-to"><code>$$</code> can be assigned to</h3>
<p><code>$$</code> was made read-only in Perl 5.8.0. But only sometimes: <code>local $$</code> would make it writable again. Some CPAN modules were using <code>local $$</code> or XS code to bypass the read-only check, so there is no reason to keep <code>$$</code> read-only. (This change also allowed a bug to be fixed while maintaining backward compatibility.)</p>
<h3 id="X-converted-to-an-absolute-path-on-FreeBSD-OS-X-and-Solaris"><code>$^X</code> converted to an absolute path on FreeBSD, OS X and Solaris</h3>
<p><code>$^X</code> is now converted to an absolute path on OS X, FreeBSD (without needing <i>/proc</i> mounted) and Solaris 10 and 11. This augments the previous approach of using <i>/proc</i> on Linux, FreeBSD, and NetBSD (in all cases, where mounted).</p>
<p>This makes relocatable perl installations more useful on these platforms. (See "Relocatable @INC" in <i>INSTALL</i>)</p>
<h2 id="Debugger-Changes">Debugger Changes</h2>
<h3 id="Features-inside-the-debugger">Features inside the debugger</h3>
<p>The current Perl's <a href="/cperl/lib/feature.html">feature</a> bundle is now enabled for commands entered in the interactive debugger.</p>
<h3 id="New-option-for-the-debuggers-t-command">New option for the debugger's <b>t</b> command</h3>
<p>The <b>t</b> command in the debugger, which toggles tracing mode, now accepts a numeric argument that determines how many levels of subroutine calls to trace.</p>
<h3 id="enable-and-disable"><code>enable</code> and <code>disable</code></h3>
<p>The debugger now has <code>disable</code> and <code>enable</code> commands for disabling existing breakpoints and re-enabling them. See <a href="/cperl/perldebug.html">perldebug</a>.</p>
<h3 id="Breakpoints-with-file-names">Breakpoints with file names</h3>
<p>The debugger's "b" command for setting breakpoints now lets a line number be prefixed with a file name. See <a href="/cperl/perldebug.html#b-file-:-line-condition">"b [file]:[line] [condition]" in perldebug</a>.</p>
<h2 id="The-CORE-Namespace">The <code>CORE</code> Namespace</h2>
<h3 id="The-CORE::-prefix">The <code>CORE::</code> prefix</h3>
<p>The <code>CORE::</code> prefix can now be used on keywords enabled by <a href="/cperl/lib/feature.html">feature.pm</a>, even outside the scope of <code>use feature</code>.</p>
<h3 id="Subroutines-in-the-CORE-namespace">Subroutines in the <code>CORE</code> namespace</h3>
<p>Many Perl keywords are now available as subroutines in the CORE namespace. This lets them be aliased:</p>
<pre><code> BEGIN { *entangle = \&CORE::tie }
entangle $variable, $package, @args;</code></pre>
<p>And for prototypes to be bypassed:</p>
<pre><code> sub mytie(\[%$*@]$@) {
my ($ref, $pack, @args) = @_;
... do something ...
goto &CORE::tie;
}</code></pre>
<p>Some of these cannot be called through references or via <code>&foo</code> syntax, but must be called as barewords.</p>
<p>See <a href="/cperl/lib/CORE.html">CORE</a> for details.</p>
<h2 id="Other-Changes">Other Changes</h2>
<h3 id="Anonymous-handles">Anonymous handles</h3>
<p>Automatically generated file handles are now named __ANONIO__ when the variable name cannot be determined, rather than $__ANONIO__.</p>
<h3 id="Autoloaded-sort-Subroutines">Autoloaded sort Subroutines</h3>
<p>Custom sort subroutines can now be autoloaded [perl #30661]:</p>
<pre><code> sub AUTOLOAD { ... }
@sorted = sort foo @list; # uses AUTOLOAD</code></pre>
<h3 id="continue-no-longer-requires-the-switch-feature"><code>continue</code> no longer requires the "switch" feature</h3>
<p>The <code>continue</code> keyword has two meanings. It can introduce a <code>continue</code> block after a loop, or it can exit the current <code>when</code> block. Up to now, the latter meaning was valid only with the "switch" feature enabled, and was a syntax error otherwise. Since the main purpose of feature.pm is to avoid conflicts with user-defined subroutines, there is no reason for <code>continue</code> to depend on it.</p>
<h3 id="DTrace-probes-for-interpreter-phase-change">DTrace probes for interpreter phase change</h3>
<p>The <code>phase-change</code> probes will fire when the interpreter's phase changes, which tracks the <code>${^GLOBAL_PHASE}</code> variable. <code>arg0</code> is the new phase name; <code>arg1</code> is the old one. This is useful for limiting your instrumentation to one or more of: compile time, run time, or destruct time.</p>
<h3 id="FILE__-Syntax"><code>__FILE__()</code> Syntax</h3>
<p>The <code>__FILE__</code>, <code>__LINE__</code> and <code>__PACKAGE__</code> tokens can now be written with an empty pair of parentheses after them. This makes them parse the same way as <code>time</code>, <code>fork</code> and other built-in functions.</p>
<h3 id="The-prototype-accepts-any-scalar-lvalue">The <code>\$</code> prototype accepts any scalar lvalue</h3>
<p>The <code>\$</code> and <code>\[$]</code> subroutine prototypes now accept any scalar lvalue argument. Previously they accepted only scalars beginning with <code>$</code> and hash and array elements. This change makes them consistent with the way the built-in <code>read</code> and <code>recv</code> functions (among others) parse their arguments. This means that one can override the built-in functions with custom subroutines that parse their arguments the same way.</p>
<h3 id="in-subroutine-prototypes"><code>_</code> in subroutine prototypes</h3>
<p>The <code>_</code> character in subroutine prototypes is now allowed before <code>@</code> or <code>%</code>.</p>
<h1 id="Security">Security</h1>
<h2 id="Use-is_utf8_char_buf-and-not-is_utf8_char">Use <code>is_utf8_char_buf()</code> and not <code>is_utf8_char()</code></h2>
<p>The latter function is now deprecated because its API is insufficient to guarantee that it doesn't read (up to 12 bytes in the worst case) beyond the end of its input string. See <a href="#Added-is_utf8_char_buf">is_utf8_char_buf()</a>.</p>
<h2 id="Malformed-UTF-8-input-could-cause-attempts-to-read-beyond-the-end-of-the-buffer">Malformed UTF-8 input could cause attempts to read beyond the end of the buffer</h2>
<p>Two new XS-accessible functions, <code>utf8_to_uvchr_buf()</code> and <code>utf8_to_uvuni_buf()</code> are now available to prevent this, and the Perl core has been converted to use them. See <a href="#Internal-Changes">"Internal Changes"</a>.</p>
<h2 id="File::Glob::bsd_glob-memory-error-with-GLOB_ALTDIRFUNC-CVE-2011-2728"><code>File::Glob::bsd_glob()</code> memory error with GLOB_ALTDIRFUNC (CVE-2011-2728).</h2>
<p>Calling <code>File::Glob::bsd_glob</code> with the unsupported flag GLOB_ALTDIRFUNC would cause an access violation / segfault. A Perl program that accepts a flags value from an external source could expose itself to denial of service or arbitrary code execution attacks. There are no known exploits in the wild. The problem has been corrected by explicitly disabling all unsupported flags and setting unused function pointers to null. Bug reported by Clément Lecigne. (5.14.2)</p>
<h2 id="Privileges-are-now-set-correctly-when-assigning-to">Privileges are now set correctly when assigning to <code>$(</code></h2>
<p>A hypothetical bug (probably unexploitable in practice) because the incorrect setting of the effective group ID while setting <code>$(</code> has been fixed. The bug would have affected only systems that have <code>setresgid()</code> but not <code>setregid()</code>, but no such systems are known to exist.</p>
<h1 id="Deprecations">Deprecations</h1>
<h2 id="Dont-read-the-Unicode-data-base-files-in-lib-unicore">Don't read the Unicode data base files in <i>lib/unicore</i></h2>
<p>It is now deprecated to directly read the Unicode data base files. These are stored in the <i>lib/unicore</i> directory. Instead, you should use the new functions in <a href="/cperl/lib/Unicode/UCD.html">Unicode::UCD</a>. These provide a stable API, and give complete information.</p>
<p>Perl may at some point in the future change or remove these files. The file which applications were most likely to have used is <i>lib/unicore/ToDigit.pl</i>. <a href="/cperl/lib/Unicode/UCD.html#prop_invmap">"prop_invmap()" in Unicode::UCD</a> can be used to get at its data instead.</p>
<h2 id="XS-functions-is_utf8_char-utf8_to_uvchr-and-utf8_to_uvuni">XS functions <code>is_utf8_char()</code>, <code>utf8_to_uvchr()</code> and <code>utf8_to_uvuni()</code></h2>
<p>This function is deprecated because it could read beyond the end of the input string. Use the new <a href="#Added-is_utf8_char_buf">is_utf8_char_buf()</a>, <code>utf8_to_uvchr_buf()</code> and <code>utf8_to_uvuni_buf()</code> instead.</p>
<h1 id="Future-Deprecations">Future Deprecations</h1>
<p>This section serves as a notice of features that are <i>likely</i> to be removed or <a href="/cperl/perlpolicy.html#deprecated">deprecated</a> in the next release of perl (5.18.0). If your code depends on these features, you should contact the Perl 5 Porters via the <a href="http://lists.perl.org/list/perl5-porters.html">mailing list</a> or <a>perlbug</a> to explain your use case and inform the deprecation process.</p>
<h2 id="Core-Modules">Core Modules</h2>
<p>These modules may be marked as deprecated <i>from the core</i>. This only means that they will no longer be installed by default with the core distribution, but will remain available on the CPAN.</p>
<ul>
<li><p>CPANPLUS</p>
</li>
<li><p>Filter::Simple</p>
</li>
<li><p>PerlIO::mmap</p>
</li>
<li><p>Pod::LaTeX</p>
</li>
<li><p>Pod::Parser</p>
</li>
<li><p>SelfLoader</p>
</li>
<li><p>Text::Soundex</p>
</li>
<li><p>Thread.pm</p>
</li>
</ul>
<h2 id="Platforms-with-no-supporting-programmers">Platforms with no supporting programmers</h2>
<p>These platforms will probably have their special build support removed during the 5.17.0 development series.</p>
<ul>
<li><p>BeOS</p>
</li>
<li><p>djgpp</p>
</li>
<li><p>dgux</p>
</li>
<li><p>EPOC</p>
</li>
<li><p>MPE/iX</p>
</li>
<li><p>Rhapsody</p>
</li>
<li><p>UTS</p>
</li>
<li><p>VM/ESA</p>
</li>
</ul>
<h2 id="Other-Future-Deprecations">Other Future Deprecations</h2>
<ul>
<li><p>Swapping of $< and $></p>
<p>For more information about this future deprecation, see <a href="https://rt.perl.org/rt3/Ticket/Display.html?id=96212">the relevant RT ticket</a>.</p>
</li>
<li><p>sfio, stdio</p>
<p>Perl supports being built without PerlIO proper, using a stdio or sfio wrapper instead. A perl build like this will not support IO layers and thus Unicode IO, making it rather handicapped.</p>
<p>PerlIO supports a <code>stdio</code> layer if stdio use is desired, and similarly a sfio layer could be produced.</p>
</li>
<li><p>Unescaped literal <code>"{"</code> in regular expressions.</p>
<p>Starting with v5.20, it is planned to require a literal <code>"{"</code> to be escaped, for example by preceding it with a backslash. In v5.18, a deprecated warning message will be emitted for all such uses. This affects only patterns that are to match a literal <code>"{"</code>. Other uses of this character, such as part of a quantifier or sequence as in those below, are completely unaffected:</p>
<pre><code> /foo{3,5}/
/\p{Alphabetic}/
/\N{DIGIT ZERO}</code></pre>
<p>Removing this will permit extensions to Perl's pattern syntax and better error checking for existing syntax. See <a href="/cperl/perlre.html#Quantifiers">"Quantifiers" in perlre</a> for an example.</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>
</ul>
<h1 id="Incompatible-Changes">Incompatible Changes</h1>
<h2 id="Special-blocks-called-in-void-context">Special blocks called in void context</h2>
<p>Special blocks (<code>BEGIN</code>, <code>CHECK</code>, <code>INIT</code>, <code>UNITCHECK</code>, <code>END</code>) are now called in void context. This avoids wasteful copying of the result of the last statement [perl #108794].</p>
<h2 id="The-overloading-pragma-and-regexp-objects">The <code>overloading</code> pragma and regexp objects</h2>
<p>With <code>no overloading</code>, regular expression objects returned by <code>qr//</code> are now stringified as "Regexp=REGEXP(0xbe600d)" instead of the regular expression itself [perl #108780].</p>
<h2 id="Two-XS-typemap-Entries-removed">Two XS typemap Entries removed</h2>
<p>Two presumably unused XS typemap entries have been removed from the core typemap: T_DATAUNIT and T_CALLBACK. If you are, against all odds, a user of these, please see the instructions on how to restore them in <a href="/cperl/perlxstypemap.html">perlxstypemap</a>.</p>
<h2 id="Unicode-6.1-has-incompatibilities-with-Unicode-6.0">Unicode 6.1 has incompatibilities with Unicode 6.0</h2>
<p>These are detailed in <a href="#Supports-almost-Unicode-6.1">"Supports (almost) Unicode 6.1"</a> above. You can compile this version of Perl to use Unicode 6.0. See <a href="/cperl/perlunicode.html#Hacking-Perl-to-work-on-earlier-Unicode-versions-for-very-serious-hackers-only">"Hacking Perl to work on earlier Unicode versions (for very serious hackers only)" in perlunicode</a>.</p>
<h2 id="Borland-compiler">Borland compiler</h2>
<p>All support for the Borland compiler has been dropped. The code had not worked for a long time anyway.</p>
<h2 id="Certain-deprecated-Unicode-properties-are-no-longer-supported-by-default">Certain deprecated Unicode properties are no longer supported by default</h2>
<p>Perl should never have exposed certain Unicode properties that are used by Unicode internally and not meant to be publicly available. Use of these has generated deprecated warning messages since Perl 5.12. The removed properties are Other_Alphabetic, Other_Default_Ignorable_Code_Point, Other_Grapheme_Extend, Other_ID_Continue, Other_ID_Start, Other_Lowercase, Other_Math, and Other_Uppercase.</p>
<p>Perl may be recompiled to include any or all of them; instructions are given in <a href="/cperl/perluniprops.html#Unicode-character-properties-that-are-NOT-accepted-by-Perl">"Unicode character properties that are NOT accepted by Perl" in perluniprops</a>.</p>
<h2 id="Dereferencing-IO-thingies-as-typeglobs">Dereferencing IO thingies as typeglobs</h2>
<p>The <code>*{...}</code> operator, when passed a reference to an IO thingy (as in <code>*{*STDIN{IO}}</code>), creates a new typeglob containing just that IO object. Previously, it would stringify as an empty string, but some operators would treat it as undefined, producing an "uninitialized" warning. Now it stringifies as __ANONIO__ [perl #96326].</p>
<h2 id="User-defined-case-changing-operations">User-defined case-changing operations</h2>
<p>This feature was deprecated in Perl 5.14, and has now been removed. The CPAN module <a>Unicode::Casing</a> provides better functionality without the drawbacks that this feature had, as are detailed in the 5.14 documentation: <a href="http://perldoc.perl.org/5.14.0/perlunicode.html#User-Defined-Case-Mappings-%28for-serious-hackers-only%29">http://perldoc.perl.org/5.14.0/perlunicode.html#User-Defined-Case-Mappings-%28for-serious-hackers-only%29</a></p>
<h2 id="XSUBs-are-now-static">XSUBs are now 'static'</h2>
<p>XSUB C functions are now 'static', that is, they are not visible from outside the compilation unit. Users can use the new <code>XS_EXTERNAL(name)</code> and <code>XS_INTERNAL(name)</code> macros to pick the desired linking behavior. The ordinary <code>XS(name)</code> declaration for XSUBs will continue to declare non-'static' XSUBs for compatibility, but the XS compiler, <a href="/cperl/lib/ExtUtils/ParseXS.html">ExtUtils::ParseXS</a> (<code>xsubpp</code>) will emit 'static' XSUBs by default. <a href="/cperl/lib/ExtUtils/ParseXS.html">ExtUtils::ParseXS</a>'s behavior can be reconfigured from XS using the <code>EXPORT_XSUB_SYMBOLS</code> keyword. See <a href="/cperl/perlxs.html">perlxs</a> for details.</p>
<h2 id="Weakening-read-only-references">Weakening read-only references</h2>
<p>Weakening read-only references is no longer permitted. It should never have worked anyway, and could sometimes result in crashes.</p>
<h2 id="Tying-scalars-that-hold-typeglobs">Tying scalars that hold typeglobs</h2>
<p>Attempting to tie a scalar after a typeglob was assigned to it would instead tie the handle in the typeglob's IO slot. This meant that it was impossible to tie the scalar itself. Similar problems affected <code>tied</code> and <code>untie</code>: <code>tied $scalar</code> would return false on a tied scalar if the last thing returned was a typeglob, and <code>untie $scalar</code> on such a tied scalar would do nothing.</p>
<p>We fixed this problem before Perl 5.14.0, but it caused problems with some CPAN modules, so we put in a deprecation cycle instead.</p>
<p>Now the deprecation has been removed and this bug has been fixed. So <code>tie $scalar</code> will always tie the scalar, not the handle it holds. To tie the handle, use <code>tie *$scalar</code> (with an explicit asterisk). The same applies to <code>tied *$scalar</code> and <code>untie *$scalar</code>.</p>
<h2 id="IPC::Open3-no-longer-provides-xfork-xclose_on_exec-and-xpipe_anon">IPC::Open3 no longer provides <code>xfork()</code>, <code>xclose_on_exec()</code> and <code>xpipe_anon()</code></h2>
<p>All three functions were private, undocumented, and unexported. They do not appear to be used by any code on CPAN. Two have been inlined and one deleted entirely.</p>
<h2 id="no-longer-caches-PID"><code>$$</code> no longer caches PID</h2>
<p>Previously, if one called fork(3) from C, Perl's notion of <code>$$</code> could go out of sync with what getpid() returns. By always fetching the value of <code>$$</code> via getpid(), this potential bug is eliminated. Code that depends on the caching behavior will break. As described in <a href="#can-be-assigned-to">Core Enhancements</a>, <code>$$</code> is now writable, but it will be reset during a fork.</p>
<h2 id="and-getppid-no-longer-emulate-POSIX-semantics-under-LinuxThreads"><code>$$</code> and <code>getppid()</code> no longer emulate POSIX semantics under LinuxThreads</h2>
<p>The POSIX emulation of <code>$$</code> and <code>getppid()</code> under the obsolete LinuxThreads implementation has been removed. This only impacts users of Linux 2.4 and users of Debian GNU/kFreeBSD up to and including 6.0, not the vast majority of Linux installations that use NPTL threads.</p>
<p>This means that <code>getppid()</code>, like <code>$$</code>, is now always guaranteed to return the OS's idea of the current state of the process, not perl's cached version of it.</p>
<p>See the documentation for <a href="/cperl/perlvar.html#pod">$$</a> for details.</p>
<h2 id="and-are-no-longer-cached"><code>$<</code>, <code>$></code>, <code>$(</code> and <code>$)</code> are no longer cached</h2>
<p>Similarly to the changes to <code>$$</code> and <code>getppid()</code>, the internal caching of <code>$<</code>, <code>$></code>, <code>$(</code> and <code>$)</code> has been removed.</p>
<p>When we cached these values our idea of what they were would drift out of sync with reality if someone (e.g., someone embedding perl) called <code>sete?[ug]id()</code> without updating <code>PL_e?[ug]id</code>. Having to deal with this complexity wasn't worth it given how cheap the <code>gete?[ug]id()</code> system call is.</p>
<p>This change will break a handful of CPAN modules that use the XS-level <code>PL_uid</code>, <code>PL_gid</code>, <code>PL_euid</code> or <code>PL_egid</code> variables.</p>
<p>The fix for those breakages is to use <code>PerlProc_gete?[ug]id()</code> to retrieve them (e.g., <code>PerlProc_getuid()</code>), and not to assign to <code>PL_e?[ug]id</code> if you change the UID/GID/EUID/EGID. There is no longer any need to do so since perl will always retrieve the up-to-date version of those values from the OS.</p>
<h2 id="Which-Non-ASCII-characters-get-quoted-by-quotemeta-and-Q-has-changed">Which Non-ASCII characters get quoted by <code>quotemeta</code> and <code>\Q</code> has changed</h2>
<p>This is unlikely to result in a real problem, as Perl does not attach special meaning to any non-ASCII character, so it is currently irrelevant which are quoted or not. This change fixes bug [perl #77654] and brings Perl's behavior more into line with Unicode's recommendations. See <a href="/cperl/perlfunc.html#quotemeta">"quotemeta" in perlfunc</a>.</p>
<h1 id="Performance-Enhancements">Performance Enhancements</h1>
<ul>
<li><p>Improved performance for Unicode properties in regular expressions</p>
<p>Matching a code point against a Unicode property is now done via a binary search instead of linear. This means for example that the worst case for a 1000 item property is 10 probes instead of 1000. This inefficiency has been compensated for in the past by permanently storing in a hash the results of a given probe plus the results for the adjacent 64 code points, under the theory that near-by code points are likely to be searched for. A separate hash was used for each mention of a Unicode property in each regular expression. Thus, <code>qr/\p{foo}abc\p{foo}/</code> would generate two hashes. Any probes in one instance would be unknown to the other, and the hashes could expand separately to be quite large if the regular expression were used on many different widely-separated code points. Now, however, there is just one hash shared by all instances of a given property. This means that if <code>\p{foo}</code> is matched against "A" in one regular expression in a thread, the result will be known immediately to all regular expressions, and the relentless march of using up memory is slowed considerably.</p>
</li>
<li><p>Version declarations with the <code>use</code> keyword (e.g., <code>use 5.012</code>) are now faster, as they enable features without loading <i>feature.pm</i>.</p>
</li>
<li><p><code>local $_</code> is faster now, as it no longer iterates through magic that it is not going to copy anyway.</p>
</li>
<li><p>Perl 5.12.0 sped up the destruction of objects whose classes define empty <code>DESTROY</code> methods (to prevent autoloading), by simply not calling such empty methods. This release takes this optimization a step further, by not calling any <code>DESTROY</code> method that begins with a <code>return</code> statement. This can be useful for destructors that are only used for debugging:</p>
<pre><code> use constant DEBUG => 1;
sub DESTROY { return unless DEBUG; ... }</code></pre>
<p>Constant-folding will reduce the first statement to <code>return;</code> if DEBUG is set to 0, triggering this optimization.</p>
</li>
<li><p>Assigning to a variable that holds a typeglob or copy-on-write scalar is now much faster. Previously the typeglob would be stringified or the copy-on-write scalar would be copied before being clobbered.</p>
</li>
<li><p>Assignment to <code>substr</code> in void context is now more than twice its previous speed. Instead of creating and returning a special lvalue scalar that is then assigned to, <code>substr</code> modifies the original string itself.</p>
</li>
<li><p><code>substr</code> no longer calculates a value to return when called in void context.</p>
</li>
<li><p>Due to changes in <a href="/cperl/lib/File/Glob.html">File::Glob</a>, Perl's <code>glob</code> function and its <code><...></code> equivalent are now much faster. The splitting of the pattern into words has been rewritten in C, resulting in speed-ups of 20% for some cases.</p>
<p>This does not affect <code>glob</code> on VMS, as it does not use File::Glob.</p>
</li>
<li><p>The short-circuiting operators <code>&&</code>, <code>||</code>, and <code>//</code>, when chained (such as <code>$a || $b || $c</code>), are now considerably faster to short-circuit, due to reduced optree traversal.</p>
</li>
<li><p>The implementation of <code>s///r</code> makes one fewer copy of the scalar's value.</p>
</li>
<li><p>Recursive calls to lvalue subroutines in lvalue scalar context use less memory.</p>
</li>
</ul>
<h1 id="Modules-and-Pragmata">Modules and Pragmata</h1>
<h2 id="Deprecated-Modules">Deprecated Modules</h2>
<dl>
<dt id="Version::Requirements"><a>Version::Requirements</a></dt>
<dd>
<p>Version::Requirements is now DEPRECATED, use <a href="/cperl/lib/CPAN/Meta/Requirements.html">CPAN::Meta::Requirements</a>, which is a drop-in replacement. It will be deleted from perl.git blead in v5.17.0.</p>
</dd>
</dl>
<h2 id="New-Modules-and-Pragmata">New Modules and Pragmata</h2>
<ul>
<li><p><a>arybase</a> -- this new module implements the <code>$[</code> variable.</p>
</li>
<li><p><a href="/cperl/lib/PerlIO/mmap.html">PerlIO::mmap</a> 0.010 has been added to the Perl core.</p>
<p>The <code>mmap</code> PerlIO layer is no longer implemented by perl itself, but has been moved out into the new <a href="/cperl/lib/PerlIO/mmap.html">PerlIO::mmap</a> module.</p>
</li>
</ul>
<h2 id="Updated-Modules-and-Pragmata">Updated Modules and Pragmata</h2>
<p>This is only an overview of selected module updates. For a complete list of updates, run:</p>
<pre><code> $ corelist --diff 5.14.0 5.16.0</code></pre>
<p>You can substitute your favorite version in place of 5.14.0, too.</p>
<ul>
<li><p><a>Archive::Extract</a> has been upgraded from version 0.48 to 0.58.</p>
<p>Includes a fix for FreeBSD to only use <code>unzip</code> if it is located in <code>/usr/local/bin</code>, as FreeBSD 9.0 will ship with a limited <code>unzip</code> in <code>/usr/bin</code>.</p>
</li>
<li><p><a href="/cperl/lib/Archive/Tar.html">Archive::Tar</a> has been upgraded from version 1.76 to 1.82.</p>
<p>Adjustments to handle files >8gb (>0777777777777 octal) and a feature to return the MD5SUM of files in the archive.</p>
</li>
<li><p><a href="/cperl/lib/base.html">base</a> has been upgraded from version 2.16 to 2.18.</p>
<p><code>base</code> no longer sets a module's <code>$VERSION</code> to "-1" when a module it loads does not define a <code>$VERSION</code>. This change has been made because "-1" is not a valid version number under the new "lax" criteria used internally by <code>UNIVERSAL::VERSION</code>. (See <a href="/cperl/lib/version.html">version</a> for more on "lax" version criteria.)</p>
<p><code>base</code> no longer internally skips loading modules it has already loaded and instead relies on <code>require</code> to inspect <code>%INC</code>. This fixes a bug when <code>base</code> is used with code that clear <code>%INC</code> to force a module to be reloaded.</p>
</li>
<li><p><a href="/cperl/lib/Carp.html">Carp</a> has been upgraded from version 1.20 to 1.26.</p>
<p>It now includes last read filehandle info and puts a dot after the file and line number, just like errors from <code>die</code> [perl #106538].</p>
</li>
<li><p><a href="/cperl/lib/charnames.html">charnames</a> has been updated from version 1.18 to 1.30.</p>
<p><code>charnames</code> can now be invoked with a new option, <code>:loose</code>, which is like the existing <code>:full</code> option, but enables Unicode loose name matching. Details are in <a href="/cperl/lib/charnames.html#LOOSE-MATCHES">"LOOSE MATCHES" in charnames</a>.</p>
</li>
<li><p><a href="/cperl/lib/B/Deparse.html">B::Deparse</a> has been upgraded from version 1.03 to 1.14. This fixes numerous deparsing bugs.</p>
</li>
<li><p><a>CGI</a> has been upgraded from version 3.52 to 3.59.</p>
<p>It uses the public and documented FCGI.pm API in CGI::Fast. CGI::Fast was using an FCGI API that was deprecated and removed from documentation more than ten years ago. Usage of this deprecated API with FCGI >= 0.70 or FCGI <= 0.73 introduces a security issue. <a href="https://rt.cpan.org/Public/Bug/Display.html?id=68380">https://rt.cpan.org/Public/Bug/Display.html?id=68380</a> <a href="http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-2766">http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-2766</a></p>
<p>Things that may break your code:</p>
<p><code>url()</code> was fixed to return <code>PATH_INFO</code> when it is explicitly requested with either the <code>path=>1</code> or <code>path_info=>1</code> flag.</p>
<p>If your code is running under mod_rewrite (or compatible) and you are calling <code>self_url()</code> or you are calling <code>url()</code> and passing <code>path_info=>1</code>, these methods will actually be returning <code>PATH_INFO</code> now, as you have explicitly requested or <code>self_url()</code> has requested on your behalf.</p>
<p>The <code>PATH_INFO</code> has been omitted in such URLs since the issue was introduced in the 3.12 release in December, 2005.</p>
<p>This bug is so old your application may have come to depend on it or workaround it. Check for application before upgrading to this release.</p>
<p>Examples of affected method calls:</p>
<pre><code> $q->url(-absolute => 1, -query => 1, -path_info => 1);
$q->url(-path=>1);
$q->url(-full=>1,-path=>1);
$q->url(-rewrite=>1,-path=>1);
$q->self_url();</code></pre>
<p>We no longer read from STDIN when the Content-Length is not set, preventing requests with no Content-Length from sometimes freezing. This is consistent with the CGI RFC 3875, and is also consistent with CGI::Simple. However, the old behavior may have been expected by some command-line uses of CGI.pm.</p>
<p>In addition, the DELETE HTTP verb is now supported.</p>
</li>
<li><p><a href="/cperl/lib/Compress/Zlib.html">Compress::Zlib</a> has been upgraded from version 2.035 to 2.048.</p>
<p>IO::Compress::Zip and IO::Uncompress::Unzip now have support for LZMA (method 14). There is a fix for a CRC issue in IO::Compress::Unzip and it supports Streamed Stored context now. And fixed a Zip64 issue in IO::Compress::Zip when the content size was exactly 0xFFFFFFFF.</p>
</li>
<li><p><a href="/cperl/lib/Digest/SHA.html">Digest::SHA</a> has been upgraded from version 5.61 to 5.71.</p>
<p>Added BITS mode to the addfile method and shasum. This makes partial-byte inputs possible via files/STDIN and lets shasum check all 8074 NIST Msg vectors, where previously special programming was required to do this.</p>
</li>
<li><p><a href="/cperl/lib/Encode.html">Encode</a> has been upgraded from version 2.42 to 2.44.</p>
<p>Missing aliases added, a deep recursion error fixed and various documentation updates.</p>
<p>Addressed 'decode_xs n-byte heap-overflow' security bug in Unicode.xs (CVE-2011-2939). (5.14.2)</p>
</li>
<li><p><a href="/cperl/lib/ExtUtils/CBuilder.html">ExtUtils::CBuilder</a> updated from version 0.280203 to 0.280206.</p>
<p>The new version appends CFLAGS and LDFLAGS to their Config.pm counterparts.</p>
</li>
<li><p><a href="/cperl/lib/ExtUtils/ParseXS.html">ExtUtils::ParseXS</a> has been upgraded from version 2.2210 to 3.16.</p>
<p>Much of <a href="/cperl/lib/ExtUtils/ParseXS.html">ExtUtils::ParseXS</a>, the module behind the XS compiler <code>xsubpp</code>, was rewritten and cleaned up. It has been made somewhat more extensible and now finally uses strictures.</p>
<p>The typemap logic has been moved into a separate module, <a href="/cperl/lib/ExtUtils/Typemaps.html">ExtUtils::Typemaps</a>. See <a href="#New-Modules-and-Pragmata">"New Modules and Pragmata"</a>, above.</p>
<p>For a complete set of changes, please see the ExtUtils::ParseXS changelog, available on the CPAN.</p>
</li>
<li><p><a href="/cperl/lib/File/Glob.html">File::Glob</a> has been upgraded from version 1.12 to 1.17.</p>
<p>On Windows, tilde (~) expansion now checks the <code>USERPROFILE</code> environment variable, after checking <code>HOME</code>.</p>
<p>It has a new <code>:bsd_glob</code> export tag, intended to replace <code>:glob</code>. Like <code>:glob</code> it overrides <code>glob</code> with a function that does not split the glob pattern into words, but, unlike <code>:glob</code>, it iterates properly in scalar context, instead of returning the last file.</p>
<p>There are other changes affecting Perl's own <code>glob</code> operator (which uses File::Glob internally, except on VMS). See <a href="#Performance-Enhancements">"Performance Enhancements"</a> and <a href="#Selected-Bug-Fixes">"Selected Bug Fixes"</a>.</p>
</li>
<li><p><a href="/cperl/lib/FindBin.html">FindBin</a> updated from version 1.50 to 1.51.</p>
<p>It no longer returns a wrong result if a script of the same name as the current one exists in the path and is executable.</p>
</li>
<li><p><a href="/cperl/lib/HTTP/Tiny.html">HTTP::Tiny</a> has been upgraded from version 0.012 to 0.017.</p>
<p>Added support for using <code>$ENV{http_proxy}</code> to set the default proxy host.</p>
<p>Adds additional shorthand methods for all common HTTP verbs, a <code>post_form()</code> method for POST-ing x-www-form-urlencoded data and a <code>www_form_urlencode()</code> utility method.</p>
</li>
<li><p><a href="/cperl/lib/IO.html">IO</a> has been upgraded from version 1.25_04 to 1.25_06, and <a href="/cperl/lib/IO/Handle.html">IO::Handle</a> from version 1.31 to 1.33.</p>
<p>Together, these upgrades fix a problem with IO::Handle's <code>getline</code> and <code>getlines</code> methods. When these methods are called on the special ARGV handle, the next file is automatically opened, as happens with the built-in <code><></code> and <code>readline</code> functions. But, unlike the built-ins, these methods were not respecting the caller's use of the <a href="/cperl/lib/open.html">open</a> pragma and applying the appropriate I/O layers to the newly-opened file [rt.cpan.org #66474].</p>
</li>
<li><p><a href="/cperl/lib/IPC/Cmd.html">IPC::Cmd</a> has been upgraded from version 0.70 to 0.76.</p>
<p>Capturing of command output (both <code>STDOUT</code> and <code>STDERR</code>) is now supported using <a href="/cperl/lib/IPC/Open3.html">IPC::Open3</a> on MSWin32 without requiring <a>IPC::Run</a>.</p>
</li>
<li><p><a href="/cperl/lib/IPC/Open3.html">IPC::Open3</a> has been upgraded from version 1.09 to 1.12.</p>
<p>Fixes a bug which prevented use of <code>open3</code> on Windows when <code>*STDIN</code>, <code>*STDOUT</code> or <code>*STDERR</code> had been localized.</p>
<p>Fixes a bug which prevented duplicating numeric file descriptors on Windows.</p>
<p><code>open3</code> with "-" for the program name works once more. This was broken in version 1.06 (and hence in Perl 5.14.0) [perl #95748].</p>
</li>
<li><p><a>Locale::Codes</a> has been upgraded from version 3.16 to 3.21.</p>
<p>Added Language Extension codes (langext) and Language Variation codes (langvar) as defined in the IANA language registry.</p>
<p>Added language codes from ISO 639-5</p>
<p>Added language/script codes from the IANA language subtag registry</p>
<p>Fixed an uninitialized value warning [rt.cpan.org #67438].</p>
<p>Fixed the return value for the all_XXX_codes and all_XXX_names functions [rt.cpan.org #69100].</p>
<p>Reorganized modules to move Locale::MODULE to Locale::Codes::MODULE to allow for cleaner future additions. The original four modules (Locale::Language, Locale::Currency, Locale::Country, Locale::Script) will continue to work, but all new sets of codes will be added in the Locale::Codes namespace.</p>
<p>The code2XXX, XXX2code, all_XXX_codes, and all_XXX_names functions now support retired codes. All codesets may be specified by a constant or by their name now. Previously, they were specified only by a constant.</p>
<p>The alias_code function exists for backward compatibility. It has been replaced by rename_country_code. The alias_code function will be removed some time after September, 2013.</p>
<p>All work is now done in the central module (Locale::Codes). Previously, some was still done in the wrapper modules (Locale::Codes::*). Added Language Family codes (langfam) as defined in ISO 639-5.</p>
</li>
<li><p><a href="/cperl/lib/Math/BigFloat.html">Math::BigFloat</a> has been upgraded from version 1.993 to 1.997.</p>
<p>The <code>numify</code> method has been corrected to return a normalized Perl number (the result of <code>0 + $thing</code>), instead of a string [rt.cpan.org #66732].</p>
</li>
<li><p><a href="/cperl/lib/Math/BigInt.html">Math::BigInt</a> has been upgraded from version 1.994 to 1.998.</p>