summaryrefslogtreecommitdiffstats
path: root/upstream/mageia-cauldron/man1/perl5100delta.1
blob: d835a05c445c9d187147abbab73f146cc0ab6665 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
.\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds C`
.    ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
.    if \nF \{\
.        de IX
.        tm Index:\\$1\t\\n%\t"\\$2"
..
.        if !\nF==2 \{\
.            nr % 0
.            nr F 2
.        \}
.    \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "PERL5100DELTA 1"
.TH PERL5100DELTA 1 2023-11-28 "perl v5.38.2" "Perl Programmers Reference Guide"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
perl5100delta \- what is new for perl 5.10.0
.SH DESCRIPTION
.IX Header "DESCRIPTION"
This document describes the differences between the 5.8.8 release and
the 5.10.0 release.
.PP
Many of the bug fixes in 5.10.0 were already seen in the 5.8.X maintenance
releases; they are not duplicated here and are documented in the set of
man pages named perl58[1\-8]?delta.
.SH "Core Enhancements"
.IX Header "Core Enhancements"
.ie n .SS "The ""feature"" pragma"
.el .SS "The \f(CWfeature\fP pragma"
.IX Subsection "The feature pragma"
The \f(CW\*(C`feature\*(C'\fR pragma is used to enable new syntax that would break Perl's
backwards-compatibility with older releases of the language. It's a lexical
pragma, like \f(CW\*(C`strict\*(C'\fR or \f(CW\*(C`warnings\*(C'\fR.
.PP
Currently the following new features are available: \f(CW\*(C`switch\*(C'\fR (adds a
switch statement), \f(CW\*(C`say\*(C'\fR (adds a \f(CW\*(C`say\*(C'\fR built-in function), and \f(CW\*(C`state\*(C'\fR
(adds a \f(CW\*(C`state\*(C'\fR keyword for declaring "static" variables). Those
features are described in their own sections of this document.
.PP
The \f(CW\*(C`feature\*(C'\fR pragma is also implicitly loaded when you require a minimal
perl version (with the \f(CW\*(C`use VERSION\*(C'\fR construct) greater than, or equal
to, 5.9.5. See feature for details.
.SS "New \fB\-E\fP command-line switch"
.IX Subsection "New -E command-line switch"
\&\fB\-E\fR is equivalent to \fB\-e\fR, but it implicitly enables all
optional features (like \f(CW\*(C`use feature ":5.10"\*(C'\fR).
.SS "Defined-or operator"
.IX Subsection "Defined-or operator"
A new operator \f(CW\*(C`//\*(C'\fR (defined-or) has been implemented.
The following expression:
.PP
.Vb 1
\&    $a // $b
.Ve
.PP
is merely equivalent to
.PP
.Vb 1
\&   defined $a ? $a : $b
.Ve
.PP
and the statement
.PP
.Vb 1
\&   $c //= $d;
.Ve
.PP
can now be used instead of
.PP
.Vb 1
\&   $c = $d unless defined $c;
.Ve
.PP
The \f(CW\*(C`//\*(C'\fR operator has the same precedence and associativity as \f(CW\*(C`||\*(C'\fR.
Special care has been taken to ensure that this operator Do What You Mean
while not breaking old code, but some edge cases involving the empty
regular expression may now parse differently.  See perlop for
details.
.SS "Switch and Smart Match operator"
.IX Subsection "Switch and Smart Match operator"
Perl 5 now has a switch statement. It's available when \f(CWuse feature
\&\*(Aqswitch\*(Aq\fR is in effect. This feature introduces three new keywords,
\&\f(CW\*(C`given\*(C'\fR, \f(CW\*(C`when\*(C'\fR, and \f(CW\*(C`default\*(C'\fR:
.PP
.Vb 6
\&    given ($foo) {
\&        when (/^abc/) { $abc = 1; }
\&        when (/^def/) { $def = 1; }
\&        when (/^xyz/) { $xyz = 1; }
\&        default { $nothing = 1; }
\&    }
.Ve
.PP
A more complete description of how Perl matches the switch variable
against the \f(CW\*(C`when\*(C'\fR conditions is given in "Switch statements" in perlsyn.
.PP
This kind of match is called \fIsmart match\fR, and it's also possible to use
it outside of switch statements, via the new \f(CW\*(C`~~\*(C'\fR operator. See
"Smart matching in detail" in perlsyn.
.PP
This feature was contributed by Robin Houston.
.SS "Regular expressions"
.IX Subsection "Regular expressions"
.IP "Recursive Patterns" 4
.IX Item "Recursive Patterns"
It is now possible to write recursive patterns without using the \f(CW\*(C`(??{})\*(C'\fR
construct. This new way is more efficient, and in many cases easier to
read.
.Sp
Each capturing parenthesis can now be treated as an independent pattern
that can be entered by using the \f(CW\*(C`(?PARNO)\*(C'\fR syntax (\f(CW\*(C`PARNO\*(C'\fR standing for
"parenthesis number"). For example, the following pattern will match
nested balanced angle brackets:
.Sp
.Vb 10
\&    /
\&     ^                      # start of line
\&     (                      # start capture buffer 1
\&        <                   #   match an opening angle bracket
\&        (?:                 #   match one of:
\&            (?>             #     don\*(Aqt backtrack over the inside of this group
\&                [^<>]+      #       one or more non angle brackets
\&            )               #     end non backtracking group
\&        |                   #     ... or ...
\&            (?1)            #     recurse to bracket 1 and try it again
\&        )*                  #   0 or more times.
\&        >                   #   match a closing angle bracket
\&     )                      # end capture buffer one
\&     $                      # end of line
\&    /x
.Ve
.Sp
PCRE users should note that Perl's recursive regex feature allows
backtracking into a recursed pattern, whereas in PCRE the recursion is
atomic or "possessive" in nature.  As in the example above, you can
add (?>) to control this selectively.  (Yves Orton)
.IP "Named Capture Buffers" 4
.IX Item "Named Capture Buffers"
It is now possible to name capturing parenthesis in a pattern and refer to
the captured contents by name. The naming syntax is \f(CW\*(C`(?<NAME>....)\*(C'\fR.
It's possible to backreference to a named buffer with the \f(CW\*(C`\ek<NAME>\*(C'\fR
syntax. In code, the new magical hashes \f(CW\*(C`%+\*(C'\fR and \f(CW\*(C`%\-\*(C'\fR can be used to
access the contents of the capture buffers.
.Sp
Thus, to replace all doubled chars with a single copy, one could write
.Sp
.Vb 1
\&    s/(?<letter>.)\ek<letter>/$+{letter}/g
.Ve
.Sp
Only buffers with defined contents will be "visible" in the \f(CW\*(C`%+\*(C'\fR hash, so
it's possible to do something like
.Sp
.Vb 3
\&    foreach my $name (keys %+) {
\&        print "content of buffer \*(Aq$name\*(Aq is $+{$name}\en";
\&    }
.Ve
.Sp
The \f(CW\*(C`%\-\*(C'\fR hash is a bit more complete, since it will contain array refs
holding values from all capture buffers similarly named, if there should
be many of them.
.Sp
\&\f(CW\*(C`%+\*(C'\fR and \f(CW\*(C`%\-\*(C'\fR are implemented as tied hashes through the new module
\&\f(CW\*(C`Tie::Hash::NamedCapture\*(C'\fR.
.Sp
Users exposed to the .NET regex engine will find that the perl
implementation differs in that the numerical ordering of the buffers
is sequential, and not "unnamed first, then named". Thus in the pattern
.Sp
.Vb 1
\&   /(A)(?<B>B)(C)(?<D>D)/
.Ve
.Sp
\&\f(CW$1\fR will be 'A', \f(CW$2\fR will be 'B', \f(CW$3\fR will be 'C' and \f(CW$4\fR will be 'D' and not
\&\f(CW$1\fR is 'A', \f(CW$2\fR is 'C' and \f(CW$3\fR is 'B' and \f(CW$4\fR is 'D' that a .NET programmer
would expect. This is considered a feature. :\-) (Yves Orton)
.IP "Possessive Quantifiers" 4
.IX Item "Possessive Quantifiers"
Perl now supports the "possessive quantifier" syntax of the "atomic match"
pattern. Basically a possessive quantifier matches as much as it can and never
gives any back. Thus it can be used to control backtracking. The syntax is
similar to non-greedy matching, except instead of using a '?' as the modifier
the '+' is used. Thus \f(CW\*(C`?+\*(C'\fR, \f(CW\*(C`*+\*(C'\fR, \f(CW\*(C`++\*(C'\fR, \f(CW\*(C`{min,max}+\*(C'\fR are now legal
quantifiers. (Yves Orton)
.IP "Backtracking control verbs" 4
.IX Item "Backtracking control verbs"
The regex engine now supports a number of special-purpose backtrack
control verbs: (*THEN), (*PRUNE), (*MARK), (*SKIP), (*COMMIT), (*FAIL)
and (*ACCEPT). See perlre for their descriptions. (Yves Orton)
.IP "Relative backreferences" 4
.IX Item "Relative backreferences"
A new syntax \f(CW\*(C`\eg{N}\*(C'\fR or \f(CW\*(C`\egN\*(C'\fR where "N" is a decimal integer allows a
safer form of back-reference notation as well as allowing relative
backreferences. This should make it easier to generate and embed patterns
that contain backreferences. See "Capture buffers" in perlre. (Yves Orton)
.ie n .IP """\eK"" escape" 4
.el .IP "\f(CW\eK\fR escape" 4
.IX Item "K escape"
The functionality of Jeff Pinyan's module Regexp::Keep has been added to
the core. In regular expressions you can now use the special escape \f(CW\*(C`\eK\*(C'\fR
as a way to do something like floating length positive lookbehind. It is
also useful in substitutions like:
.Sp
.Vb 1
\&  s/(foo)bar/$1/g
.Ve
.Sp
that can now be converted to
.Sp
.Vb 1
\&  s/foo\eKbar//g
.Ve
.Sp
which is much more efficient. (Yves Orton)
.IP "Vertical and horizontal whitespace, and linebreak" 4
.IX Item "Vertical and horizontal whitespace, and linebreak"
Regular expressions now recognize the \f(CW\*(C`\ev\*(C'\fR and \f(CW\*(C`\eh\*(C'\fR escapes that match
vertical and horizontal whitespace, respectively. \f(CW\*(C`\eV\*(C'\fR and \f(CW\*(C`\eH\*(C'\fR
logically match their complements.
.Sp
\&\f(CW\*(C`\eR\*(C'\fR matches a generic linebreak, that is, vertical whitespace, plus
the multi-character sequence \f(CW"\ex0D\ex0A"\fR.
.IP "Optional pre-match and post-match captures with the /p flag" 4
.IX Item "Optional pre-match and post-match captures with the /p flag"
There is a new flag \f(CW\*(C`/p\*(C'\fR for regular expressions.  Using this
makes the engine preserve a copy of the part of the matched string before
the matching substring to the new special variable \f(CW\*(C`${^PREMATCH}\*(C'\fR, the
part after the matching substring to \f(CW\*(C`${^POSTMATCH}\*(C'\fR, and the matched
substring itself to \f(CW\*(C`${^MATCH}\*(C'\fR.
.Sp
Perl is still able to store these substrings to the special variables
\&\f(CW\*(C`$\`\*(C'\fR, \f(CW\*(C`$\*(Aq\*(C'\fR, \f(CW$&\fR, but using these variables anywhere in the program
adds a penalty to all regular expression matches, whereas if you use
the \f(CW\*(C`/p\*(C'\fR flag and the new special variables instead, you pay only for
the regular expressions where the flag is used.
.Sp
For more detail on the new variables, see perlvar; for the use of
the regular expression flag, see perlop and perlre.
.ie n .SS say()
.el .SS \f(CWsay()\fP
.IX Subsection "say()"
\&\fBsay()\fR is a new built-in, only available when \f(CW\*(C`use feature \*(Aqsay\*(Aq\*(C'\fR is in
effect, that is similar to \fBprint()\fR, but that implicitly appends a newline
to the printed string. See "say" in perlfunc. (Robin Houston)
.ie n .SS "Lexical $_"
.el .SS "Lexical \f(CW$_\fP"
.IX Subsection "Lexical $_"
The default variable \f(CW$_\fR can now be lexicalized, by declaring it like
any other lexical variable, with a simple
.PP
.Vb 1
\&    my $_;
.Ve
.PP
The operations that default on \f(CW$_\fR will use the lexically-scoped
version of \f(CW$_\fR when it exists, instead of the global \f(CW$_\fR.
.PP
In a \f(CW\*(C`map\*(C'\fR or a \f(CW\*(C`grep\*(C'\fR block, if \f(CW$_\fR was previously my'ed, then the
\&\f(CW$_\fR inside the block is lexical as well (and scoped to the block).
.PP
In a scope where \f(CW$_\fR has been lexicalized, you can still have access to
the global version of \f(CW$_\fR by using \f(CW$::_\fR, or, more simply, by
overriding the lexical declaration with \f(CW\*(C`our $_\*(C'\fR. (Rafael Garcia-Suarez)
.ie n .SS "The ""_"" prototype"
.el .SS "The \f(CW_\fP prototype"
.IX Subsection "The _ prototype"
A new prototype character has been added. \f(CW\*(C`_\*(C'\fR is equivalent to \f(CW\*(C`$\*(C'\fR but
defaults to \f(CW$_\fR if the corresponding argument isn't supplied (both \f(CW\*(C`$\*(C'\fR
and \f(CW\*(C`_\*(C'\fR denote a scalar). Due to the optional nature of the argument, 
you can only use it at the end of a prototype, or before a semicolon.
.PP
This has a small incompatible consequence: the \fBprototype()\fR function has
been adjusted to return \f(CW\*(C`_\*(C'\fR for some built-ins in appropriate cases (for
example, \f(CWprototype(\*(AqCORE::rmdir\*(Aq)\fR). (Rafael Garcia-Suarez)
.SS "UNITCHECK blocks"
.IX Subsection "UNITCHECK blocks"
\&\f(CW\*(C`UNITCHECK\*(C'\fR, a new special code block has been introduced, in addition to
\&\f(CW\*(C`BEGIN\*(C'\fR, \f(CW\*(C`CHECK\*(C'\fR, \f(CW\*(C`INIT\*(C'\fR and \f(CW\*(C`END\*(C'\fR.
.PP
\&\f(CW\*(C`CHECK\*(C'\fR and \f(CW\*(C`INIT\*(C'\fR blocks, while useful for some specialized purposes,
are always executed at the transition between the compilation and the
execution of the main program, and thus are useless whenever code is
loaded at runtime. On the other hand, \f(CW\*(C`UNITCHECK\*(C'\fR blocks are executed
just after the unit which defined them has been compiled. See perlmod
for more information. (Alex Gough)
.ie n .SS "New Pragma, ""mro"""
.el .SS "New Pragma, \f(CWmro\fP"
.IX Subsection "New Pragma, mro"
A new pragma, \f(CW\*(C`mro\*(C'\fR (for Method Resolution Order) has been added. It
permits to switch, on a per-class basis, the algorithm that perl uses to
find inherited methods in case of a multiple inheritance hierarchy. The
default MRO hasn't changed (DFS, for Depth First Search). Another MRO is
available: the C3 algorithm. See mro for more information.
(Brandon Black)
.PP
Note that, due to changes in the implementation of class hierarchy search,
code that used to undef the \f(CW*ISA\fR glob will most probably break. Anyway,
undef'ing \f(CW*ISA\fR had the side-effect of removing the magic on the \f(CW@ISA\fR
array and should not have been done in the first place. Also, the
cache \f(CW*::ISA::CACHE::\fR no longer exists; to force reset the \f(CW@ISA\fR cache,
you now need to use the \f(CW\*(C`mro\*(C'\fR API, or more simply to assign to \f(CW@ISA\fR
(e.g. with \f(CW\*(C`@ISA = @ISA\*(C'\fR).
.SS "\fBreaddir()\fP may return a ""short filename"" on Windows"
.IX Subsection "readdir() may return a ""short filename"" on Windows"
The \fBreaddir()\fR function may return a "short filename" when the long
filename contains characters outside the ANSI codepage.  Similarly
\&\fBCwd::cwd()\fR may return a short directory name, and \fBglob()\fR may return short
names as well.  On the NTFS file system these short names can always be
represented in the ANSI codepage.  This will not be true for all other file
system drivers; e.g. the FAT filesystem stores short filenames in the OEM
codepage, so some files on FAT volumes remain inaccessible through the
ANSI APIs.
.PP
Similarly, $^X, \f(CW@INC\fR, and \f(CW$ENV\fR{PATH} are preprocessed at startup to make
sure all paths are valid in the ANSI codepage (if possible).
.PP
The \fBWin32::GetLongPathName()\fR function now returns the UTF\-8 encoded
correct long file name instead of using replacement characters to force
the name into the ANSI codepage.  The new \fBWin32::GetANSIPathName()\fR
function can be used to turn a long pathname into a short one only if the
long one cannot be represented in the ANSI codepage.
.PP
Many other functions in the \f(CW\*(C`Win32\*(C'\fR module have been improved to accept
UTF\-8 encoded arguments.  Please see Win32 for details.
.SS "\fBreadpipe()\fP is now overridable"
.IX Subsection "readpipe() is now overridable"
The built-in function \fBreadpipe()\fR is now overridable. Overriding it permits
also to override its operator counterpart, \f(CW\*(C`qx//\*(C'\fR (a.k.a. \f(CW\`\`\fR).
Moreover, it now defaults to \f(CW$_\fR if no argument is provided. (Rafael
Garcia-Suarez)
.SS "Default argument for \fBreadline()\fP"
.IX Subsection "Default argument for readline()"
\&\fBreadline()\fR now defaults to \f(CW*ARGV\fR if no argument is provided. (Rafael
Garcia-Suarez)
.SS "\fBstate()\fP variables"
.IX Subsection "state() variables"
A new class of variables has been introduced. State variables are similar
to \f(CW\*(C`my\*(C'\fR variables, but are declared with the \f(CW\*(C`state\*(C'\fR keyword in place of
\&\f(CW\*(C`my\*(C'\fR. They're visible only in their lexical scope, but their value is
persistent: unlike \f(CW\*(C`my\*(C'\fR variables, they're not undefined at scope entry,
but retain their previous value. (Rafael Garcia-Suarez, Nicholas Clark)
.PP
To use state variables, one needs to enable them by using
.PP
.Vb 1
\&    use feature \*(Aqstate\*(Aq;
.Ve
.PP
or by using the \f(CW\*(C`\-E\*(C'\fR command-line switch in one-liners.
See "Persistent Private Variables" in perlsub.
.SS "Stacked filetest operators"
.IX Subsection "Stacked filetest operators"
As a new form of syntactic sugar, it's now possible to stack up filetest
operators. You can now write \f(CW\*(C`\-f \-w \-x $file\*(C'\fR in a row to mean
\&\f(CW\*(C`\-x $file && \-w _ && \-f _\*(C'\fR. See "\-X" in perlfunc.
.SS \fBUNIVERSAL::DOES()\fP
.IX Subsection "UNIVERSAL::DOES()"
The \f(CW\*(C`UNIVERSAL\*(C'\fR class has a new method, \f(CWDOES()\fR. It has been added to
solve semantic problems with the \f(CWisa()\fR method. \f(CWisa()\fR checks for
inheritance, while \f(CWDOES()\fR has been designed to be overridden when
module authors use other types of relations between classes (in addition
to inheritance). (chromatic)
.PP
See "$obj\->DOES( ROLE )" in UNIVERSAL.
.SS Formats
.IX Subsection "Formats"
Formats were improved in several ways. A new field, \f(CW\*(C`^*\*(C'\fR, can be used for
variable-width, one-line-at-a-time text. Null characters are now handled
correctly in picture lines. Using \f(CW\*(C`@#\*(C'\fR and \f(CW\*(C`~~\*(C'\fR together will now
produce a compile-time error, as those format fields are incompatible.
perlform has been improved, and miscellaneous bugs fixed.
.SS "Byte-order modifiers for \fBpack()\fP and \fBunpack()\fP"
.IX Subsection "Byte-order modifiers for pack() and unpack()"
There are two new byte-order modifiers, \f(CW\*(C`>\*(C'\fR (big-endian) and \f(CW\*(C`<\*(C'\fR
(little-endian), that can be appended to most \fBpack()\fR and \fBunpack()\fR template
characters and groups to force a certain byte-order for that type or group.
See "pack" in perlfunc and perlpacktut for details.
.ie n .SS """no VERSION"""
.el .SS "\f(CWno VERSION\fP"
.IX Subsection "no VERSION"
You can now use \f(CW\*(C`no\*(C'\fR followed by a version number to specify that you
want to use a version of perl older than the specified one.
.ie n .SS """chdir"", ""chmod"" and ""chown"" on filehandles"
.el .SS "\f(CWchdir\fP, \f(CWchmod\fP and \f(CWchown\fP on filehandles"
.IX Subsection "chdir, chmod and chown on filehandles"
\&\f(CW\*(C`chdir\*(C'\fR, \f(CW\*(C`chmod\*(C'\fR and \f(CW\*(C`chown\*(C'\fR can now work on filehandles as well as
filenames, if the system supports respectively \f(CW\*(C`fchdir\*(C'\fR, \f(CW\*(C`fchmod\*(C'\fR and
\&\f(CW\*(C`fchown\*(C'\fR, thanks to a patch provided by Gisle Aas.
.SS "OS groups"
.IX Subsection "OS groups"
\&\f(CW$(\fR and \f(CW$)\fR now return groups in the order where the OS returns them,
thanks to Gisle Aas. This wasn't previously the case.
.SS "Recursive sort subs"
.IX Subsection "Recursive sort subs"
You can now use recursive subroutines with \fBsort()\fR, thanks to Robin Houston.
.SS "Exceptions in constant folding"
.IX Subsection "Exceptions in constant folding"
The constant folding routine is now wrapped in an exception handler, and
if folding throws an exception (such as attempting to evaluate 0/0), perl
now retains the current optree, rather than aborting the whole program.
Without this change, programs would not compile if they had expressions that
happened to generate exceptions, even though those expressions were in code
that could never be reached at runtime. (Nicholas Clark, Dave Mitchell)
.ie n .SS "Source filters in @INC"
.el .SS "Source filters in \f(CW@INC\fP"
.IX Subsection "Source filters in @INC"
It's possible to enhance the mechanism of subroutine hooks in \f(CW@INC\fR by
adding a source filter on top of the filehandle opened and returned by the
hook. This feature was planned a long time ago, but wasn't quite working
until now. See "require" in perlfunc for details. (Nicholas Clark)
.SS "New internal variables"
.IX Subsection "New internal variables"
.ie n .IP """${^RE_DEBUG_FLAGS}""" 4
.el .IP \f(CW${^RE_DEBUG_FLAGS}\fR 4
.IX Item "${^RE_DEBUG_FLAGS}"
This variable controls what debug flags are in effect for the regular
expression engine when running under \f(CW\*(C`use re "debug"\*(C'\fR. See re for
details.
.ie n .IP """${^CHILD_ERROR_NATIVE}""" 4
.el .IP \f(CW${^CHILD_ERROR_NATIVE}\fR 4
.IX Item "${^CHILD_ERROR_NATIVE}"
This variable gives the native status returned by the last pipe close,
backtick command, successful call to \fBwait()\fR or \fBwaitpid()\fR, or from the
\&\fBsystem()\fR operator. See perlvar for details. (Contributed by Gisle Aas.)
.ie n .IP """${^RE_TRIE_MAXBUF}""" 4
.el .IP \f(CW${^RE_TRIE_MAXBUF}\fR 4
.IX Item "${^RE_TRIE_MAXBUF}"
See "Trie optimisation of literal string alternations".
.ie n .IP """${^WIN32_SLOPPY_STAT}""" 4
.el .IP \f(CW${^WIN32_SLOPPY_STAT}\fR 4
.IX Item "${^WIN32_SLOPPY_STAT}"
See "Sloppy stat on Windows".
.SS Miscellaneous
.IX Subsection "Miscellaneous"
\&\f(CWunpack()\fR now defaults to unpacking the \f(CW$_\fR variable.
.PP
\&\f(CWmkdir()\fR without arguments now defaults to \f(CW$_\fR.
.PP
The internal dump output has been improved, so that non-printable characters
such as newline and backspace are output in \f(CW\*(C`\ex\*(C'\fR notation, rather than
octal.
.PP
The \fB\-C\fR option can no longer be used on the \f(CW\*(C`#!\*(C'\fR line. It wasn't
working there anyway, since the standard streams are already set up
at this point in the execution of the perl interpreter. You can use
\&\fBbinmode()\fR instead to get the desired behaviour.
.SS "UCD 5.0.0"
.IX Subsection "UCD 5.0.0"
The copy of the Unicode Character Database included in Perl 5 has
been updated to version 5.0.0.
.SS MAD
.IX Subsection "MAD"
MAD, which stands for \fIMiscellaneous Attribute Decoration\fR, is a
still-in-development work leading to a Perl 5 to Perl 6 converter. To
enable it, it's necessary to pass the argument \f(CW\*(C`\-Dmad\*(C'\fR to Configure. The
obtained perl isn't binary compatible with a regular perl 5.10, and has
space and speed penalties; moreover not all regression tests still pass
with it. (Larry Wall, Nicholas Clark)
.SS "\fBkill()\fP on Windows"
.IX Subsection "kill() on Windows"
On Windows platforms, \f(CW\*(C`kill(\-9, $pid)\*(C'\fR now kills a process tree.
(On Unix, this delivers the signal to all processes in the same process
group.)
.SH "Incompatible Changes"
.IX Header "Incompatible Changes"
.SS "Packing and UTF\-8 strings"
.IX Subsection "Packing and UTF-8 strings"
The semantics of \fBpack()\fR and \fBunpack()\fR regarding UTF\-8\-encoded data has been
changed. Processing is now by default character per character instead of
byte per byte on the underlying encoding. Notably, code that used things
like \f(CW\*(C`pack("a*", $string)\*(C'\fR to see through the encoding of string will now
simply get back the original \f(CW$string\fR. Packed strings can also get upgraded
during processing when you store upgraded characters. You can get the old
behaviour by using \f(CW\*(C`use bytes\*(C'\fR.
.PP
To be consistent with \fBpack()\fR, the \f(CW\*(C`C0\*(C'\fR in \fBunpack()\fR templates indicates
that the data is to be processed in character mode, i.e. character by
character; on the contrary, \f(CW\*(C`U0\*(C'\fR in \fBunpack()\fR indicates UTF\-8 mode, where
the packed string is processed in its UTF\-8\-encoded Unicode form on a byte
by byte basis. This is reversed with regard to perl 5.8.X, but now consistent
between \fBpack()\fR and \fBunpack()\fR.
.PP
Moreover, \f(CW\*(C`C0\*(C'\fR and \f(CW\*(C`U0\*(C'\fR can also be used in \fBpack()\fR templates to specify
respectively character and byte modes.
.PP
\&\f(CW\*(C`C0\*(C'\fR and \f(CW\*(C`U0\*(C'\fR in the middle of a pack or unpack format now switch to the
specified encoding mode, honoring parens grouping. Previously, parens were
ignored.
.PP
Also, there is a new \fBpack()\fR character format, \f(CW\*(C`W\*(C'\fR, which is intended to
replace the old \f(CW\*(C`C\*(C'\fR. \f(CW\*(C`C\*(C'\fR is kept for unsigned chars coded as bytes in
the strings internal representation. \f(CW\*(C`W\*(C'\fR represents unsigned (logical)
character values, which can be greater than 255. It is therefore more
robust when dealing with potentially UTF\-8\-encoded data (as \f(CW\*(C`C\*(C'\fR will wrap
values outside the range 0..255, and not respect the string encoding).
.PP
In practice, that means that pack formats are now encoding-neutral, except
\&\f(CW\*(C`C\*(C'\fR.
.PP
For consistency, \f(CW\*(C`A\*(C'\fR in \fBunpack()\fR format now trims all Unicode whitespace
from the end of the string. Before perl 5.9.2, it used to strip only the
classical ASCII space characters.
.SS "Byte/character count feature in \fBunpack()\fP"
.IX Subsection "Byte/character count feature in unpack()"
A new \fBunpack()\fR template character, \f(CW"."\fR, returns the number of bytes or
characters (depending on the selected encoding mode, see above) read so far.
.ie n .SS "The $* and $# variables have been removed"
.el .SS "The \f(CW$*\fP and \f(CW$#\fP variables have been removed"
.IX Subsection "The $* and $# variables have been removed"
\&\f(CW$*\fR, which was deprecated in favor of the \f(CW\*(C`/s\*(C'\fR and \f(CW\*(C`/m\*(C'\fR regexp
modifiers, has been removed.
.PP
The deprecated \f(CW$#\fR variable (output format for numbers) has been
removed.
.PP
Two new severe warnings, \f(CW\*(C`$#/$* is no longer supported\*(C'\fR, have been added.
.SS "\fBsubstr()\fP lvalues are no longer fixed-length"
.IX Subsection "substr() lvalues are no longer fixed-length"
The lvalues returned by the three argument form of \fBsubstr()\fR used to be a
"fixed length window" on the original string. In some cases this could
cause surprising action at distance or other undefined behaviour. Now the
length of the window adjusts itself to the length of the string assigned to
it.
.ie n .SS "Parsing of ""\-f _"""
.el .SS "Parsing of \f(CW\-f _\fP"
.IX Subsection "Parsing of -f _"
The identifier \f(CW\*(C`_\*(C'\fR is now forced to be a bareword after a filetest
operator. This solves a number of misparsing issues when a global \f(CW\*(C`_\*(C'\fR
subroutine is defined.
.ie n .SS """:unique"""
.el .SS \f(CW:unique\fP
.IX Subsection ":unique"
The \f(CW\*(C`:unique\*(C'\fR attribute has been made a no-op, since its current
implementation was fundamentally flawed and not threadsafe.
.SS "Effect of pragmas in eval"
.IX Subsection "Effect of pragmas in eval"
The compile-time value of the \f(CW\*(C`%^H\*(C'\fR hint variable can now propagate into
eval("")uated code. This makes it more useful to implement lexical
pragmas.
.PP
As a side-effect of this, the overloaded-ness of constants now propagates
into eval("").
.SS "chdir FOO"
.IX Subsection "chdir FOO"
A bareword argument to \fBchdir()\fR is now recognized as a file handle.
Earlier releases interpreted the bareword as a directory name.
(Gisle Aas)
.SS "Handling of .pmc files"
.IX Subsection "Handling of .pmc files"
An old feature of perl was that before \f(CW\*(C`require\*(C'\fR or \f(CW\*(C`use\*(C'\fR look for a
file with a \fI.pm\fR extension, they will first look for a similar filename
with a \fI.pmc\fR extension. If this file is found, it will be loaded in
place of any potentially existing file ending in a \fI.pm\fR extension.
.PP
Previously, \fI.pmc\fR files were loaded only if more recent than the
matching \fI.pm\fR file. Starting with 5.9.4, they'll be always loaded if
they exist.
.ie n .SS "$^V is now a ""version"" object instead of a v\-string"
.el .SS "$^V is now a \f(CWversion\fP object instead of a v\-string"
.IX Subsection "$^V is now a version object instead of a v-string"
$^V can still be used with the \f(CW%vd\fR format in printf, but any
character-level operations will now access the string representation
of the \f(CW\*(C`version\*(C'\fR object and not the ordinals of a v\-string.
Expressions like \f(CW\*(C`substr($^V, 0, 2)\*(C'\fR or \f(CW\*(C`split //, $^V\*(C'\fR
no longer work and must be rewritten.
.SS "@\- and @+ in patterns"
.IX Subsection "@- and @+ in patterns"
The special arrays \f(CW\*(C`@\-\*(C'\fR and \f(CW\*(C`@+\*(C'\fR are no longer interpolated in regular
expressions. (Sadahiro Tomoyuki)
.ie n .SS "$AUTOLOAD can now be tainted"
.el .SS "\f(CW$AUTOLOAD\fP can now be tainted"
.IX Subsection "$AUTOLOAD can now be tainted"
If you call a subroutine by a tainted name, and if it defers to an
AUTOLOAD function, then \f(CW$AUTOLOAD\fR will be (correctly) tainted.
(Rick Delaney)
.SS "Tainting and printf"
.IX Subsection "Tainting and printf"
When perl is run under taint mode, \f(CWprintf()\fR and \f(CWsprintf()\fR will now
reject any tainted format argument. (Rafael Garcia-Suarez)
.SS "undef and signal handlers"
.IX Subsection "undef and signal handlers"
Undefining or deleting a signal handler via \f(CW\*(C`undef $SIG{FOO}\*(C'\fR is now
equivalent to setting it to \f(CW\*(AqDEFAULT\*(Aq\fR. (Rafael Garcia-Suarez)
.SS "strictures and dereferencing in \fBdefined()\fP"
.IX Subsection "strictures and dereferencing in defined()"
\&\f(CW\*(C`use strict \*(Aqrefs\*(Aq\*(C'\fR was ignoring taking a hard reference in an argument
to \fBdefined()\fR, as in :
.PP
.Vb 3
\&    use strict \*(Aqrefs\*(Aq;
\&    my $x = \*(Aqfoo\*(Aq;
\&    if (defined $$x) {...}
.Ve
.PP
This now correctly produces the run-time error \f(CW\*(C`Can\*(Aqt use string as a
SCALAR ref while "strict refs" in use\*(C'\fR.
.PP
\&\f(CW\*(C`defined @$foo\*(C'\fR and \f(CW\*(C`defined %$bar\*(C'\fR are now also subject to \f(CWstrict
\&\*(Aqrefs\*(Aq\fR (that is, \f(CW$foo\fR and \f(CW$bar\fR shall be proper references there.)
(\f(CWdefined(@foo)\fR and \f(CWdefined(%bar)\fR are discouraged constructs anyway.)
(Nicholas Clark)
.ie n .SS """(?p{})"" has been removed"
.el .SS "\f(CW(?p{})\fP has been removed"
.IX Subsection "(?p{}) has been removed"
The regular expression construct \f(CW\*(C`(?p{})\*(C'\fR, which was deprecated in perl
5.8, has been removed. Use \f(CW\*(C`(??{})\*(C'\fR instead. (Rafael Garcia-Suarez)
.SS "Pseudo-hashes have been removed"
.IX Subsection "Pseudo-hashes have been removed"
Support for pseudo-hashes has been removed from Perl 5.9. (The \f(CW\*(C`fields\*(C'\fR
pragma remains here, but uses an alternate implementation.)
.SS "Removal of the bytecode compiler and of perlcc"
.IX Subsection "Removal of the bytecode compiler and of perlcc"
\&\f(CW\*(C`perlcc\*(C'\fR, the byteloader and the supporting modules (B::C, B::CC,
B::Bytecode, etc.) are no longer distributed with the perl sources. Those
experimental tools have never worked reliably, and, due to the lack of
volunteers to keep them in line with the perl interpreter developments, it
was decided to remove them instead of shipping a broken version of those.
The last version of those modules can be found with perl 5.9.4.
.PP
However the B compiler framework stays supported in the perl core, as with
the more useful modules it has permitted (among others, B::Deparse and
B::Concise).
.SS "Removal of the JPL"
.IX Subsection "Removal of the JPL"
The JPL (Java-Perl Lingo) has been removed from the perl sources tarball.
.SS "Recursive inheritance detected earlier"
.IX Subsection "Recursive inheritance detected earlier"
Perl will now immediately throw an exception if you modify any package's
\&\f(CW@ISA\fR in such a way that it would cause recursive inheritance.
.PP
Previously, the exception would not occur until Perl attempted to make
use of the recursive inheritance while resolving a method or doing a
\&\f(CW\*(C`$foo\->isa($bar)\*(C'\fR lookup.
.SS "warnings::enabled and warnings::warnif changed to favor users of modules"
.IX Subsection "warnings::enabled and warnings::warnif changed to favor users of modules"
The behaviour in 5.10.x favors the person using the module;
The behaviour in 5.8.x favors the module writer;
.PP
Assume the following code:
.PP
.Vb 5
\&  main calls Foo::Bar::baz()
\&  Foo::Bar inherits from Foo::Base
\&  Foo::Bar::baz() calls Foo::Base::_bazbaz()
\&  Foo::Base::_bazbaz() calls: warnings::warnif(\*(Aqsubstr\*(Aq, \*(Aqsome warning 
\&message\*(Aq);
.Ve
.PP
On 5.8.x, the code warns when Foo::Bar contains \f(CW\*(C`use warnings;\*(C'\fR
It does not matter if Foo::Base or main have warnings enabled
to disable the warning one has to modify Foo::Bar.
.PP
On 5.10.0 and newer, the code warns when main contains \f(CW\*(C`use warnings;\*(C'\fR
It does not matter if Foo::Base or Foo::Bar have warnings enabled
to disable the warning one has to modify main.
.SH "Modules and Pragmata"
.IX Header "Modules and Pragmata"
.SS "Upgrading individual core modules"
.IX Subsection "Upgrading individual core modules"
Even more core modules are now also available separately through the
CPAN.  If you wish to update one of these modules, you don't need to
wait for a new perl release.  From within the cpan shell, running the
\&'r' command will report on modules with upgrades available.  See
\&\f(CW\*(C`perldoc CPAN\*(C'\fR for more information.
.SS "Pragmata Changes"
.IX Subsection "Pragmata Changes"
.ie n .IP """feature""" 4
.el .IP \f(CWfeature\fR 4
.IX Item "feature"
The new pragma \f(CW\*(C`feature\*(C'\fR is used to enable new features that might break
old code. See "The \f(CW\*(C`feature\*(C'\fR pragma" above.
.ie n .IP """mro""" 4
.el .IP \f(CWmro\fR 4
.IX Item "mro"
This new pragma enables to change the algorithm used to resolve inherited
methods. See "New Pragma, \f(CW\*(C`mro\*(C'\fR" above.
.ie n .IP "Scoping of the ""sort"" pragma" 4
.el .IP "Scoping of the \f(CWsort\fR pragma" 4
.IX Item "Scoping of the sort pragma"
The \f(CW\*(C`sort\*(C'\fR pragma is now lexically scoped. Its effect used to be global.
.ie n .IP "Scoping of ""bignum"", ""bigint"", ""bigrat""" 4
.el .IP "Scoping of \f(CWbignum\fR, \f(CWbigint\fR, \f(CWbigrat\fR" 4
.IX Item "Scoping of bignum, bigint, bigrat"
The three numeric pragmas \f(CW\*(C`bignum\*(C'\fR, \f(CW\*(C`bigint\*(C'\fR and \f(CW\*(C`bigrat\*(C'\fR are now
lexically scoped. (Tels)
.ie n .IP """base""" 4
.el .IP \f(CWbase\fR 4
.IX Item "base"
The \f(CW\*(C`base\*(C'\fR pragma now warns if a class tries to inherit from itself.
(Curtis "Ovid" Poe)
.ie n .IP """strict"" and ""warnings""" 4
.el .IP "\f(CWstrict\fR and \f(CWwarnings\fR" 4
.IX Item "strict and warnings"
\&\f(CW\*(C`strict\*(C'\fR and \f(CW\*(C`warnings\*(C'\fR will now complain loudly if they are loaded via
incorrect casing (as in \f(CW\*(C`use Strict;\*(C'\fR). (Johan Vromans)
.ie n .IP """version""" 4
.el .IP \f(CWversion\fR 4
.IX Item "version"
The \f(CW\*(C`version\*(C'\fR module provides support for version objects.
.ie n .IP """warnings""" 4
.el .IP \f(CWwarnings\fR 4
.IX Item "warnings"
The \f(CW\*(C`warnings\*(C'\fR pragma doesn't load \f(CW\*(C`Carp\*(C'\fR anymore. That means that code
that used \f(CW\*(C`Carp\*(C'\fR routines without having loaded it at compile time might
need to be adjusted; typically, the following (faulty) code won't work
anymore, and will require parentheses to be added after the function name:
.Sp
.Vb 3
\&    use warnings;
\&    require Carp;
\&    Carp::confess \*(Aqargh\*(Aq;
.Ve
.ie n .IP """less""" 4
.el .IP \f(CWless\fR 4
.IX Item "less"
\&\f(CW\*(C`less\*(C'\fR now does something useful (or at least it tries to). In fact, it
has been turned into a lexical pragma. So, in your modules, you can now
test whether your users have requested to use less CPU, or less memory,
less magic, or maybe even less fat. See less for more. (Joshua ben
Jore)
.SS "New modules"
.IX Subsection "New modules"
.IP \(bu 4
\&\f(CW\*(C`encoding::warnings\*(C'\fR, by Audrey Tang, is a module to emit warnings
whenever an ASCII character string containing high-bit bytes is implicitly
converted into UTF\-8. It's a lexical pragma since Perl 5.9.4; on older
perls, its effect is global.
.IP \(bu 4
\&\f(CW\*(C`Module::CoreList\*(C'\fR, by Richard Clamp, is a small handy module that tells
you what versions of core modules ship with any versions of Perl 5. It
comes with a command-line frontend, \f(CW\*(C`corelist\*(C'\fR.
.IP \(bu 4
\&\f(CW\*(C`Math::BigInt::FastCalc\*(C'\fR is an XS-enabled, and thus faster, version of
\&\f(CW\*(C`Math::BigInt::Calc\*(C'\fR.
.IP \(bu 4
\&\f(CW\*(C`Compress::Zlib\*(C'\fR is an interface to the zlib compression library. It
comes with a bundled version of zlib, so having a working zlib is not a
prerequisite to install it. It's used by \f(CW\*(C`Archive::Tar\*(C'\fR (see below).
.IP \(bu 4
\&\f(CW\*(C`IO::Zlib\*(C'\fR is an \f(CW\*(C`IO::\*(C'\fR\-style interface to \f(CW\*(C`Compress::Zlib\*(C'\fR.
.IP \(bu 4
\&\f(CW\*(C`Archive::Tar\*(C'\fR is a module to manipulate \f(CW\*(C`tar\*(C'\fR archives.
.IP \(bu 4
\&\f(CW\*(C`Digest::SHA\*(C'\fR is a module used to calculate many types of SHA digests,
has been included for SHA support in the CPAN module.
.IP \(bu 4
\&\f(CW\*(C`ExtUtils::CBuilder\*(C'\fR and \f(CW\*(C`ExtUtils::ParseXS\*(C'\fR have been added.
.IP \(bu 4
\&\f(CW\*(C`Hash::Util::FieldHash\*(C'\fR, by Anno Siegel, has been added. This module
provides support for \fIfield hashes\fR: hashes that maintain an association
of a reference with a value, in a thread-safe garbage-collected way.
Such hashes are useful to implement inside-out objects.
.IP \(bu 4
\&\f(CW\*(C`Module::Build\*(C'\fR, by Ken Williams, has been added. It's an alternative to
\&\f(CW\*(C`ExtUtils::MakeMaker\*(C'\fR to build and install perl modules.
.IP \(bu 4
\&\f(CW\*(C`Module::Load\*(C'\fR, by Jos Boumans, has been added. It provides a single
interface to load Perl modules and \fI.pl\fR files.
.IP \(bu 4
\&\f(CW\*(C`Module::Loaded\*(C'\fR, by Jos Boumans, has been added. It's used to mark
modules as loaded or unloaded.
.IP \(bu 4
\&\f(CW\*(C`Package::Constants\*(C'\fR, by Jos Boumans, has been added. It's a simple
helper to list all constants declared in a given package.
.IP \(bu 4
\&\f(CW\*(C`Win32API::File\*(C'\fR, by Tye McQueen, has been added (for Windows builds).
This module provides low-level access to Win32 system API calls for
files/dirs.
.IP \(bu 4
\&\f(CW\*(C`Locale::Maketext::Simple\*(C'\fR, needed by CPANPLUS, is a simple wrapper around
\&\f(CW\*(C`Locale::Maketext::Lexicon\*(C'\fR. Note that \f(CW\*(C`Locale::Maketext::Lexicon\*(C'\fR isn't
included in the perl core; the behaviour of \f(CW\*(C`Locale::Maketext::Simple\*(C'\fR
gracefully degrades when the later isn't present.
.IP \(bu 4
\&\f(CW\*(C`Params::Check\*(C'\fR implements a generic input parsing/checking mechanism. It
is used by CPANPLUS.
.IP \(bu 4
\&\f(CW\*(C`Term::UI\*(C'\fR simplifies the task to ask questions at a terminal prompt.
.IP \(bu 4
\&\f(CW\*(C`Object::Accessor\*(C'\fR provides an interface to create per-object accessors.
.IP \(bu 4
\&\f(CW\*(C`Module::Pluggable\*(C'\fR is a simple framework to create modules that accept
pluggable sub-modules.
.IP \(bu 4
\&\f(CW\*(C`Module::Load::Conditional\*(C'\fR provides simple ways to query and possibly
load installed modules.
.IP \(bu 4
\&\f(CW\*(C`Time::Piece\*(C'\fR provides an object oriented interface to time functions,
overriding the built-ins \fBlocaltime()\fR and \fBgmtime()\fR.
.IP \(bu 4
\&\f(CW\*(C`IPC::Cmd\*(C'\fR helps to find and run external commands, possibly
interactively.
.IP \(bu 4
\&\f(CW\*(C`File::Fetch\*(C'\fR provide a simple generic file fetching mechanism.
.IP \(bu 4
\&\f(CW\*(C`Log::Message\*(C'\fR and \f(CW\*(C`Log::Message::Simple\*(C'\fR are used by the log facility
of \f(CW\*(C`CPANPLUS\*(C'\fR.
.IP \(bu 4
\&\f(CW\*(C`Archive::Extract\*(C'\fR is a generic archive extraction mechanism
for \fI.tar\fR (plain, gzipped or bzipped) or \fI.zip\fR files.
.IP \(bu 4
\&\f(CW\*(C`CPANPLUS\*(C'\fR provides an API and a command-line tool to access the CPAN
mirrors.
.IP \(bu 4
\&\f(CW\*(C`Pod::Escapes\*(C'\fR provides utilities that are useful in decoding Pod
E<...> sequences.
.IP \(bu 4
\&\f(CW\*(C`Pod::Simple\*(C'\fR is now the backend for several of the Pod-related modules
included with Perl.
.SS "Selected Changes to Core Modules"
.IX Subsection "Selected Changes to Core Modules"
.ie n .IP """Attribute::Handlers""" 4
.el .IP \f(CWAttribute::Handlers\fR 4
.IX Item "Attribute::Handlers"
\&\f(CW\*(C`Attribute::Handlers\*(C'\fR can now report the caller's file and line number.
(David Feldman)
.Sp
All interpreted attributes are now passed as array references. (Damian
Conway)
.ie n .IP """B::Lint""" 4
.el .IP \f(CWB::Lint\fR 4
.IX Item "B::Lint"
\&\f(CW\*(C`B::Lint\*(C'\fR is now based on \f(CW\*(C`Module::Pluggable\*(C'\fR, and so can be extended
with plugins. (Joshua ben Jore)
.ie n .IP """B""" 4
.el .IP \f(CWB\fR 4
.IX Item "B"
It's now possible to access the lexical pragma hints (\f(CW\*(C`%^H\*(C'\fR) by using the
method \fBB::COP::hints_hash()\fR. It returns a \f(CW\*(C`B::RHE\*(C'\fR object, which in turn
can be used to get a hash reference via the method \fBB::RHE::HASH()\fR. (Joshua
ben Jore)
.ie n .IP """Thread""" 4
.el .IP \f(CWThread\fR 4
.IX Item "Thread"
As the old 5005thread threading model has been removed, in favor of the
ithreads scheme, the \f(CW\*(C`Thread\*(C'\fR module is now a compatibility wrapper, to
be used in old code only. It has been removed from the default list of
dynamic extensions.
.SH "Utility Changes"
.IX Header "Utility Changes"
.IP "perl \-d" 4
.IX Item "perl -d"
The Perl debugger can now save all debugger commands for sourcing later;
notably, it can now emulate stepping backwards, by restarting and
rerunning all bar the last command from a saved command history.
.Sp
It can also display the parent inheritance tree of a given class, with the
\&\f(CW\*(C`i\*(C'\fR command.
.IP ptar 4
.IX Item "ptar"
\&\f(CW\*(C`ptar\*(C'\fR is a pure perl implementation of \f(CW\*(C`tar\*(C'\fR that comes with
\&\f(CW\*(C`Archive::Tar\*(C'\fR.
.IP ptardiff 4
.IX Item "ptardiff"
\&\f(CW\*(C`ptardiff\*(C'\fR is a small utility used to generate a diff between the contents
of a tar archive and a directory tree. Like \f(CW\*(C`ptar\*(C'\fR, it comes with
\&\f(CW\*(C`Archive::Tar\*(C'\fR.
.IP shasum 4
.IX Item "shasum"
\&\f(CW\*(C`shasum\*(C'\fR is a command-line utility, used to print or to check SHA
digests. It comes with the new \f(CW\*(C`Digest::SHA\*(C'\fR module.
.IP corelist 4
.IX Item "corelist"
The \f(CW\*(C`corelist\*(C'\fR utility is now installed with perl (see "New modules"
above).
.IP "h2ph and h2xs" 4
.IX Item "h2ph and h2xs"
\&\f(CW\*(C`h2ph\*(C'\fR and \f(CW\*(C`h2xs\*(C'\fR have been made more robust with regard to
"modern" C code.
.Sp
\&\f(CW\*(C`h2xs\*(C'\fR implements a new option \f(CW\*(C`\-\-use\-xsloader\*(C'\fR to force use of
\&\f(CW\*(C`XSLoader\*(C'\fR even in backwards compatible modules.
.Sp
The handling of authors' names that had apostrophes has been fixed.
.Sp
Any enums with negative values are now skipped.
.IP perlivp 4
.IX Item "perlivp"
\&\f(CW\*(C`perlivp\*(C'\fR no longer checks for \fI*.ph\fR files by default.  Use the new \f(CW\*(C`\-a\*(C'\fR
option to run \fIall\fR tests.
.IP find2perl 4
.IX Item "find2perl"
\&\f(CW\*(C`find2perl\*(C'\fR now assumes \f(CW\*(C`\-print\*(C'\fR as a default action. Previously, it
needed to be specified explicitly.
.Sp
Several bugs have been fixed in \f(CW\*(C`find2perl\*(C'\fR, regarding \f(CW\*(C`\-exec\*(C'\fR and
\&\f(CW\*(C`\-eval\*(C'\fR. Also the options \f(CW\*(C`\-path\*(C'\fR, \f(CW\*(C`\-ipath\*(C'\fR and \f(CW\*(C`\-iname\*(C'\fR have been
added.
.IP config_data 4
.IX Item "config_data"
\&\f(CW\*(C`config_data\*(C'\fR is a new utility that comes with \f(CW\*(C`Module::Build\*(C'\fR. It
provides a command-line interface to the configuration of Perl modules
that use Module::Build's framework of configurability (that is,
\&\f(CW*::ConfigData\fR modules that contain local configuration information for
their parent modules.)
.IP cpanp 4
.IX Item "cpanp"
\&\f(CW\*(C`cpanp\*(C'\fR, the CPANPLUS shell, has been added. (\f(CW\*(C`cpanp\-run\-perl\*(C'\fR, a
helper for CPANPLUS operation, has been added too, but isn't intended for
direct use).
.IP cpan2dist 4
.IX Item "cpan2dist"
\&\f(CW\*(C`cpan2dist\*(C'\fR is a new utility that comes with CPANPLUS. It's a tool to
create distributions (or packages) from CPAN modules.
.IP pod2html 4
.IX Item "pod2html"
The output of \f(CW\*(C`pod2html\*(C'\fR has been enhanced to be more customizable via
CSS. Some formatting problems were also corrected. (Jari Aalto)
.SH "New Documentation"
.IX Header "New Documentation"
The perlpragma manpage documents how to write one's own lexical
pragmas in pure Perl (something that is possible starting with 5.9.4).
.PP
The new perlglossary manpage is a glossary of terms used in the Perl
documentation, technical and otherwise, kindly provided by O'Reilly Media,
Inc.
.PP
The perlreguts manpage, courtesy of Yves Orton, describes internals of the
Perl regular expression engine.
.PP
The perlreapi manpage describes the interface to the perl interpreter
used to write pluggable regular expression engines (by Ævar Arnfjörð
Bjarmason).
.PP
The perlunitut manpage is a tutorial for programming with Unicode and
string encodings in Perl, courtesy of Juerd Waalboer.
.PP
A new manual page, perlunifaq (the Perl Unicode FAQ), has been added
(Juerd Waalboer).
.PP
The perlcommunity manpage gives a description of the Perl community
on the Internet and in real life. (Edgar "Trizor" Bering)
.PP
The CORE manual page documents the \f(CW\*(C`CORE::\*(C'\fR namespace. (Tels)
.PP
The long-existing feature of \f(CW\*(C`/(?{...})/\*(C'\fR regexps setting \f(CW$_\fR and \fBpos()\fR
is now documented.
.SH "Performance Enhancements"
.IX Header "Performance Enhancements"
.SS "In-place sorting"
.IX Subsection "In-place sorting"
Sorting arrays in place (\f(CW\*(C`@a = sort @a\*(C'\fR) is now optimized to avoid
making a temporary copy of the array.
.PP
Likewise, \f(CW\*(C`reverse sort ...\*(C'\fR is now optimized to sort in reverse,
avoiding the generation of a temporary intermediate list.
.SS "Lexical array access"
.IX Subsection "Lexical array access"
Access to elements of lexical arrays via a numeric constant between 0 and
255 is now faster. (This used to be only the case for global arrays.)
.SS "XS-assisted SWASHGET"
.IX Subsection "XS-assisted SWASHGET"
Some pure-perl code that perl was using to retrieve Unicode properties and
transliteration mappings has been reimplemented in XS.
.SS "Constant subroutines"
.IX Subsection "Constant subroutines"
The interpreter internals now support a far more memory efficient form of
inlineable constants. Storing a reference to a constant value in a symbol
table is equivalent to a full typeglob referencing a constant subroutine,
but using about 400 bytes less memory. This proxy constant subroutine is
automatically upgraded to a real typeglob with subroutine if necessary.
The approach taken is analogous to the existing space optimisation for
subroutine stub declarations, which are stored as plain scalars in place
of the full typeglob.
.PP
Several of the core modules have been converted to use this feature for
their system dependent constants \- as a result \f(CW\*(C`use POSIX;\*(C'\fR now takes about
200K less memory.
.ie n .SS """PERL_DONT_CREATE_GVSV"""
.el .SS \f(CWPERL_DONT_CREATE_GVSV\fP
.IX Subsection "PERL_DONT_CREATE_GVSV"
The new compilation flag \f(CW\*(C`PERL_DONT_CREATE_GVSV\*(C'\fR, introduced as an option
in perl 5.8.8, is turned on by default in perl 5.9.3. It prevents perl
from creating an empty scalar with every new typeglob. See perl589delta
for details.
.SS "Weak references are cheaper"
.IX Subsection "Weak references are cheaper"
Weak reference creation is now \fIO(1)\fR rather than \fIO(n)\fR, courtesy of
Nicholas Clark. Weak reference deletion remains \fIO(n)\fR, but if deletion only
happens at program exit, it may be skipped completely.
.SS "\fBsort()\fP enhancements"
.IX Subsection "sort() enhancements"
Salvador Fandiño provided improvements to reduce the memory usage of \f(CW\*(C`sort\*(C'\fR
and to speed up some cases.
.SS "Memory optimisations"
.IX Subsection "Memory optimisations"
Several internal data structures (typeglobs, GVs, CVs, formats) have been
restructured to use less memory. (Nicholas Clark)
.SS "UTF\-8 cache optimisation"
.IX Subsection "UTF-8 cache optimisation"
The UTF\-8 caching code is now more efficient, and used more often.
(Nicholas Clark)
.SS "Sloppy stat on Windows"
.IX Subsection "Sloppy stat on Windows"
On Windows, perl's \fBstat()\fR function normally opens the file to determine
the link count and update attributes that may have been changed through
hard links. Setting ${^WIN32_SLOPPY_STAT} to a true value speeds up
\&\fBstat()\fR by not performing this operation. (Jan Dubois)
.SS "Regular expressions optimisations"
.IX Subsection "Regular expressions optimisations"
.IP "Engine de-recursivised" 4
.IX Item "Engine de-recursivised"
The regular expression engine is no longer recursive, meaning that
patterns that used to overflow the stack will either die with useful
explanations, or run to completion, which, since they were able to blow
the stack before, will likely take a very long time to happen. If you were
experiencing the occasional stack overflow (or segfault) and upgrade to
discover that now perl apparently hangs instead, look for a degenerate
regex. (Dave Mitchell)
.IP "Single char char-classes treated as literals" 4
.IX Item "Single char char-classes treated as literals"
Classes of a single character are now treated the same as if the character
had been used as a literal, meaning that code that uses char-classes as an
escaping mechanism will see a speedup. (Yves Orton)
.IP "Trie optimisation of literal string alternations" 4
.IX Item "Trie optimisation of literal string alternations"
Alternations, where possible, are optimised into more efficient matching
structures. String literal alternations are merged into a trie and are
matched simultaneously.  This means that instead of O(N) time for matching
N alternations at a given point, the new code performs in O(1) time.
A new special variable, ${^RE_TRIE_MAXBUF}, has been added to fine-tune
this optimization. (Yves Orton)
.Sp
\&\fBNote:\fR Much code exists that works around perl's historic poor
performance on alternations. Often the tricks used to do so will disable
the new optimisations. Hopefully the utility modules used for this purpose
will be educated about these new optimisations.
.IP "Aho-Corasick start-point optimisation" 4
.IX Item "Aho-Corasick start-point optimisation"
When a pattern starts with a trie-able alternation and there aren't
better optimisations available, the regex engine will use Aho-Corasick
matching to find the start point. (Yves Orton)
.SH "Installation and Configuration Improvements"
.IX Header "Installation and Configuration Improvements"
.SS "Configuration improvements"
.IX Subsection "Configuration improvements"
.ie n .IP """\-Dusesitecustomize""" 4
.el .IP \f(CW\-Dusesitecustomize\fR 4
.IX Item "-Dusesitecustomize"
Run-time customization of \f(CW@INC\fR can be enabled by passing the
\&\f(CW\*(C`\-Dusesitecustomize\*(C'\fR flag to Configure. When enabled, this will make perl
run \fR\f(CI$sitelibexp\fR\fI/sitecustomize.pl\fR before anything else.  This script can
then be set up to add additional entries to \f(CW@INC\fR.
.IP "Relocatable installations" 4
.IX Item "Relocatable installations"
There is now Configure support for creating a relocatable perl tree. If
you Configure with \f(CW\*(C`\-Duserelocatableinc\*(C'\fR, then the paths in \f(CW@INC\fR (and
everything else in \f(CW%Config\fR) can be optionally located via the path of the
perl executable.
.Sp
That means that, if the string \f(CW".../"\fR is found at the start of any
path, it's substituted with the directory of $^X. So, the relocation can
be configured on a per-directory basis, although the default with
\&\f(CW\*(C`\-Duserelocatableinc\*(C'\fR is that everything is relocated. The initial
install is done to the original configured prefix.
.IP "\fBstrlcat()\fR and \fBstrlcpy()\fR" 4
.IX Item "strlcat() and strlcpy()"
The configuration process now detects whether \fBstrlcat()\fR and \fBstrlcpy()\fR are
available.  When they are not available, perl's own version is used (from
Russ Allbery's public domain implementation).  Various places in the perl
interpreter now use them. (Steve Peters)
.ie n .IP """d_pseudofork"" and ""d_printf_format_null""" 4
.el .IP "\f(CWd_pseudofork\fR and \f(CWd_printf_format_null\fR" 4
.IX Item "d_pseudofork and d_printf_format_null"
A new configuration variable, available as \f(CW$Config{d_pseudofork}\fR in
the Config module, has been added, to distinguish real \fBfork()\fR support
from fake pseudofork used on Windows platforms.
.Sp
A new configuration variable, \f(CW\*(C`d_printf_format_null\*(C'\fR, has been added, 
to see if printf-like formats are allowed to be NULL.
.IP "Configure help" 4
.IX Item "Configure help"
\&\f(CW\*(C`Configure \-h\*(C'\fR has been extended with the most commonly used options.
.SS "Compilation improvements"
.IX Subsection "Compilation improvements"
.IP "Parallel build" 4
.IX Item "Parallel build"
Parallel makes should work properly now, although there may still be problems
if \f(CW\*(C`make test\*(C'\fR is instructed to run in parallel.
.IP "Borland's compilers support" 4
.IX Item "Borland's compilers support"
Building with Borland's compilers on Win32 should work more smoothly. In
particular Steve Hay has worked to side step many warnings emitted by their
compilers and at least one C compiler internal error.
.IP "Static build on Windows" 4
.IX Item "Static build on Windows"
Perl extensions on Windows now can be statically built into the Perl DLL.
.Sp
Also, it's now possible to build a \f(CW\*(C`perl\-static.exe\*(C'\fR that doesn't depend
on the Perl DLL on Win32. See the Win32 makefiles for details.
(Vadim Konovalov)
.IP "ppport.h files" 4
.IX Item "ppport.h files"
All \fIppport.h\fR files in the XS modules bundled with perl are now
autogenerated at build time. (Marcus Holland-Moritz)
.IP "C++ compatibility" 4
.IX Item "C++ compatibility"
Efforts have been made to make perl and the core XS modules compilable
with various C++ compilers (although the situation is not perfect with
some of the compilers on some of the platforms tested.)
.IP "Support for Microsoft 64\-bit compiler" 4
.IX Item "Support for Microsoft 64-bit compiler"
Support for building perl with Microsoft's 64\-bit compiler has been
improved. (ActiveState)
.IP "Visual C++" 4
.IX Item "Visual C++"
Perl can now be compiled with Microsoft Visual C++ 2005 (and 2008 Beta 2).
.IP "Win32 builds" 4
.IX Item "Win32 builds"
All win32 builds (MS-Win, WinCE) have been merged and cleaned up.
.SS "Installation improvements"
.IX Subsection "Installation improvements"
.IP "Module auxiliary files" 4
.IX Item "Module auxiliary files"
README files and changelogs for CPAN modules bundled with perl are no
longer installed.
.SS "New Or Improved Platforms"
.IX Subsection "New Or Improved Platforms"
Perl has been reported to work on Symbian OS. See perlsymbian for more
information.
.PP
Many improvements have been made towards making Perl work correctly on
z/OS.
.PP
Perl has been reported to work on DragonFlyBSD and MidnightBSD.
.PP
Perl has also been reported to work on NexentaOS
( http://www.gnusolaris.org/ ).
.PP
The VMS port has been improved. See perlvms.
.PP
Support for Cray XT4 Catamount/Qk has been added. See
\&\fIhints/catamount.sh\fR in the source code distribution for more
information.
.PP
Vendor patches have been merged for RedHat and Gentoo.
.PP
\&\fBDynaLoader::dl_unload_file()\fR now works on Windows.
.SH "Selected Bug Fixes"
.IX Header "Selected Bug Fixes"
.IP "strictures in regexp-eval blocks" 4
.IX Item "strictures in regexp-eval blocks"
\&\f(CW\*(C`strict\*(C'\fR wasn't in effect in regexp-eval blocks (\f(CW\*(C`/(?{...})/\*(C'\fR).
.IP "Calling \fBCORE::require()\fR" 4
.IX Item "Calling CORE::require()"
\&\fBCORE::require()\fR and \fBCORE::do()\fR were always parsed as \fBrequire()\fR and \fBdo()\fR
when they were overridden. This is now fixed.
.IP "Subscripts of slices" 4
.IX Item "Subscripts of slices"
You can now use a non-arrowed form for chained subscripts after a list
slice, like in:
.Sp
.Vb 1
\&    ({foo => "bar"})[0]{foo}
.Ve
.Sp
This used to be a syntax error; a \f(CW\*(C`\->\*(C'\fR was required.
.ie n .IP """no warnings \*(Aqcategory\*(Aq"" works correctly with \-w" 4
.el .IP "\f(CWno warnings \*(Aqcategory\*(Aq\fR works correctly with \-w" 4
.IX Item "no warnings category works correctly with -w"
Previously when running with warnings enabled globally via \f(CW\*(C`\-w\*(C'\fR, selective
disabling of specific warning categories would actually turn off all warnings.
This is now fixed; now \f(CW\*(C`no warnings \*(Aqio\*(Aq;\*(C'\fR will only turn off warnings in the
\&\f(CW\*(C`io\*(C'\fR class. Previously it would erroneously turn off all warnings.
.IP "threads improvements" 4
.IX Item "threads improvements"
Several memory leaks in ithreads were closed. Also, ithreads were made
less memory-intensive.
.Sp
\&\f(CW\*(C`threads\*(C'\fR is now a dual-life module, also available on CPAN. It has been
expanded in many ways. A \fBkill()\fR method is available for thread signalling.
One can get thread status, or the list of running or joinable threads.
.Sp
A new \f(CW\*(C`threads\->exit()\*(C'\fR method is used to exit from the application
(this is the default for the main thread) or from the current thread only
(this is the default for all other threads). On the other hand, the \fBexit()\fR
built-in now always causes the whole application to terminate. (Jerry
D. Hedden)
.IP "\fBchr()\fR and negative values" 4
.IX Item "chr() and negative values"
\&\fBchr()\fR on a negative value now gives \f(CW\*(C`\ex{FFFD}\*(C'\fR, the Unicode replacement
character, unless when the \f(CW\*(C`bytes\*(C'\fR pragma is in effect, where the low
eight bits of the value are used.
.IP "PERL5SHELL and tainting" 4
.IX Item "PERL5SHELL and tainting"
On Windows, the PERL5SHELL environment variable is now checked for
taintedness. (Rafael Garcia-Suarez)
.IP "Using *FILE{IO}" 4
.IX Item "Using *FILE{IO}"
\&\f(CWstat()\fR and \f(CW\*(C`\-X\*(C'\fR filetests now treat *FILE{IO} filehandles like *FILE
filehandles. (Steve Peters)
.IP "Overloading and reblessing" 4
.IX Item "Overloading and reblessing"
Overloading now works when references are reblessed into another class.
Internally, this has been implemented by moving the flag for "overloading"
from the reference to the referent, which logically is where it should
always have been. (Nicholas Clark)
.IP "Overloading and UTF\-8" 4
.IX Item "Overloading and UTF-8"
A few bugs related to UTF\-8 handling with objects that have
stringification overloaded have been fixed. (Nicholas Clark)
.IP "eval memory leaks fixed" 4
.IX Item "eval memory leaks fixed"
Traditionally, \f(CW\*(C`eval \*(Aqsyntax error\*(Aq\*(C'\fR has leaked badly. Many (but not all)
of these leaks have now been eliminated or reduced. (Dave Mitchell)
.IP "Random device on Windows" 4
.IX Item "Random device on Windows"
In previous versions, perl would read the file \fI/dev/urandom\fR if it
existed when seeding its random number generator.  That file is unlikely
to exist on Windows, and if it did would probably not contain appropriate
data, so perl no longer tries to read it on Windows. (Alex Davies)
.IP PERLIO_DEBUG 4
.IX Item "PERLIO_DEBUG"
The \f(CW\*(C`PERLIO_DEBUG\*(C'\fR environment variable no longer has any effect for
setuid scripts and for scripts run with \fB\-T\fR.
.Sp
Moreover, with a thread-enabled perl, using \f(CW\*(C`PERLIO_DEBUG\*(C'\fR could lead to
an internal buffer overflow. This has been fixed.
.IP "PerlIO::scalar and read-only scalars" 4
.IX Item "PerlIO::scalar and read-only scalars"
PerlIO::scalar will now prevent writing to read-only scalars. Moreover,
\&\fBseek()\fR is now supported with PerlIO::scalar\-based filehandles, the
underlying string being zero-filled as needed. (Rafael, Jarkko Hietaniemi)
.IP "\fBstudy()\fR and UTF\-8" 4
.IX Item "study() and UTF-8"
\&\fBstudy()\fR never worked for UTF\-8 strings, but could lead to false results.
It's now a no-op on UTF\-8 data. (Yves Orton)
.IP "Critical signals" 4
.IX Item "Critical signals"
The signals SIGILL, SIGBUS and SIGSEGV are now always delivered in an
"unsafe" manner (contrary to other signals, that are deferred until the
perl interpreter reaches a reasonably stable state; see
"Deferred Signals (Safe Signals)" in perlipc). (Rafael)
.ie n .IP "@INC\-hook fix" 4
.el .IP "\f(CW@INC\fR\-hook fix" 4
.IX Item "@INC-hook fix"
When a module or a file is loaded through an \f(CW@INC\fR\-hook, and when this hook
has set a filename entry in \f(CW%INC\fR, _\|_FILE_\|_ is now set for this module
accordingly to the contents of that \f(CW%INC\fR entry. (Rafael)
.ie n .IP """\-t"" switch fix" 4
.el .IP "\f(CW\-t\fR switch fix" 4
.IX Item "-t switch fix"
The \f(CW\*(C`\-w\*(C'\fR and \f(CW\*(C`\-t\*(C'\fR switches can now be used together without messing
up which categories of warnings are activated. (Rafael)
.IP "Duping UTF\-8 filehandles" 4
.IX Item "Duping UTF-8 filehandles"
Duping a filehandle which has the \f(CW\*(C`:utf8\*(C'\fR PerlIO layer set will now
properly carry that layer on the duped filehandle. (Rafael)
.IP "Localisation of hash elements" 4
.IX Item "Localisation of hash elements"
Localizing a hash element whose key was given as a variable didn't work
correctly if the variable was changed while the \fBlocal()\fR was in effect (as
in \f(CW\*(C`local $h{$x}; ++$x\*(C'\fR). (Bo Lindbergh)
.SH "New or Changed Diagnostics"
.IX Header "New or Changed Diagnostics"
.IP "Use of uninitialized value" 4
.IX Item "Use of uninitialized value"
Perl will now try to tell you the name of the variable (if any) that was
undefined.
.IP "Deprecated use of \fBmy()\fR in false conditional" 4
.IX Item "Deprecated use of my() in false conditional"
A new deprecation warning, \fIDeprecated use of \fR\f(BImy()\fR\fI in false conditional\fR,
has been added, to warn against the use of the dubious and deprecated
construct
.Sp
.Vb 1
\&    my $x if 0;
.Ve
.Sp
See perldiag. Use \f(CW\*(C`state\*(C'\fR variables instead.
.IP "!=~ should be !~" 4
.IX Item "!=~ should be !~"
A new warning, \f(CW\*(C`!=~ should be !~\*(C'\fR, is emitted to prevent this misspelling
of the non-matching operator.
.IP "Newline in left-justified string" 4
.IX Item "Newline in left-justified string"
The warning \fINewline in left-justified string\fR has been removed.
.IP "Too late for ""\-T"" option" 4
.IX Item "Too late for ""-T"" option"
The error \fIToo late for "\-T" option\fR has been reformulated to be more
descriptive.
.ie n .IP """%s"" variable %s masks earlier declaration" 4
.el .IP """%s"" variable \f(CW%s\fR masks earlier declaration" 4
.IX Item """%s"" variable %s masks earlier declaration"
This warning is now emitted in more consistent cases; in short, when one
of the declarations involved is a \f(CW\*(C`my\*(C'\fR variable:
.Sp
.Vb 3
\&    my $x;   my $x;     # warns
\&    my $x;  our $x;     # warns
\&    our $x;  my $x;     # warns
.Ve
.Sp
On the other hand, the following:
.Sp
.Vb 1
\&    our $x; our $x;
.Ve
.Sp
now gives a \f(CW\*(C`"our" variable %s redeclared\*(C'\fR warning.
.IP "\fBreaddir()\fR/\fBclosedir()\fR/etc. attempted on invalid dirhandle" 4
.IX Item "readdir()/closedir()/etc. attempted on invalid dirhandle"
These new warnings are now emitted when a dirhandle is used but is
either closed or not really a dirhandle.
.ie n .IP "Opening dirhandle/filehandle %s also as a file/directory" 4
.el .IP "Opening dirhandle/filehandle \f(CW%s\fR also as a file/directory" 4
.IX Item "Opening dirhandle/filehandle %s also as a file/directory"
Two deprecation warnings have been added: (Rafael)
.Sp
.Vb 2
\&    Opening dirhandle %s also as a file
\&    Opening filehandle %s also as a directory
.Ve
.IP "Use of \-P is deprecated" 4
.IX Item "Use of -P is deprecated"
Perl's command-line switch \f(CW\*(C`\-P\*(C'\fR is now deprecated.
.IP "v\-string in use/require is non-portable" 4
.IX Item "v-string in use/require is non-portable"
Perl will warn you against potential backwards compatibility problems with
the \f(CW\*(C`use VERSION\*(C'\fR syntax.
.IP "perl \-V" 4
.IX Item "perl -V"
\&\f(CW\*(C`perl \-V\*(C'\fR has several improvements, making it more useable from shell
scripts to get the value of configuration variables. See perlrun for
details.
.SH "Changed Internals"
.IX Header "Changed Internals"
In general, the source code of perl has been refactored, tidied up,
and optimized in many places. Also, memory management and allocation
has been improved in several points.
.PP
When compiling the perl core with gcc, as many gcc warning flags are
turned on as is possible on the platform.  (This quest for cleanliness
doesn't extend to XS code because we cannot guarantee the tidiness of
code we didn't write.)  Similar strictness flags have been added or
tightened for various other C compilers.
.SS "Reordering of SVt_* constants"
.IX Subsection "Reordering of SVt_* constants"
The relative ordering of constants that define the various types of \f(CW\*(C`SV\*(C'\fR
have changed; in particular, \f(CW\*(C`SVt_PVGV\*(C'\fR has been moved before \f(CW\*(C`SVt_PVLV\*(C'\fR,
\&\f(CW\*(C`SVt_PVAV\*(C'\fR, \f(CW\*(C`SVt_PVHV\*(C'\fR and \f(CW\*(C`SVt_PVCV\*(C'\fR.  This is unlikely to make any
difference unless you have code that explicitly makes assumptions about that
ordering. (The inheritance hierarchy of \f(CW\*(C`B::*\*(C'\fR objects has been changed
to reflect this.)
.SS "Elimination of SVt_PVBM"
.IX Subsection "Elimination of SVt_PVBM"
Related to this, the internal type \f(CW\*(C`SVt_PVBM\*(C'\fR has been removed. This
dedicated type of \f(CW\*(C`SV\*(C'\fR was used by the \f(CW\*(C`index\*(C'\fR operator and parts of the
regexp engine to facilitate fast Boyer-Moore matches. Its use internally has
been replaced by \f(CW\*(C`SV\*(C'\fRs of type \f(CW\*(C`SVt_PVGV\*(C'\fR.
.SS "New type SVt_BIND"
.IX Subsection "New type SVt_BIND"
A new type \f(CW\*(C`SVt_BIND\*(C'\fR has been added, in readiness for the project to
implement Perl 6 on 5. There deliberately is no implementation yet, and
they cannot yet be created or destroyed.
.SS "Removal of CPP symbols"
.IX Subsection "Removal of CPP symbols"
The C preprocessor symbols \f(CW\*(C`PERL_PM_APIVERSION\*(C'\fR and
\&\f(CW\*(C`PERL_XS_APIVERSION\*(C'\fR, which were supposed to give the version number of
the oldest perl binary-compatible (resp. source-compatible) with the
present one, were not used, and sometimes had misleading values. They have
been removed.
.SS "Less space is used by ops"
.IX Subsection "Less space is used by ops"
The \f(CW\*(C`BASEOP\*(C'\fR structure now uses less space. The \f(CW\*(C`op_seq\*(C'\fR field has been
removed and replaced by a single bit bit-field \f(CW\*(C`op_opt\*(C'\fR. \f(CW\*(C`op_type\*(C'\fR is now 9
bits long. (Consequently, the \f(CW\*(C`B::OP\*(C'\fR class doesn't provide an \f(CW\*(C`seq\*(C'\fR
method anymore.)
.SS "New parser"
.IX Subsection "New parser"
perl's parser is now generated by bison (it used to be generated by
byacc.) As a result, it seems to be a bit more robust.
.PP
Also, Dave Mitchell improved the lexer debugging output under \f(CW\*(C`\-DT\*(C'\fR.
.ie n .SS "Use of ""const"""
.el .SS "Use of \f(CWconst\fP"
.IX Subsection "Use of const"
Andy Lester supplied many improvements to determine which function
parameters and local variables could actually be declared \f(CW\*(C`const\*(C'\fR to the C
compiler. Steve Peters provided new \f(CW*_set\fR macros and reworked the core to
use these rather than assigning to macros in LVALUE context.
.SS Mathoms
.IX Subsection "Mathoms"
A new file, \fImathoms.c\fR, has been added. It contains functions that are
no longer used in the perl core, but that remain available for binary or
source compatibility reasons. However, those functions will not be
compiled in if you add \f(CW\*(C`\-DNO_MATHOMS\*(C'\fR in the compiler flags.
.ie n .SS """AvFLAGS"" has been removed"
.el .SS "\f(CWAvFLAGS\fP has been removed"
.IX Subsection "AvFLAGS has been removed"
The \f(CW\*(C`AvFLAGS\*(C'\fR macro has been removed.
.ie n .SS """av_*"" changes"
.el .SS "\f(CWav_*\fP changes"
.IX Subsection "av_* changes"
The \f(CW\*(C`av_*()\*(C'\fR functions, used to manipulate arrays, no longer accept null
\&\f(CW\*(C`AV*\*(C'\fR parameters.
.SS "$^H and %^H"
.IX Subsection "$^H and %^H"
The implementation of the special variables $^H and %^H has changed, to
allow implementing lexical pragmas in pure Perl.
.SS "B:: modules inheritance changed"
.IX Subsection "B:: modules inheritance changed"
The inheritance hierarchy of \f(CW\*(C`B::\*(C'\fR modules has changed; \f(CW\*(C`B::NV\*(C'\fR now
inherits from \f(CW\*(C`B::SV\*(C'\fR (it used to inherit from \f(CW\*(C`B::IV\*(C'\fR).
.SS "Anonymous hash and array constructors"
.IX Subsection "Anonymous hash and array constructors"
The anonymous hash and array constructors now take 1 op in the optree
instead of 3, now that pp_anonhash and pp_anonlist return a reference to
a hash/array when the op is flagged with OPf_SPECIAL. (Nicholas Clark)
.SH "Known Problems"
.IX Header "Known Problems"
There's still a remaining problem in the implementation of the lexical
\&\f(CW$_\fR: it doesn't work inside \f(CW\*(C`/(?{...})/\*(C'\fR blocks. (See the TODO test in
\&\fIt/op/mydef.t\fR.)
.PP
Stacked filetest operators won't work when the \f(CW\*(C`filetest\*(C'\fR pragma is in
effect, because they rely on the \fBstat()\fR buffer \f(CW\*(C`_\*(C'\fR being populated, and
filetest bypasses \fBstat()\fR.
.SS "UTF\-8 problems"
.IX Subsection "UTF-8 problems"
The handling of Unicode still is unclean in several places, where it's
dependent on whether a string is internally flagged as UTF\-8. This will
be made more consistent in perl 5.12, but that won't be possible without
a certain amount of backwards incompatibility.
.SH "Platform Specific Problems"
.IX Header "Platform Specific Problems"
When compiled with g++ and thread support on Linux, it's reported that the
\&\f(CW$!\fR stops working correctly. This is related to the fact that the glibc
provides two \fBstrerror_r\fR\|(3) implementation, and perl selects the wrong
one.
.SH "Reporting Bugs"
.IX Header "Reporting Bugs"
If you find what you think is a bug, you might check the articles
recently posted to the comp.lang.perl.misc newsgroup and the perl
bug database at http://rt.perl.org/rt3/ .  There may also be
information at http://www.perl.org/ , the Perl Home Page.
.PP
If you believe you have an unreported bug, please run the \fBperlbug\fR
program included with your release.  Be sure to trim your bug down
to a tiny but sufficient test case.  Your bug report, along with the
output of \f(CW\*(C`perl \-V\*(C'\fR, will be sent off to perlbug@perl.org to be
analysed by the Perl porting team.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
The \fIChanges\fR file and the perl590delta to perl595delta man pages for
exhaustive details on what changed.
.PP
The \fIINSTALL\fR file for how to build Perl.
.PP
The \fIREADME\fR file for general stuff.
.PP
The \fIArtistic\fR and \fICopying\fR files for copyright information.