File: BugLog.html

package info (click to toggle)
perltidy 20220613-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,256 kB
  • sloc: perl: 31,994; makefile: 4
file content (5346 lines) | stat: -rw-r--r-- 233,648 bytes parent folder | download | duplicates (2)
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
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
<?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></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>

<body>



<ul id="index">
  <li><a href="#Issues-fixed-after-release-20211029">Issues fixed after release 20211029</a></li>
  <li><a href="#Issues-fixed-after-release-20210625">Issues fixed after release 20210625</a></li>
  <li><a href="#Issues-fixed-after-release-20210402">Issues fixed after release 20210402</a></li>
  <li><a href="#Issues-fixed-after-release-20210111">Issues fixed after release 20210111</a></li>
  <li><a href="#Issues-fixed-after-release-20201207">Issues fixed after release 20201207</a></li>
  <li><a href="#Issues-fixed-after-release-20201202">Issues fixed after release 20201202</a></li>
  <li><a href="#Issues-fixed-after-release-20201001">Issues fixed after release 20201001</a></li>
  <li><a href="#Issues-fixed-after-release-20200907">Issues fixed after release 20200907</a></li>
  <li><a href="#Open-Issues">Open Issues</a></li>
</ul>

<h1 id="Issues-fixed-after-release-20211029">Issues fixed after release 20211029</h1>

<dl>

<dt id="Fix-tokenization-issue-c109"><b>Fix tokenization issue c109</b></dt>
<dd>

<p>Automated random testing produced an error tokenizing the following code fragment:</p>

<pre><code>    s s(..)(.)sss
    ;</code></pre>

<p>This is equivalent to &#39;s/(..)(.)//s&#39; with &#39;s&#39; as the delimiter instead of &#39;/&#39;. It was tokenized correctly except when the final &#39;s&#39; was followed by a newline, as in the example. When the delimiter is a letter rather than a punctuation character, perltidy exercises some seldom-used code which had an off-by-one loop limit. This has been fixed.</p>

<p>12 Nov 2021.</p>

</dd>
<dt id="Fix-tokenization-of-issue-c106"><b>Fix tokenization of $$^, issue c106</b></dt>
<dd>

<p>Automated random testing produced an error tokenizing the following fragment:</p>

<pre><code>   my$seed=$$^$^T;</code></pre>

<p>The first ^ should have been tokenized as the bitwise xor operator but was not. This is fixed with this update.</p>

<p>8 Nov 2021</p>

</dd>
<dt id="Fix-coding-error-issue-c104"><b>Fix coding error, issue c104</b></dt>
<dd>

<p>Automated random testing produced an error with something like the following input line taken from an obfuscated perl script:</p>

<pre><code>    open(IN, $ 0);</code></pre>

<p>The &#39;0&#39; was missing in the output:</p>

<pre><code>    open( IN, $ );</code></pre>

<p>The tokenization was correct, but a line of code in the formatter which removes the space between the &#39;$&#39; and the &#39;0&#39; should have used a &#39;defined&#39; when doing a check:</p>

<pre><code>    $token .= $word if ($word);             # OLD: error</code></pre>

<p>This if test fails on &#39;0&#39;. The corrected line is</p>

<pre><code>    $token .= $word if ( defined($word) );  # NEW: fixes c104</code></pre>

<p>This fixes the problem and gives the correct formatted result</p>

<pre><code>    open( IN, $0 );</code></pre>

<p>8 Nov 2021.</p>

</dd>
<dt id="Fix-undefined-variable-reference-c102"><b>Fix undefined variable reference, c102</b></dt>
<dd>

<p>Random testing produced an undefined variable reference for the following input</p>

<pre><code>    make_sorter ( sort_sha =&gt; sub {sha512 ( $_} );
    make_sorter ( sort_ids =&gt; sub {/^ID:(\d+)/} );</code></pre>

<p>when formatted with the following input parameters:</p>

<pre><code>    --space-function-paren
    --maximum-line-length=26
    --noadd-newlines</code></pre>

<p>Notice that the input script has a peculiar syntax error - the last two closing tokens of the first line are transposed. (Ironically, this snippet is taken from code which accompanied the book Perl Best Practices). The perltidy tokenizer caught the syntax error, but the formatter touched an undefined variable while attempting to do the formatting. It would be possible to just skip formatting for errors like this, but it can sometimes help finding bugs to see an attempted formatting. So the formatter coding has been corrected to avoid the undefined variable reference.</p>

<p>This fixes issue c102.</p>

<p>5 Nov 2021.</p>

</dd>
<dt id="Some-blocks-with-side-comments-exceed-line-length"><b>Some blocks with side comments exceed line length</b></dt>
<dd>

<p>In some rare cases, one-line blocks with side comments were exceeding the line length limit. These usually had a semicolon between the closing block brace and the side comment. For example:</p>

<pre><code>        my $size
            = do { local $^W; -f $local &amp;&amp; -s _ }; # no ALLO if sending data from a pipe</code></pre>

<p>This update breaks the one-line block in an attempt to keep the total length below the line length limit. The result on the above is:</p>

<pre><code>        my $size = do {
            local $^W;
            -f $local &amp;&amp; -s _;
        };    # no ALLO if sending data from a pipe</code></pre>

<p>Note that this break can be prevented by including the flag --ignore-side-comment-lengths or -iscl.</p>

<p>3 Nov 2021.</p>

</dd>
</dl>

<h1 id="Issues-fixed-after-release-20210625">Issues fixed after release 20210625</h1>

<dl>

<dt id="Fix-c090-inconsistent-warning-messages-for-deprecated-syntax"><b>Fix c090, inconsistent warning messages for deprecated syntax</b></dt>
<dd>

<p>For something like the following snippet, a warning about deprecated syntax was either going into the error file or the log file, depending on formatting. This has been fixed.</p>

<pre><code>   do $roff ( &amp;verify($tpage) );</code></pre>

<p>20 Oct 2021, 72e4bb1.</p>

</dd>
<dt id="Fix-c091-incorrect-closing-side-comment"><b>Fix c091, incorrect closing side comment</b></dt>
<dd>

<p>An error was discovered and corrected in the behavior of the --closing-side-comment (-csc) flag when only subs were being marked with the setting -cscl=&#39;sub&#39;. The problem was that in rare cases a closing paren could be marked with &#39;## end&#39;. The cause of the problem is that the pattern matching regex which was generated for this case happens to match an empty string, and it could happen that certain parens had empty strings as block names. This was fixed in two ways. First, the regex was fixed so that it cannot match an empty string. Second, a test for an empty string was added.</p>

<p>20 Oct 2021, aa1a019.</p>

</dd>
<dt id="Issue-c089-improve-vertical-alignment-for-lists-without-parens"><b>Issue c089, improve vertical alignment for lists without parens</b></dt>
<dd>

<p>An update was made to improve vertical alignment in situations where parens are omitted around lists. The goal is to make lists without parens align as they would if they were contained in parens. Some examples:</p>

<pre><code>    # OLD, no parens, no alignment:
    glVertex3d $cx + $s * $xs, $cy, $z;
    glVertex3d $cx, $cy + $s * $ys, $z;
    glVertex3d $cx - $s * $xs, $cy, $z;
    glVertex3d $cx, $cy - $s * $ys, $z;

    # OLD, with parens and aligned:
    glVertex3d( $cx + $s * $xs, $cy,            $z );
    glVertex3d( $cx,            $cy + $s * $ys, $z );
    glVertex3d( $cx - $s * $xs, $cy,            $z );
    glVertex3d( $cx,            $cy - $s * $ys, $z );

    # NEW, no parens but aligned
    glVertex3d $cx + $s * $xs, $cy,            $z;
    glVertex3d $cx,            $cy + $s * $ys, $z;
    glVertex3d $cx - $s * $xs, $cy,            $z;
    glVertex3d $cx,            $cy - $s * $ys, $z;

    # OLD
    mkTextConfig $c, $x, $y, -anchor =&gt; &#39;se&#39;, $color;
    mkTextConfig $c, $x + 30, $y, -anchor =&gt; &#39;s&#39;,  $color;
    mkTextConfig $c, $x + 60, $y, -anchor =&gt; &#39;sw&#39;, $color;
    mkTextConfig $c, $x, $y + 30, -anchor =&gt; &#39;e&#39;, $color;

    # NEW
    mkTextConfig $c, $x,      $y,      -anchor =&gt; &#39;se&#39;, $color;
    mkTextConfig $c, $x + 30, $y,      -anchor =&gt; &#39;s&#39;,  $color;
    mkTextConfig $c, $x + 60, $y,      -anchor =&gt; &#39;sw&#39;, $color;
    mkTextConfig $c, $x,      $y + 30, -anchor =&gt; &#39;e&#39;,  $color;

    # OLD
    permute_test [ &#39;a&#39;, &#39;b&#39;, &#39;c&#39; ],   &#39;/&#39;, &#39;/&#39;, [ &#39;a&#39;, &#39;b&#39;, &#39;c&#39; ];
    permute_test [ &#39;a,&#39;, &#39;b&#39;, &#39;c,&#39; ], &#39;/&#39;, &#39;/&#39;, [ &#39;a,&#39;, &#39;b&#39;, &#39;c,&#39; ];
    permute_test [ &#39;a&#39;, &#39;,&#39;, &#39;#&#39;, &#39;c&#39; ], &#39;/&#39;, &#39;/&#39;, [ &#39;a&#39;, &#39;,&#39;, &#39;#&#39;, &#39;c&#39; ];
    permute_test [ &#39;f_oo&#39;, &#39;b_ar&#39; ], &#39;/&#39;, &#39;/&#39;, [ &#39;f_oo&#39;, &#39;b_ar&#39; ];

    # NEW
    permute_test [ &#39;a&#39;, &#39;b&#39;, &#39;c&#39; ],      &#39;/&#39;, &#39;/&#39;, [ &#39;a&#39;, &#39;b&#39;, &#39;c&#39; ];
    permute_test [ &#39;a,&#39;, &#39;b&#39;, &#39;c,&#39; ],    &#39;/&#39;, &#39;/&#39;, [ &#39;a,&#39;, &#39;b&#39;, &#39;c,&#39; ];
    permute_test [ &#39;a&#39;, &#39;,&#39;, &#39;#&#39;, &#39;c&#39; ], &#39;/&#39;, &#39;/&#39;, [ &#39;a&#39;, &#39;,&#39;, &#39;#&#39;, &#39;c&#39; ];
    permute_test [ &#39;f_oo&#39;, &#39;b_ar&#39; ],     &#39;/&#39;, &#39;/&#39;, [ &#39;f_oo&#39;, &#39;b_ar&#39; ];

    # OLD:
    is $thingy, &quot;fee&quot;,           &quot;source filters apply to evalbytten strings&quot;;
    is &quot;foo&quot;,   $unfiltered_foo, &#39;filters leak not out of byte evals&#39;;
    is $av-&gt;[2], &quot;NAME:my_xop&quot;,          &quot;OP_NAME returns registered name&quot;;
    is $av-&gt;[3], &quot;DESC:XOP for testing&quot;, &quot;OP_DESC returns registered desc&quot;;
    is $av-&gt;[4], &quot;CLASS:$OA_UNOP&quot;,       &quot;OP_CLASS returns registered class&quot;;
    is scalar @$av, 7, &quot;registered peep called&quot;;
    is $av-&gt;[5], &quot;peep:$unop&quot;, &quot;...with correct &#39;o&#39; param&quot;;
    is $av-&gt;[6], &quot;oldop:$kid&quot;, &quot;...and correct &#39;oldop&#39; param&quot;;

    # NEW
    is $av-&gt;[2],    &quot;NAME:my_xop&quot;,          &quot;OP_NAME returns registered name&quot;;
    is $av-&gt;[3],    &quot;DESC:XOP for testing&quot;, &quot;OP_DESC returns registered desc&quot;;
    is $av-&gt;[4],    &quot;CLASS:$OA_UNOP&quot;,       &quot;OP_CLASS returns registered class&quot;;
    is scalar @$av, 7,                      &quot;registered peep called&quot;;
    is $av-&gt;[5],    &quot;peep:$unop&quot;,           &quot;...with correct &#39;o&#39; param&quot;;
    is $av-&gt;[6],    &quot;oldop:$kid&quot;,           &quot;...and correct &#39;oldop&#39; param&quot;;</code></pre>

<p>20 Oct 2021, 1dffec5.</p>

</dd>
<dt id="Issue-c087-breaking-after-anonymous-sub"><b>Issue c087, breaking after anonymous sub</b></dt>
<dd>

<p>This update keeps both of these configurations stable for all cases except when the -lp option is used. For the -lp option, both become one-line blocks (the second case) to prevents the -lp indentation style from being lost. This update was made to minimize changes to existing formatting.</p>

<pre><code>    $obj = {
        foo =&gt; sub { &quot;bar&quot; }
    };

    $obj = { foo =&gt; sub { &quot;bar&quot; } };</code></pre>

<p>17 Oct 2021, f05e6b5.</p>

</dd>
<dt id="Improve-formatting-of-some-Moose-structures"><b>Improve formatting of some Moose structures</b></dt>
<dd>

<p>In some structures used in Moose coding, some asymmetrical container breaks were being caused by the braces being tokenized as hash braces rather than block braces. This was also causing some unwanted warning messages.</p>

<pre><code>    # OLD
    ::is(
        ::exception { has &#39;+bar&#39; =&gt; ( default =&gt; sub { 100 } );
        },
        undef,
        &#39;... extended the attribute successfully&#39;
    );

    # NEW
    ::is(
        ::exception {
            has &#39;+bar&#39; =&gt; ( default =&gt; sub { 100 } );
        },
        undef,
        &#39;... extended the attribute successfully&#39;
    );</code></pre>

<p>This fixes issue c074.</p>

<p>12 Oct 2021, 7e873fa.</p>

</dd>
<dt id="Fix-issue-c081--cscw-preventing-deletion-of-closing-side-comments"><b>Fix issue c081, -cscw preventing deletion of closing side comments</b></dt>
<dd>

<p>Random testing revealed a problem in which an old closing side comment was not being deleted when it fell below the interval specified on -csci=n and the -cscw flag was also set.</p>

<p>For example, the following snippet has been formatted with -csc -csci=1. The interval -csci=1 insures that all blocks get side comments:</p>

<pre><code>    if ($x3) {
        $zz;
        if ($x2) {
            if ($x1) {
                ..;
            } ## end if ($x1)
            $a;
            $b;
            $c;
        } ## end if ($x2)
    } ## end if ($x3)</code></pre>

<p>If we then run with -csc -csci=6, the comment ## end if ($x1) will fall below the threshold and be removed (correctly):</p>

<pre><code>    if ($x3) {
        $zz;
        if ($x2) {
            if ($x1) {
                ..;
            }
            $a;
            $b;
            $c;
        } ## end if ($x2)
    } ## end if ($x3)</code></pre>

<p>But if we also add the -cscw flag (warnings) then it was not being removed. This update fixes this problem (issue c081).</p>

<p>2 Oct 2021, 25ef8e8</p>

</dd>
<dt id="Partial-fix-for-issue-git-74-on--lp-at-anonymous-subs"><b>Partial fix for issue git #74 on -lp at anonymous subs</b></dt>
<dd>

<p>In the following snippet, the final one-line anonymous sub is not followed by a comma. This caused the -lp mode to revert to standard indentation mode because a forced line break was being made after the closing sub brace:</p>

<pre><code>    # OLD, perltidy -lp
    $got = timethese(
        $iterations,
        {
          Foo =&gt; sub { ++$foo },
          Bar =&gt; &#39;++$bar&#39;,
          Baz =&gt; sub { ++$baz }
        }
    );</code></pre>

<p>An update was made to check for and fix this.</p>

<pre><code>    # NEW, perltidy -lp
    $got = timethese(
                      $iterations,
                      {
                         Foo =&gt; sub { ++$foo },
                         Bar =&gt; &#39;++$bar&#39;,
                         Baz =&gt; sub { ++$baz }
                      }
    );</code></pre>

<p>But note that this only applies to one-line anonymous subs. If an anonymous sub is broken into several lines due to its length or complexity, then these forced line breaks cause indentation to revert to the standard indentation scheme.</p>

<p>22 Sep 2021, 4fd58f7.</p>

</dd>
<dt id="Fix-issues-b1209-related-to--vmll"><b>Fix issues b1209 related to -vmll</b></dt>
<dd>

<p>Testing with random parameters produced a formatting instability related to the -vmll flag. The problem was due to a subtle difference in the definition of nesting depth and indentation level. The vertical aligner was using nesting depth instead of indentation level to compute the maximum line length when -vmll is set. In some rare cases there is a difference. The problem was fixed by passing the maximum line length to the vertical aligner so that the calculation is only done in the formatter. This fixes b1209.</p>

<p>20 Sep 2021, acf1d2d.</p>

</dd>
<dt id="Fix-issue-b1208"><b>Fix issue b1208</b></dt>
<dd>

<p>Testing with random parameters produced a formatting instability which could be triggered when there is a short line length limit and there is a long side comment on the closing brace of a sort/map/grep/eval block. The problem was due to not correctly including the length of the side comment when testing to see if the block could fit on one line. This update fixes issue b1208.</p>

<p>18 Sep 2021, 0af1321.</p>

</dd>
<dt id="Fix-issue-git-73"><b>Fix issue git #73</b></dt>
<dd>

<p>The -nfpva parameter was not working correctly for functions called with pointers. For example</p>

<pre><code>    # OLD: perltidy -sfp -nfpva
    $self-&gt;method                ( &#39;parameter_0&#39;, &#39;parameter_1&#39; );
    $self-&gt;method_with_long_name ( &#39;parameter_0&#39;, &#39;parameter_1&#39; );

    # FIXED: perltidy -sfp -nfpva
    $self-&gt;method ( &#39;parameter_0&#39;, &#39;parameter_1&#39; );
    $self-&gt;method_with_long_name ( &#39;parameter_0&#39;, &#39;parameter_1&#39; );</code></pre>

<p>The problem had to do with how the pointer tokens &#39;-&gt;&#39; are represented internally and has been fixed.</p>

<p>17 Sep 2021,e3b4a6f.</p>

</dd>
<dt id="Fix-unusual-parsing-error-b1207"><b>Fix unusual parsing error b1207</b></dt>
<dd>

<p>Testing with random parameters produced another instability caused by misparsing an &#39;x&#39; operator after a possible file handle. This is very similar to b1205, but involves a sigil immediately following a times operator.</p>

<p>To illustrate some cases, consider:</p>

<pre><code>    sub x {print &quot;arg is $_[0]\n&quot;}
    my $num = 3;
    my @list=(1,2,3);
    my %hash=(1,2,3,4);
    open (my $fh, &quot;&gt;&quot;, &quot;junk.txt&quot;);
    print $fh x$num;   # prints a GLOB $num times to STDOUT
    print $fh x9;      # prints &#39;x9&#39; to file &#39;junk.txt&#39;
    print $fh x@list;  # prints a GLOB 3 times to STDOUT
    print $fh x%hash;  # prints a GLOB 2 times to STDOUT</code></pre>

<p>Note in particular the different treatment of the first two print statements.</p>

<p>This update fixes case b1207.</p>

<p>15 Sep 2021, 107586f.</p>

</dd>
<dt id="Fix-formatting-instability-b1206"><b>Fix formatting instability b1206</b></dt>
<dd>

<p>Testing with random parameters produced an instability due welding with a very short line length and large value of -ci. This is similar to issues b1197-b1204 and fixed with a similar method.</p>

<p>14 Sep 2021, 9704cd7.</p>

</dd>
<dt id="Fix-unusual-parsing-error-b1205"><b>Fix unusual parsing error b1205</b></dt>
<dd>

<p>Testing with random parameters produced an instability caused by misparsing an &#39;x&#39; operator after a possible file handle. Testing with Perl showed that an &#39;x&#39; followed by a &#39;(&#39; in this location is always the &#39;times&#39; operator and never a call to a function &#39;x&#39;. If x is immediately followed by a number it is subject to the usual weird parsing rules at such a location.</p>

<p>To illustrate, consider what these statements do:</p>

<pre><code>    open( my $zz, &quot;&gt;&quot;, &quot;junk.txt&quot; );
    sub x { return $_[0] }  # never called
    print $zz x(2);    # prints a glob 2 times; not a function call
    print $zz x 2;     # prints a glob 2 times
    print $zz x2;      # syntax error
    print $zz x;       # syntax error
    print $zz z;       # prints &#39;z&#39; in file &#39;junk.txt&#39;</code></pre>

<p>This update fixes case b1205.</p>

<p>13 Sep 2021, cfa2515.</p>

</dd>
<dt id="Use-stress_level-to-fix-cases-b1197-b1204"><b>Use stress_level to fix cases b1197-b1204</b></dt>
<dd>

<p>Testing with random input parameters produced a number of cases of unstable formatting. All of these involved some combination of a short maximum line length, a large -ci and -i, and often one or more of -xci -lp and -wn. These parameters can force lines to break at poor locations. All of these cases were fixed by introducing a quantity called the &#39;stress_level&#39;, which is the approximate indentation level at which the line break logic comes under high stress and become unstable. For default parameters the stress level is about 12, but unusual parameter combinations can make it much less, even as low as zero. For code which is at an indentation level greater than this depth, some defensive actions are taken to avoid instability, such as temporarily turning off the -xci flag when the indentation depth exceeds the stress level. Most actual working code will not be influenced by this logic. Actual code which has a very deep indentation level can avoid problems by using a long line length, a short number of indentation spaces, or even the whitespace-cycle parameter.</p>

<p>This update fixes issues b1197 b1198 b1199 b1200 b1201 b1202 b1203 b1204</p>

<p>12 Sep 2021, 0ac771e.</p>

</dd>
<dt id="Fix-unusual-hanging-side-comment-issue-c070"><b>Fix unusual hanging side comment issue, c070</b></dt>
<dd>

<p>This issues can be illustrated with the following input script:</p>

<pre><code>    {
        if ($xxx) {
          ...
        } ## end if ($xxx ...
        # b &lt;filename&gt;:&lt;line&gt; [&lt;condition&gt;]
    }


    # OLD: perltidy -fpsc=21
    {
        if ($xxx) {
            ...;
        } ## end if ($xxx ...
                        # b &lt;filename&gt;:&lt;line&gt; [&lt;condition&gt;]
    }</code></pre>

<p>The comment &#39;# b ..&#39; moved over to the column 21 to the right as if it were a side comment. The reason is that it accidentally got marked as a hanging side comment. It should not have been because the previous side comment was a closing side comment. This update fixes this:</p>

<pre><code>    # NEW: perltidy -fpsc=21
    {
        if ($xxx) {
            ...;
        } ## end if ($xxx ...

        # b &lt;filename&gt;:&lt;line&gt; [&lt;condition&gt;]
    }</code></pre>

<p>This fixes issue c070.</p>

<p>10 Sep 2021, ec6ccf9.</p>

</dd>
<dt id="Fix-parsing-issue-c068"><b>Fix parsing issue c068</b></dt>
<dd>

<p>This issue is illustrated with the following line:</p>

<pre><code>   my $aa = $^ ? &quot;defined&quot; : &quot;not defined&quot;;</code></pre>

<p>If we tell perltidy to remove the space before the &#39;?&#39;, then the output will no longer be a valid script:</p>

<pre><code>   # perltidy -nwls=&#39;?&#39;:
   my $aa = $^? &quot;defined&quot; : &quot;not defined&quot;;</code></pre>

<p>The problem is that Perl considers &#39;$^?&#39; to be a special variable. So Rerunning perltidy on this gives an error, and perl also gives an error. This update fixes the problem by preventing a space after anything like &#39;$^&#39; from being removed a new special variable would be created.</p>

<p>This fixes issue c068.</p>

<p>7 Sep 2021, 9bc23d1.</p>

</dd>
<dt id="Fix-parsing-problem-issue-c066"><b>Fix parsing problem issue c066</b></dt>
<dd>

<p>This issue is illustrated with the following line (rt80058):</p>

<pre><code>   my $ok=$^Oeq&quot;linux&quot;;</code></pre>

<p>Running perltidy generated a warning message which is caused by the lack of space before the &#39;eq&#39;. This update fixes the problem.</p>

<p>4 Sep 2021, df79a20.</p>

</dd>
<dt id="Fix-unusual-parsing-problem-issue-c065"><b>Fix unusual parsing problem issue c065</b></dt>
<dd>

<p>Testing produced an unusual parsing problem in perltidy which can be illustrated with the following simple script:</p>

<pre><code>    my $str = &#39;a&#39;x2.2;
    print $str,&quot;\n&quot;;</code></pre>

<p>Normally an integer would follow the &#39;x&#39; operator, but Perl seems to accept any valid number and truncates it to an integer. So in this case the number 2.2 is truncated to 2 and the output is &#39;aa&#39;.</p>

<p>But perltidy, with default parameters, formats this as</p>

<pre><code>    my $str = &#39;a&#39; x 2 . 2;
    print $str,&quot;\n&quot;;</code></pre>

<p>which prints the result &quot;aa2&quot;. The problem is fixed with this update. With the update, the result is</p>

<pre><code>    my $str = &#39;a&#39; x 2.2;
    print $str, &quot;\n&quot;;</code></pre>

<p>which is equivalent to the original script.</p>

<p>This fixes issue c065.</p>

<p>4 Sep 2021, f242f78.</p>

</dd>
<dt id="Fix-formatting-instability-issues-b1195-b1196"><b>Fix formatting instability issues b1195, b1196</b></dt>
<dd>

<p>Testing with random parameters produced two similar cases of unstable formatting which are fixed with this update.</p>

<p>28 Aug 2021, ab9ad39.</p>

</dd>
<dt id="Fix-formatting-instability-issue-b1194"><b>Fix formatting instability issue b1194</b></dt>
<dd>

<p>Testing with random parameters produced a case of unstable formatting which is fixed with this update.</p>

<p>This fixes case b1194, and at the same time it simplifies the logic which handles issues b1183 and b1191.</p>

<p>21 Aug 2021, 62e5b01.</p>

</dd>
<dt id="Fix-some-problems-involving-tabs-characters-case-c062"><b>Fix some problems involving tabs characters, case c062</b></dt>
<dd>

<p>This update fixes some problems found in random testing with tab characters. For example, in the following snippet there is a tab character after &#39;sub&#39;</p>

<pre><code>    do sub      : lvalue {
        return;
      }</code></pre>

<p>Running perltidy on this repeatedly keep increasing the space between &#39;sub&#39; and &#39;:&#39;</p>

<pre><code>    # OLD: perltidy
    do sub       : lvalue {
        return;
      }

    # OLD: perltidy
    do sub        : lvalue {
        return;
      }</code></pre>

<p>etc.</p>

<pre><code>    # NEW: perltidy
    do sub : lvalue {
        return;
      }</code></pre>

<p>Problems like this can occur if string comparisons use &#39; &#39; instead of the regex \s when working on spaces. Several instances of this were located and corrected.</p>

<p>This fixes issue c062.</p>

<p>18 Aug 2021, d86787f.</p>

</dd>
<dt id="Correct-parsing-error-case-c061"><b>Correct parsing error, case c061</b></dt>
<dd>

<p>Testing with random input produced an error condition involving a side comment placed between a sub name and prototype, as in the following snippet:</p>

<pre><code>    sub
    witch   # sc
    ()   # prototype may be on new line ...
    { print &quot;which?\n&quot; }
    witch();</code></pre>

<p>The current version of perltidy makes an error:</p>

<pre><code>    # OLD: perltidy
    sub witch   # sc ()    # prototype may be on new line ...
    { print &quot;which?\n&quot; }
    witch();</code></pre>

<p>This update corrects the problem:</p>

<pre><code>    # NEW: perltidy
    sub witch    # sc
      ()         # prototype may be on new line ...
    { print &quot;which?\n&quot; }
    witch();</code></pre>

<p>This fixes case c061;</p>

<p>18 Aug 2021, 3bb2b2c.</p>

</dd>
<dt id="Improved-line-break-case-c060"><b>Improved line break, case c060</b></dt>
<dd>

<p>The default formatting produced an undesirable line break at the last &#39;&amp;&amp;&#39; term in the following:</p>

<pre><code>    my $static = grep {
             $class       =~ /^$_$/
          || $fullname    =~ /^$_$/
          || $method_name =~ /^$_$/
          &amp;&amp; ( $class eq &#39;main&#39; )
    } grep { !m![/\\.]! } $self-&gt;dispatch_to;    # filter PATH</code></pre>

<p>This update corrects this to give</p>

<pre><code>    my $static = grep {
             $class       =~ /^$_$/
          || $fullname    =~ /^$_$/
          || $method_name =~ /^$_$/ &amp;&amp; ( $class eq &#39;main&#39; )
    } grep { !m![/\\.]! } $self-&gt;dispatch_to;    # filter PATH</code></pre>

<p>15 Aug 2021, 9d1c8a9.</p>

</dd>
<dt id="Fix-error-check-caused-by--wn--iscl-case-c058"><b>Fix error check caused by -wn -iscl, case c058</b></dt>
<dd>

<p>Testing with random parameters triggered an an internal error check. This was caused by a recent coding change which allowed a weld across a side comment. The problem was in the development version, not in the latest released version, and is fixed with this update. This closes issue c058.</p>

<p>14 Aug 2021, 5a13886.</p>

</dd>
<dt id="Fix-formatting-instability-b1193"><b>Fix formatting instability, b1193</b></dt>
<dd>

<p>Testing with random parameters produced unstable formatting involving parameters which included -lp -sbvtc=1. This update fixes this problem, case b1193.</p>

<p>13 Aug 2021, d4c3425.</p>

</dd>
<dt id="Fix-error-in-tokenizer-issue-c055"><b>Fix error in tokenizer, issue c055</b></dt>
<dd>

<p>The ultimate cause of the undefined variable reference in the previous issue was found to be a typo in the tokenizer. This update finishes fixing issue c055.</p>

<p>10 Aug 2021, 2963db3</p>

</dd>
<dt id="Fix-undefined-variable-reference-in-development-version"><b>Fix undefined variable reference in development version</b></dt>
<dd>

<p>In testing, the following unbalanced snippet caused a reference to an undefined value in the current development version (but not in the current released version).</p>

<pre><code>        if($CPAN::Config-&gt;{term_is_latin}){
                $swhat=~s{([\xC0-\xDF])([\x80-\xBF])}{chr(ord($1)&lt;&lt;6&amp;0xC0|ord($2)&amp;0x3F)}eg;}if($self-&gt;colorize_output){if($CPAN::DEBUG&amp;&amp;$swhat=~/^Debug\(/){
                        $ornament=$CPAN::Config-&gt;{colorize_debug}||&quot;black on_cyan&quot;;}</code></pre>

<p>A check has been added to fix this.</p>

<p>10 Aug 2021, a3f9774.</p>

</dd>
<dt id="Fix-formatting-instability-b1192"><b>Fix formatting instability, b1192</b></dt>
<dd>

<p>Testing with random parameters produced unstable formatting with the following snippet when run with some unusual parameters:</p>

<pre><code>          @EXPORT =
              ( @{$EXPORT_TAGS{standard}}, );</code></pre>

<p>It was also be formatted as</p>

<pre><code>          @EXPORT = (
                      @{$EXPORT_TAGS{standard}},
          );</code></pre>

<p>The problem was that a list formatting style was turning on and off due to the the needless terminal comma within the parens. A patch was made to ignore commas like this when deciding if list formatting should be used.</p>

<p>This fixes case b1192.</p>

<p>10 Aug 2021, b949215.</p>

</dd>
<dt id="Fix-formatting-instability-b1191"><b>Fix formatting instability, b1191</b></dt>
<dd>

<p>Random testing produced an instability involving an unusual parameter combination and the following input code:</p>

<pre><code>    $_[0]eq$_[1]
      or($_[1]=~/^([!~])(.)([\x00-\xff]*)/)
      and($1 eq &#39;!&#39;)
      ^(eval{($_[2].&quot;::&quot;.$_[0])=~/$2$3/;});</code></pre>

<p>This update fixes case b1191.</p>

<p>9 Aug 2021, 16b4575.</p>

</dd>
<dt id="Fix-error-parsing-sub-attributes-without-spaces-b1190"><b>Fix error parsing sub attributes without spaces, b1190</b></dt>
<dd>

<p>Testing with random parameters produced an instability which was caused by incorrect parsing of a sub attribute list without spaces, as in</p>

<pre><code>        sub:lvalue{&quot;a&quot;}</code></pre>

<p>This update fixes case b1190.</p>

<p>9 Aug 2021, 7008bcc.</p>

</dd>
<dt id="Fix-rare-loss-of-vertical-alignment-in-welded-containers-c053"><b>Fix rare loss of vertical alignment in welded containers, c053</b></dt>
<dd>

<p>This update corrects a rare loss of vertical alignment in welded containers.</p>

<p>To illustrate the issue, the normal formatting of the following snippet is</p>

<pre><code>    # perltidy -sil=1 
    ( $msg, $defstyle ) = do {
            $i == 1 ? ( &quot;First&quot;, &quot;Color&quot; )
          : $i == 2 ? ( &quot;Then&quot;, &quot;Rarity&quot; )
          :           ( &quot;Then&quot;, &quot;Name&quot; );
    };</code></pre>

<p>If it appears within a welded container, the alignment of the last line was being lost:</p>

<pre><code>    # OLD: perltidy -wn -sil=1
    { {

        ( $msg, $defstyle ) = do {
                $i == 1 ? ( &quot;First&quot;, &quot;Color&quot; )
              : $i == 2 ? ( &quot;Then&quot;,  &quot;Rarity&quot; )
              : ( &quot;Then&quot;, &quot;Name&quot; );
        };
    } }</code></pre>

<p>The corrected result is</p>

<pre><code>    # NEW: perltidy -wn -sil=1
    { {

        ( $msg, $defstyle ) = do {
                $i == 1 ? ( &quot;First&quot;, &quot;Color&quot; )
              : $i == 2 ? ( &quot;Then&quot;, &quot;Rarity&quot; )
              :           ( &quot;Then&quot;, &quot;Name&quot; );
        };
    } }</code></pre>

<p>Several other minor vertical alignment issues are fixed with this updated. The problem was that two slightly different measures of the depth of indentation were being compared in the vertical aligner.</p>

<p>This fixes case c053.</p>

<p>8 Aug 2021, 97f02ee.</p>

</dd>
<dt id="Fix-edge-case-of-formatting-instability-b1189"><b>Fix edge case of formatting instability, b1189</b>.</dt>
<dd>

<p>Testing with random parameters produced a case of unstable formatting involving welding with parameter -notrim-qw. The problem was that the -notrim-qw flag converts a qw quote into a quote with fixed leading whitespace. The lines of these types of quotes which have no other code are are output early in the formatting process, since they have a fixed format, so welding does not work. In particular, the closing tokens cannot be welded if they are on a separate line. This also holds for all types of non-qw quotes. So welding can only be done if the first and last lines of a non-qw quote contain other code. A check for this was added.</p>

<p>For example, in the following snippet the terminal &#39;}&#39; is alone on a line:</p>

<pre><code>    is eval(q{
        $[ = 3;
        BEGIN { my $x = &quot;foo\x{666}&quot;; $x =~ /foo\p{Alnum}/; }
        $t[3];
    }
    ), &quot;a&quot;;</code></pre>

<p># In the previous version this was half-welded: # OLD: perltidy -wn -sil=0</p>

<pre><code>    is eval( q{
        $[ = 3;
        BEGIN { my $x = &quot;foo\x{666}&quot;; $x =~ /foo\p{Alnum}/; }
        $t[3];
    }
      ),
      &quot;a&quot;;</code></pre>

<p>The new check avoids welding in this case, giving</p>

<pre><code>    # NEW: perltidy -wn -sil=0
    is eval(
        q{
        $[ = 3;
        BEGIN { my $x = &quot;foo\x{666}&quot;; $x =~ /foo\p{Alnum}/; }
        $t[3];
    }
      ),
      &quot;a&quot;;</code></pre>

<p>Welding can still be done if the opening and closing container tokens have other code. For example, welding can be done for the following snippet:</p>

<pre><code>    is eval(q{
        $[ = 3;
        BEGIN { my $x = &quot;foo\x{666}&quot;; $x =~ /foo\p{Alnum}/; }
        $t[3];
    }), &quot;a&quot;;</code></pre>

<p>And welding can still be done on all qw quotes unless the -notrim-qw flag is set.</p>

<p>This fixes case b1189.</p>

<p>7 Aug 2021, e9c25f2.</p>

</dd>
<dt id="Fix-edge-cases-of-formatting-instability-b1187-b1188"><b>Fix edge cases of formatting instability, b1187 b1188</b>.</dt>
<dd>

<p>Testing with random parameters produced some cases of instability involving -wn -lp and several other parameters. The mechanism involved an interaction between the formatter and vertical aligner.</p>

<p>This fixes cases b1187 and b1188.</p>

<p>3 Aug 2021, 5be949b.</p>

</dd>
<dt id="Fix-edge-case-of-formatting-instability-b1186"><b>Fix edge case of formatting instability, b1186</b>.</dt>
<dd>

<p>Testing with random parameters produced a case of instability involving parameter -lp -pvt=n and a short maximum line length.</p>

<p>This fixes case b1186.</p>

<p>2 Aug 2021, f3dbee1.</p>

</dd>
<dt id="Fix-edge-case-of-formatting-instability-b1185"><b>Fix edge case of formatting instability, b1185</b>.</dt>
<dd>

<p>Testing with random parameters produced a case of welding instability involving parameters -wn, -vt=2, -lp and a short maximum line length.</p>

<p>This fixes case b1185.</p>

<p>1 Aug 2021, d2ab2b7.</p>

</dd>
<dt id="Fix-edge-case-of-formatting-instability-b1183"><b>Fix edge case of formatting instability, b1183</b>.</dt>
<dd>

<p>Testing with random parameters produced a case of welding instability involving parameters -wn, -vt=n, -lp. This update fixes the problem.</p>

<p>This fixes case b1183.</p>

<p>30 Jul 2021, 055650b.</p>

</dd>
<dt id="Fix-edge-case-of-formatting-instability-b1184"><b>Fix edge case of formatting instability, b1184</b>.</dt>
<dd>

<p>Testing with random parameters produced a case of welding instability involving a tripple weld with parameters -wn, -vt=n, -lp. This update fixes the problem.</p>

<p>This fixes case b1184.</p>

<p>29 Jul 2021, 6dd53fb.</p>

</dd>
<dt id="Fix-edge-case-of-formatting-instability-b1182"><b>Fix edge case of formatting instability, b1182</b>.</dt>
<dd>

<p>Testing with random parameters produced a case of welding instability involving unusual parameters and welding long ternary expressions. This update fixes the problem.</p>

<p>This fixes case b1182.</p>

<p>28 Jul 2021, 01d6c40.</p>

</dd>
<dt id="Fix-edge-case-of-formatting-instability"><b>Fix edge case of formatting instability</b>.</dt>
<dd>

<p>Random testing with random input parameters produced cases of formatting instability involving welding with unusual parameter settings. This update makes a small tolarance adjustment to fix it.</p>

<p>This fixes cases b1180 b1181.</p>

<p>28 Jul 2021, b38ccfc.</p>

</dd>
<dt id="Fix-rare-problem-with-formatting-nested-ternary-statements"><b>Fix rare problem with formatting nested ternary statements</b></dt>
<dd>

<p>This update fixes an extremely rare problem in formatting nested ternary statements, illustrated in the following snippet:</p>

<pre><code>  # OLD: There should be a break before the &#39;?&#39; in line 11 here:
  WriteMakefile(
      (
          $PERL_CORE ? ()
          : (
              (
                  eval { ExtUtils::MakeMaker-&gt;VERSION(6.48) }
                  ? ( MIN_PERL_VERSION =&gt; &#39;5.006&#39; )
                  : ()
              ),
              (
                  eval { ExtUtils::MakeMaker-&gt;VERSION(6.46) } ? (
                      META_MERGE =&gt; {
                          #
                      }
                    )
                  : ()
              ),
          )
      ),
  );

  # NEW: Line 12 correctly begins with a &#39;?&#39;
  WriteMakefile(
      (
          $PERL_CORE ? ()
          : (
              (
                  eval { ExtUtils::MakeMaker-&gt;VERSION(6.48) }
                  ? ( MIN_PERL_VERSION =&gt; &#39;5.006&#39; )
                  : ()
              ),
              (
                  eval { ExtUtils::MakeMaker-&gt;VERSION(6.46) }
                  ? (
                      META_MERGE =&gt; {
                          #
                      }
                    )
                  : ()
              ),
          )
      ),
  );</code></pre>

<p>This fixes issue c050, 63784d8.</p>

<p>22 Jul 2021.</p>

</dd>
<dt id="Fix-conflict-of--bom-and--scp-parameters"><b>Fix conflict of -bom and -scp parameters</b></dt>
<dd>

<p>Automated testing with random parameters produced a case of instability caused by a conflict of parameters -bom and -scp. In the following script the -bom command says to keep the tokens &#39;)-&gt;&#39; on a new line, whereas the -scp command says to stack the closing paren on the previous line.</p>

<pre><code>        $resource = {
                id =&gt; $package-&gt;new_from_mana(
                        $result-&gt;{data}
                )-&gt;id
        };</code></pre>

<p>The parameters are:</p>

<pre><code>    --break-at-old-method-breakpoints
    --indent-columns=8
    --maximum-line-length=60
    --stack-closing-paren</code></pre>

<p>This caused an instability which was fixed by giving priority to the -bom flag. The stable state is then</p>

<pre><code>        $resource = { id =&gt; $package-&gt;new_from_mana(
                        $result-&gt;{data}
        )-&gt;id };</code></pre>

<p>This fixes case b1179.</p>

<p>21 Jul 2021, 4ecc078.</p>

</dd>
<dt id="Fix-problems-with--kgb-in-complex-structures"><b>Fix problems with -kgb in complex structures</b></dt>
<dd>

<p>This update fixes two problems involving the -kgb option.</p>

<p>The first problem is that testing with random parameters produced some examples of formatting instabilities involving applying --keyword-group-blanks to complex structures, particularly welded structures. The -kgb parameters work well on simple statements or simple lists, so a check was added to prevent them from working on lists which are more than one level deep. This fixes issues b1177 and b1178 without significantly changing the -kgb functionality.</p>

<p>The second problem is that a terminal blank line could be misplaced if the last statement was a structure. This is illustrated with the following snippet:</p>

<pre><code>    sub new {
      my $class = shift;
      my $number = shift || croak &quot;What?? No number??\n&quot;;
      my $classToGenerate = shift || croak &quot;Need a class to generate, man!\n&quot;;
      my $hash = shift; #No carp here, some operators do not need specific stuff
      my $self = { _number =&gt; $number,
                   _class =&gt; $classToGenerate,
                   _hash =&gt; $hash };
      bless $self, $class; # And bless it
      return $self;
    }

    # OLD: perltidy -kgb -sil=0 gave
    sub new {

        my $class           = shift;
        my $number          = shift || croak &quot;What?? No number??\n&quot;;
        my $classToGenerate = shift || croak &quot;Need a class to generate, man!\n&quot;;
        my $hash = shift;   #No carp here, some operators do not need specific stuff
        my $self = {
            _number =&gt; $number,

            _class =&gt; $classToGenerate,
            _hash  =&gt; $hash
        };
        bless $self, $class;    # And bless it
        return $self;
    }</code></pre>

<p>The blank line which has appeared after the line &#39;_number =&gt;&#39; was intended to go after the closing brace but a line count was off. This has been fixed:</p>

<pre><code>    # NEW: perltidy -kgb -sil=0 gives
    sub new {

        my $class           = shift;
        my $number          = shift || croak &quot;What?? No number??\n&quot;;
        my $classToGenerate = shift || croak &quot;Need a class to generate, man!\n&quot;;
        my $hash = shift;   #No carp here, some operators do not need specific stuff
        my $self = {
            _number =&gt; $number,
            _class  =&gt; $classToGenerate,
            _hash   =&gt; $hash
        };

        bless $self, $class;    # And bless it
        return $self;
    }</code></pre>

<p>This fixes issue c048.</p>

<p>19 Jul 2021, 071a3f6.</p>

</dd>
<dt id="Fix-to-keep-from-losing-blank-lines-after-a-code-skipping-section"><b>Fix to keep from losing blank lines after a code-skipping section</b></dt>
<dd>

<p>A problem in the current version of perltidy is that a blank line after the closing code-skipping comment can be lost if there was a blank line before the start of the code skipping section. For example, given the following code:</p>

<pre><code>    $x = 1;

    #&lt;&lt;V
    % # = ( foo =&gt; &#39;bar&#39;, baz =&gt; &#39;buz&#39; );
    print keys(%#), &quot;\n&quot;;
    #&gt;&gt;V

    @# = ( foo, &#39;bar&#39;, baz, &#39;buz&#39; );
    print @#, &quot;\n&quot;;</code></pre>

<p>running perltidy gives:</p>

<pre><code>    $x = 1;

    #&lt;&lt;V
    % # = ( foo =&gt; &#39;bar&#39;, baz =&gt; &#39;buz&#39; );
    print keys(%#), &quot;\n&quot;;
    #&gt;&gt;V
    @# = ( foo, &#39;bar&#39;, baz, &#39;buz&#39; );
    print @#, &quot;\n&quot;;</code></pre>

<p>Notice that the blank line after the closing comment #&gt;&gt;V is missing. What happened is that the formatter is counting blank lines and did not &#39;see&#39; the code skipping section. So the blank after the closing comment looked like the second blank in a row, so it got removed since the default is --maximum-consecutive-blank-lines=1.</p>

<p>This update fixes this by resetting the counter. This fixes case c047. A simple workaround until the next release is to include the parameter</p>

<p>--maximum-consecutive-blank-lines=2, or -mbl=2.</p>

<p>It can be removed after the next release.</p>

<p>18 Jul 2021, 9648e16.</p>

</dd>
<dt id="Fix-possible-welding-instability-in-ternary-after-fat-comma"><b>Fix possible welding instability in ternary after fat comma</b></dt>
<dd>

<p>Random testing produced a case of formatting instability involving welding within a ternary expression following a fat comma:</p>

<pre><code>    if ( $op and $op eq &#39;do_search&#39; ) {
        @{$invoices} =
          GetInvoices(
              shipmentdatefrom =&gt;
              $shipmentdatefrom ? output_pref( {
                             str =&gt; $shipmentdatefrom,
                             dateformat =&gt; &#39;iso&#39;
              } )
              : undef,
              publicationyear =&gt; $publicationyear,
          );
    }</code></pre>

<p>when the following specific parameters were used</p>

<pre><code>    --extended-continuation-indentation
    --line-up-parentheses
    --maximum-line-length=38
    --variable-maximum-line-length
    --weld-nested-containers</code></pre>

<p>This update fixes this issue, case b1174.</p>

<p>18 Jul 2021, 12ae46b.</p>

</dd>
<dt id="Fix-mis-tokenization-before-pointer"><b>Fix mis-tokenization before pointer</b></dt>
<dd>

<p>Random testing produced the following case in which formatting was unstable because the variable &#39;$t&#39; was being mis-tokenized as a possible indirect object.</p>

<pre><code>    --break-before-all-operators
    --ignore-old-breakpoints
    --maximum-line-length=22
    -sil=0

    my $json_response
      = decode_json $t
      -&gt;tx-&gt;res-&gt;content
      -&gt;get_body_chunk;</code></pre>

<p>This update fixes cases b1175, b1176.</p>

<p>17 Jul 2021, 4aa1318.</p>

</dd>
<dt id="Fix-to-make--wn-and--bbxx-n-flags-work-together"><b>Fix to make -wn and -bbxx=n flags work together</b></dt>
<dd>

<p>Testing with random parameters produced some cases where the combination of -wn and various -bbxx=n flags were not working together. To illustrate, consider the following script (-sil=1 just means start at 1 indentation level)</p>

<pre><code>    # perltidy -sil=1
    $$d{&quot;day_name&quot;} = [
        [
            &quot;lundi&quot;,    &quot;mardi&quot;,  &quot;mercredi&quot;, &quot;jeudi&quot;,
            &quot;vendredi&quot;, &quot;samedi&quot;, &quot;dimanche&quot;
        ]
    ];</code></pre>

<p>With welding we get:</p>

<pre><code>    # -sil=1 -wn
    $$d{&quot;day_name&quot;} = [ [
        &quot;lundi&quot;,    &quot;mardi&quot;,  &quot;mercredi&quot;, &quot;jeudi&quot;,
        &quot;vendredi&quot;, &quot;samedi&quot;, &quot;dimanche&quot;
    ] ];</code></pre>

<p>With -bbsb=3 (--break-before-square-brackets) we get:</p>

<pre><code>    # -sil=1 -bbsb=3
    $$d{&quot;day_name&quot;} =
      [
        [
            &quot;lundi&quot;,    &quot;mardi&quot;,  &quot;mercredi&quot;, &quot;jeudi&quot;,
            &quot;vendredi&quot;, &quot;samedi&quot;, &quot;dimanche&quot;
        ]
      ];</code></pre>

<p>So far, so good. But for the combination -bbsb=3 -wn we get</p>

<pre><code>    # OLD: ERROR
    # -sil=1 -bbsb=3 -wn
    $$d{&quot;day_name&quot;} = [ [
        &quot;lundi&quot;,    &quot;mardi&quot;,  &quot;mercredi&quot;, &quot;jeudi&quot;,
        &quot;vendredi&quot;, &quot;samedi&quot;, &quot;dimanche&quot;
    ] ];</code></pre>

<p>which is incorrect because it ignors the -bbsb flag. The corrected result is</p>

<pre><code>    # NEW: OK
    # -sil=1 -bbsb=3 -wn
    $$d{&quot;day_name&quot;} =
      [ [
        &quot;lundi&quot;,    &quot;mardi&quot;,  &quot;mercredi&quot;, &quot;jeudi&quot;,
        &quot;vendredi&quot;, &quot;samedi&quot;, &quot;dimanche&quot;
      ] ];</code></pre>

<p>This update fixes case b1173. It works for any number of welded containers, and the -bbxxi=n flags also work correctly.</p>

<p>16 Jul 2021, c71f882.</p>

</dd>
<dt id="Fix-problem-with-side-comment-after-pattern"><b>Fix problem with side comment after pattern</b></dt>
<dd>

<p>Testing with randomly placed side comments produced an error illustrated with the following snippet:</p>

<pre><code>    testit
    /A (*THEN) X | B (*THEN) C/x#sc#
    ,
    &quot;Simple (*THEN) test&quot;
    ;</code></pre>

<p>If &#39;testit&#39; is an unknown bareword then perltidy has to guess if the &#39;/&#39; is a division or can start a pattern. In this case the side comment caused a bad guess. This is case c044 and is fixed with this update. There are no other known issues with side comments at the present time but testing continues.</p>

<p>13 Jul 2021, 8b36de8.</p>

</dd>
<dt id="Fix-problem-with-side-comment-after-pointer-part-3"><b>Fix problem with side comment after pointer, part 3</b></dt>
<dd>

<p>This update fixes some incorrect tokenization produced by a side comment placed between a pointer and a bareword as in this snippet:</p>

<pre><code>    sub tzoffset {};

    ...

    my $J
    +=
    (
    $self
    -&gt;#sc
    tzoffset
    / (
    24
    *
    3600
    )
    );</code></pre>

<p>If a sub declaration for the bareword has been seen, the following &#39;/&#39; was being rejected as an operator. This update fixes this case, which is issue c043.</p>

<p>13 Jul 2021, cab7ed3.</p>

</dd>
<dt id="Avoid-line-breaks-before-a-slash-in-certain-cases"><b>Avoid line breaks before a slash in certain cases</b></dt>
<dd>

<p>This is a modification to the previous update for case c039 which prevents a line break before a &#39;/&#39; character which follows a bareword or possible indirect object. This rule will be only be used to prevent creating new line breaks. Existing line breaks can remain.</p>

<p>11 Jul 2021, 7afee47.</p>

</dd>
<dt id="Fix-error-parsing-sub-attributes-with-side-comment"><b>Fix error parsing sub attributes with side comment</b></dt>
<dd>

<p>Testing with side comments produced an error in the following snippet:</p>

<pre><code>    sub plugh () :#
      Ugly(&#39;\(&quot;) : Bad;</code></pre>

<p>This is fixed in this update, case c038.</p>

<p>11 Jul 2021, 80f2a3a.</p>

</dd>
<dt id="Fix-case-b1172-a-failure-to-converge"><b>Fix case b1172, a failure to converge</b></dt>
<dd>

<p>Random testing produced case b1172, a failure to converge with unusual parametrs. This update fixes this case. There are no other known cases of instability at the present time but testing continues.</p>

<p>10 Jul 2021, 47e7f9b.</p>

</dd>
<dt id="Avoid-line-breaks-before-a-slash-in-certain-cases1"><b>Avoid line breaks before a slash in certain cases</b></dt>
<dd>

<p>This update prevents a line break before a &#39;/&#39; character which follows a bareword or possible indirect object. The purpose is reduce the chance of introducing a syntax error in cases where perl is using spaces to distinguish between a division and the start of a pattern.</p>

<p>This fixes case c039.</p>

<p>10 Jul 2021, 461199c.</p>

</dd>
<dt id="Removed-warning-message-if-ending-in-code-skipping-section"><b>Removed warning message if ending in code skipping section</b></dt>
<dd>

<p>In the previous version, a warning was produced if a &#39;code-skipping&#39; opening comment &#39;#&lt;&lt;V&#39; was not followed by a closing comment &#39;#&gt;&gt;V&#39;. But the related &#39;format-skipping&#39; commands do not give a warning if a &#39;#&lt;&lt;&lt;&#39; comment is not ended with a &#39;#&gt;&gt;&gt;&#39; closing comment. In order to be able to smoothly change between these options, it seems best to remove the warning about a missing &#39;#&gt;&gt;V&#39;. There is still a message in the log file about this, so if there is any uncertainty about it, a log file can be saved and consulted.</p>

<p>10 Jul 2021, 461199c.</p>

</dd>
<dt id="Improve-logic-for-distinguishing-a-pattern-vs-a-division"><b>Improve logic for distinguishing a pattern vs a division</b></dt>
<dd>

<p>Testing with side comments produced the following snippet which caused a error due to the side comment on the &#39;/&#39;</p>

<pre><code>    $bond_str
    =
    VERY_WEAK #sc#
    / #sc#
    1.05
    ;</code></pre>

<p>Several related examples were found in which side comments triggered errors. For example</p>

<pre><code>    ok
    /[^\s]+/#sc#
    ,
    &#39;m/[^\s]/ utf8&#39;
    ;</code></pre>

<p>This update fixes these problems, case c040.</p>

<p>9 Jul 2021, ffe4351.</p>

</dd>
<dt id="Fix-problem-caused-by-side-comment-after"><b>Fix problem caused by side comment after ++</b></dt>
<dd>

<p>Testing with side comments produced an incorrect error message for this snippet:</p>

<pre><code>    xxx 
    ++#
    $test, 
    Internals::SvREADONLY( %$copy) , 
    &quot;cloned hash restricted?&quot; ;</code></pre>

<p>The problem was caused by the side comment between the &#39;++&#39; and &#39;$test&#39;. The same problem occurs for &#39;--&#39; instead of &#39;++&#39;. This is fixed with this update, case c042.</p>

<p>8 Jul 2021, 20cc9a0.</p>

</dd>
<dt id="Fix-problem-caused-by-side-comment-after-pointer-part-2"><b>Fix problem caused by side comment after pointer, part 2</b></dt>
<dd>

<p>This is related to the previous issue, c037. The following snippet was misparsed at the old style &#39; package separater due to the side comment following the pointer.</p>

<pre><code>    @ret
    =
    $o
    -&gt;#
    SUPER&#39;method
    (
    &#39;whatever&#39;
    )
    ;</code></pre>

<p>This is fixed in this update, case c041.</p>

<p>7 Jul 2021, 1806772.</p>

</dd>
<dt id="Fix-problem-caused-by-side-comment-after-pointer"><b>Fix problem caused by side comment after pointer</b></dt>
<dd>

<p>The following test script</p>

<pre><code>    is(
    $one
    -&gt;#sc#
    package
    ,
    &quot;bar&quot;
    ,
    &quot;Got package&quot;
    )
    ;</code></pre>

<p>Caused the following error message:</p>

<pre><code>  4: package
     ^
  found package where operator expected</code></pre>

<p>The problem was caused by a side comment between the pointer &#39;-&gt;&#39; and the word &#39;package&#39;. This caused package to be misparsed as a keyword, causing the error.</p>

<p>This is fixed in this update, case c037, 96f2ebb.</p>

</dd>
<dt id="Fix-error-parsing-and-similar-combinations"><b>Fix error parsing &#39;%#&#39; and similar combinations</b></dt>
<dd>

<p>Perltidy was correctly distinguishing between &#39;$#&#39; and &#39;$ #&#39; but not between &#39;@#&#39; and &#39;@ #&#39; and &#39;%#&#39; and &#39;% #&#39;. The coding for parsing these types of expressions has been corrected. Some simple examples:</p>

<pre><code>    # this is a valid program, &#39;%#&#39; is a punctuation variable
    %# = ( foo =&gt; &#39;bar&#39;, baz =&gt; &#39;buz&#39; );
    print keys(%#), &quot;\n&quot;;

    # but this is a syntax error (space before # makes a side comment)
    # (perltidy was ignoring the space and forming &#39;%#&#39; here)
    % # = ( foo =&gt; &#39;bar&#39;, baz =&gt; &#39;buz&#39; );
    print keys(%#), &quot;\n&quot;;

    # this is a valid program, &#39;@#&#39; is a punctuation variable
    @# = ( foo , &#39;bar&#39;, baz , &#39;buz&#39; );
    print @#, &quot;\n&quot;;

    # this is a valid program, the space makes the &#39;#&#39; a side comment
    # perltidy formed %# here, causing an error
    % #
    var = ( foo =&gt; &#39;bar&#39;, baz =&gt; &#39;buz&#39; );
    print keys(%var), &quot;\n&quot;;</code></pre>

<p>This fixes case c036.</p>

<p>6 Jul 2021, e233d41.</p>

</dd>
<dt id="Fix-error-parsing"><b>Fix error parsing &#39;&amp;#&#39;</b></dt>
<dd>

<p>The following test script caused an error when perltidy did not correctly parse the tight side comment after the &#39;&amp;&#39; (it parsed correctly if there was a space before the &#39;#&#39;).</p>

<pre><code>    print$my_bag
    &amp;#sc#
    $your_bag
    ,
    &quot;\n&quot;
    ;</code></pre>

<p>This update fixes this issue, c033.</p>

<p>5 Jul 2021, 0d784e0.</p>

</dd>
<dt id="Fix-error-parsing-format-statement"><b>Fix error parsing format statement</b></dt>
<dd>

<p>The following test script caused an error when perltidy took &#39;format&#39; to start a format statement.</p>

<pre><code>    my$ascii#sc#
    =#sc#
    $formatter#sc#
    -&gt;#sc#
    format#sc#
    (#sc#
    $html#sc#
    )#sc#
    ;#sc#</code></pre>

<p>This was fixed by requiring a format statement to begin where a new statement can occur. This fixes issue c035.</p>

<p>5 Jan 2021, 2ef16fb.</p>

</dd>
<dt id="Fix-some-incorrect-error-messages-due-to-side-comments"><b>Fix some incorrect error messages due to side comments</b></dt>
<dd>

<p>Testing with large numbers of side comments caused perltidy to produce some incorrect error messages. Two issues are fixed with this update. First, a side comment between a pointer &#39;-&gt;&#39; and the next identifier caused a message. Second, in some cases a comment after an opening paren could cause a message. The following snippet is an example.</p>

<pre><code>    $Msg#sc#
    -&gt;#sc#
    $field#sc#
    (#sc#
    )#sc#
    ;#sc#</code></pre>

<p>This update fixes cases c029 and c030.</p>

<p>4 Jul 2021, caffc2c.</p>

</dd>
<dt id="Fix-undefined-var-ref-involving---format-skipping"><b>Fix undefined var ref involving --format-skipping</b></dt>
<dd>

<p>Testing produced a situation in which version 20200625 could cause an undefined variable to be accessed (the variable &#39;Ktoken_vars&#39;) as in this snippet:</p>

<pre><code>    #!/usr/bin/perl
    #&lt;&lt;&lt;
        my $ra= (
            [ &#39;Shine&#39;, 40 ], [ &#39;Specular&#39;, [ 1, 1, 0.3, 0 ] ] );
    #&lt;&lt;&lt;
    ...</code></pre>

<p>The conditions for this to happen are:</p>

<pre><code>  (1) format skipping (#&lt;&lt;&lt;) begins before the first line of code, and
  (2) the format skipping section contains the two successive characters &#39;, [&#39;.</code></pre>

<p>The undefined variable was &#39;Ktoken_vars&#39;. This problem was introduced by commit 21ef53b, an update which fixed case b1100. This undefined variable access does influence the formatted output.</p>

<p>This update fixes this problem.</p>

<p>4 Jul 2021, 82916fe.</p>

</dd>
<dt id="Check-for-side-comment-within-package-statement"><b>Check for side comment within package statement</b></dt>
<dd>

<p>Testing with randomly placed side comments caused perltidy to produce an incorrect warning when a side comment is placed before the end of a package statement:</p>

<pre><code>    package double # side comment
    ;</code></pre>

<p>This update fixes this. 3 Jul 2021, c00059a.</p>

</dd>
<dt id="Fix-problem-with--comma-arrow-breakpoint-n-flag"><b>Fix problem with -comma-arrow-breakpoint=n flag</b></dt>
<dd>

<p>Testing revealed a formatting irregularity which was caused when the flag -cab=2 got applied to a container which was not a list. This is fixed with update, which fixes case b939a.</p>

<p>1 Jul 2021, 021b938.</p>

</dd>
<dt id="Fix-a-formatting-instability"><b>Fix a formatting instability</b></dt>
<dd>

<p>Testing showed that a previously fixed case of instability, b1144, which was fixed 21 Jun 2021, 1b682fd, was unstable again. This update is a small change which fixes this. There are no other known unstable cases at this time but automated testing runs continue to search for instabilities.</p>

<p>1 Jul 2021, 021b938.</p>

</dd>
<dt id="Fixed-use-of-uninitialized-value"><b>Fixed use of uninitialized value</b></dt>
<dd>

<p>The previous Tokenizer update caused the use of an unitialized value when run on case b1053:</p>

<pre><code> Use of uninitialized value $next_nonblank_token in pattern match (m//) at /home/steve/bin/Perl/Tidy/Tokenizer.pm line 7589.
 Use of uninitialized value $nn_nonblank_token in pattern match (m//) at /home/steve/bin/Perl/Tidy/Tokenizer.pm line 3723.
 b1053 converged on iteration 2</code></pre>

<p>This update fixes this.</p>

<p>1 Jul 2021, ea139bd.</p>

</dd>
<dt id="Fix-token-type-of-colon-introducing-anonomyous-sub-attribute-list"><b>Fix token type of colon introducing anonomyous sub attribute list</b></dt>
<dd>

<p>In the following example</p>

<pre><code>    print &quot;not &quot; unless ref +(
        map {
            sub : lvalue { &quot;a&quot; }
        } 1
    )[0] eq &quot;CODE&quot;;</code></pre>

<p>the colon after &#39;sub&#39; was being marked as part of a label rather than the start of an attribute list. This does not cause an error, but the space before the &#39;:&#39; is lost. This is fixed in this update.</p>

<p>Note that something like &#39;sub :&#39; can also be a label, so the tokenizer has to look ahead to decide what to do. For example, this &#39;sub :&#39; is a label:</p>

<pre><code>    my $xx = 0;
    sub : {
        $xx++;
        print &quot;looping with label sub:, a=$xx\n&quot;;
        if ( $xx &lt; 10 ) { goto &quot;sub&quot; }
    }</code></pre>

<p>In this case, the goto statement needs quotes around &quot;sub&quot; because it is a keyword.</p>

<p>29 Jun 2021, d5fb3d5.</p>

</dd>
<dt id="Minor-adjustments-to-improve-formatting-stability"><b>Minor adjustments to improve formatting stability</b></dt>
<dd>

<p>Testing with random input parameters produced several new cases of formatting instability involving unusual parameter combinations. This update fixes these cases, b1169 b1170 b1171, and all previously discovered cases remain stable with the update.</p>

<p>28 Jun 2021, e1f22e0.</p>

</dd>
<dt id="Remove-limit-on--ci-n-when--xci-is-set-see-rt-136415"><b>Remove limit on -ci=n when -xci is set, see rt #136415</b></dt>
<dd>

<p>This update undoes the update c16c5ee of 20 Feb 2021, in which the value of -ci=n was limited to the value of -i=n when -xci was set. Recent improvements in stability tolerances allow this limit to be removed.</p>

<p>28 Jun 2021, 1b3c5e9.</p>

</dd>
<dt id="Minor-optimization"><b>Minor optimization</b></dt>
<dd>

<p>Added a quick check to bypass a needless sub call.</p>

<p>26 Jan 2021, e7822df.</p>

</dd>
<dt id="Eliminate-token-variable-_LEVEL_TRUE_"><b>Eliminate token variable _LEVEL_TRUE_</b></dt>
<dd>

<p>It was possible to eliminate this token variable by changing the order of welding operations. This reduces the number of variables per token from 12 to 11.</p>

<p>26 Jun 2021, 1f4f78c.</p>

</dd>
<dt id="Eliminate-token-variable-_CONTAINER_ENVIRONMENT_"><b>Eliminate token variable _CONTAINER_ENVIRONMENT_</b></dt>
<dd>

<p>Testing with NYT_Prof shows that the number of variables per token has a direct effect on efficiency. This update reduces the number of token variables from 13 to 12, and also simplifies the coding. It was possible to compute this variable from the others, so it was redundant.</p>

<p>26 Jun 2021, 300ca1e.</p>

</dd>
</dl>

<h1 id="Issues-fixed-after-release-20210402">Issues fixed after release 20210402</h1>

<dl>

<dt id="Release-20210625"><b>Release 20210625</b></dt>
<dd>

<p>24 Jun 2021, a4ff53d.</p>

</dd>
<dt id="Adjust-tolerances-to-fix-some-unstable-edge-cases"><b>Adjust tolerances to fix some unstable edge cases</b></dt>
<dd>

<p>Testing with random input parameters produced a number of edge cases of unstable formatting which were traced to the parameter combinations which included -lp and some other unusual settings.</p>

<p>This fixes cases b1103 b1134 b1135 b1136 b1138 b1140 b1143 b1144 b1145 b1146 b1147 b1148 b1151 b1152 b1153 b1154 b1156 b1157 b1163 b1164 b1165</p>

<p>There are no other known cases of formatting instability at the present time, but testing with random input parameters will continue.</p>

<p>21 Jun 2021, 1b682fd.</p>

</dd>
<dt id="Adjust-tolerances-to-fix-some-unstable-edge-cases1"><b>Adjust tolerances to fix some unstable edge cases</b></dt>
<dd>

<p>Testing with random input parameters produced a number of edge cases of unstable formatting which were traced to the parameter combinations which included -bbxi=2 and -cab=2. A small adjustment to length tolerances was made to fix the problem.</p>

<p>This fixes cases b1137 b1149 b1150 b1155 b1158 b1159 b1160 b1161 b1166 b1167 b1168.</p>

<p>19 Jun 2021, 4d4970a.</p>

</dd>
<dt id="Added-flag--atnl---add-terminal-newline-see-git-58"><b>Added flag -atnl, --add-terminal-newline, see git #58</b></dt>
<dd>

<p>This flag, which is enabled by default, allows perltidy to terminate the last line of the output stream with a newline character, regardless of whether or not the input stream was terminated with a newline character. If this flag is negated, with <b>-natnl</b>, then perltidy will add a terminal newline to the the output stream only if the input stream is terminated with a newline.</p>

<p>Negating this flag may be useful for manipulating one-line scripts intended for use on a command line.</p>

<p>This update also removes the description of the obsolete --check-syntax flag from the man pages and help text.</p>

<p>18 Jun 2021, 6f83170.</p>

</dd>
<dt id="Allow---delete-side-comments-to-work-with--nanl"><b>Allow --delete-side-comments to work with -nanl</b></dt>
<dd>

<p>The -nanl flag (--noadd-newlines) was preventing side comments from being deleted, for example:</p>

<pre><code>    # perltidy -dsc -nanl
    calc()    # side comment</code></pre>

<p>The same issue was happening for --delete-closing-side comments. This has been fixed.</p>

<p>18 Jun 2021, dbfd802.</p>

</dd>
<dt id="Update-welding-rule-to-avoid-unstable-states"><b>Update welding rule to avoid unstable states</b></dt>
<dd>

<p>Testing with random input parameters produced a formatting instability involving an unusual parameter combination:</p>

<pre><code>    --noadd-whitespace
    --break-before-paren=3
    --continuation-indentation=8
    --delete-old-whitespace
    --line-up-parentheses
    --weld-nested-containers</code></pre>

<p>and the following code</p>

<pre><code>        if(defined$hints{family}){
            @infos=({
                     family=&gt;$hints{family},
                     socktype=&gt;$hints{socktype},
                     protocol=&gt;$hints{protocol},
            });
        }</code></pre>

<p>This update fixes the problem, case b1162.</p>

<p>18 Jun 2021, 76873ea.</p>

</dd>
<dt id="Convert-some-weld-sub-calls-to-hash-lookups"><b>Convert some weld sub calls to hash lookups</b></dt>
<dd>

<p>This is a minor optimization. These subs are eliminated: is_welded_right_at_K, is_welded_left_at_K, weld_len_right_at_K.</p>

<p>17 Jun 2021, 1691013.</p>

</dd>
<dt id="Update-LineSink.pm-to-allow-undefined-line-endings"><b>Update LineSink.pm to allow undefined line endings</b></dt>
<dd>

<p>This update is necessary to eventually prevent an unwanted terminal newline being added to a file.</p>

<p>17 Jun 2021, 2600533.</p>

</dd>
<dt id="Fix-incorrect-sub-call"><b>Fix incorrect sub call</b></dt>
<dd>

<p>This fixes an incorrect call which could cause an incorrect weld.</p>

<p>16 Jun 2021, 068a28b.</p>

</dd>
<dt id="Add---code-skipping-option-see-git-65"><b>Add --code-skipping option, see git #65</b></dt>
<dd>

<p>Added a new option &#39;--code-skipping&#39;, requested in git #65, in which code between comment lines &#39;#&lt;&lt;V&#39; and &#39;#&gt;&gt;V&#39; is passed verbatim to the output stream without error checking. It is simmilar to --format skipping but there is no error checking, and is useful for skipping an extended syntax.</p>

<p>16 Jun 2021, 99ec876.</p>

</dd>
<dt id="Handle-nested-print-format-blocks"><b>Handle nested print format blocks</b></dt>
<dd>

<p>Perltidy was producing an error at nested print format blocks, such as</p>

<pre><code>    format NEST =
    @&lt;&lt;&lt;
    {
        my $birds = &quot;birds&quot;;
        local *NEST = *BIRDS{FORMAT};
        write NEST;
        format BIRDS =
    @&lt;&lt;&lt;&lt;&lt;
    $birds;
    .
    &quot;nest&quot;
      }
    .</code></pre>

<p>It was ending the first format at the first &#39;.&#39; rather than the second &#39;.&#39; in this example. This update fixes this, issue c019.</p>

<p>13 Jun 2021.</p>

</dd>
<dt id="Allow-stacked-labels-without-spaces"><b>Allow stacked labels without spaces</b></dt>
<dd>

<p>When labels are stacked in a single line, such as</p>

<p>A:B:C:</p>

<p>the default is to space them:</p>

<p>A: B: C:</p>

<p>This update allows the spaces to be removed if desired:</p>

<p># perltidy -naws -dws A:B:C:</p>

<p>13 Jun 2021, c2a63b2</p>

</dd>
<dt id="Fix-edge-cases-of-instability-involving--wn--lp"><b>Fix edge cases of instability involving -wn -lp</b></dt>
<dd>

<p>Random testing produced some cases of instability involving -wn -lp and some unusual additional parameters. These were traced to a test for welding, and were fixed by refining a certain tolerance. This fixes cases b1141, b1142.</p>

<p>12 Jun 2021, 125494b.</p>

</dd>
<dt id="Remove-incorrect-warning-at-repeated-function-paren-call"><b>Remove incorrect warning at repeated function paren call</b></dt>
<dd>

<p>This update removes an incorrect error messagge at the construct &#39;)(&#39;. To illustrate, the following is a valid program:</p>

<pre><code>    my @words = qw(To view this email as a web page go here);
    my @subs;
    push @subs, sub { my $i=shift; $i %= @words; print &quot;$words[$i] &quot;; return $subs[0]};
    $subs[0](0)(1)(2)(3)(4)(5)(6)(7)(8)(9)(10)(11);
    print &quot;\n&quot;;</code></pre>

<p>However perltidy was giving an error message at the &#39;)(&#39; combination, which is unusual in perl scripts. This update fixes this.</p>

<p>These are function call parens, so logically they should be under control of the -sfp or --space-function-parens parameter. I wrote a patch to do this, but decided not to implement it. The reason is that, as noted in the manual, subtle errors in perl scripts can occur when spaces are placed before parens. So, to avoid possible problems, the -sfp parameter will be restricted to spaces between a bareword [assumed to be a function] and a paren.</p>

<p>This update is in Tokenizer.pm and fixes case c017.</p>

<p>6 Jun 2021, 6551d65.</p>

</dd>
<dt id="Add-warning-when-lexical-sub-names-match-some-builtins"><b>Add warning when lexical sub names match some builtins</b></dt>
<dd>

<p>This update adds a warning when lexical subs have names which match some builtin names which will almost certainly cause a parsing error in the current version of perltidy. For example, the following program is valid and will run, but perltidy will produce an error.</p>

<pre><code>    use feature qw(lexical_subs);
    use warnings; no warnings &quot;experimental::lexical_subs&quot;;
    {
      my sub y { print &quot;Hello from y: $_[0]\n&quot;; }
      y(1);
    }</code></pre>

<p>6 Jun 2021, 32729fb.</p>

</dd>
<dt id="Minor-cleanups"><b>Minor cleanups</b></dt>
<dd>

<p>This update fixes a case of formatting instability recently found with random testing. It also does some minor coding cleanups.</p>

<p>This fixes case b1139.</p>

<p>5 Jun 2021, b8527ab.</p>

</dd>
<dt id="Revised-data-structures-for-welding"><b>Revised data structures for welding</b></dt>
<dd>

<p>This update replaces the data structures used for the welding option with simpler but more general structures. This cleans up the code and will simplify future coding. No formatting changes should occur with this update.</p>

<p>4 Jun 2021, 4a886c8.</p>

</dd>
<dt id="improved-treatment-of-lexical-subs"><b>improved treatment of lexical subs</b></dt>
<dd>

<p>This update improves the treatment of lexical subs. Previously they were formatted correctly but an error would have been produced if the same name was used for lexical subs defined in different blocks.</p>

<p>For example, running the previous version of perltidy on the following:</p>

<pre><code>    use feature qw(lexical_subs);
    use warnings; no warnings &quot;experimental::lexical_subs&quot;;
    {
        my sub hello { print &quot;Hello from hello1\n&quot; }
        {
            my sub hello { print &quot;Hello from hello2\n&quot; }
            hello();
        }
        hello();
    }
    {
        my sub hello { print &quot;Hello from hello3\n&quot; }
        hello();
    }</code></pre>

<p>gave the (incorrect) error message:</p>

<pre><code>    6: already saw definition of &#39;sub hello&#39; in package &#39;main&#39; at line 4
    12: already saw definition of &#39;sub hello&#39; in package &#39;main&#39; at line 6</code></pre>

<p>This update fixes that.</p>

<p>1 Jun 2021, 85ecb7a.</p>

</dd>
<dt id="add-v-string-underscores-warn-of-leading-commas"><b>add v-string underscores; warn of leading commas</b></dt>
<dd>

<p>This update cleans up a couple of open issues in the tokenizer.</p>

<p>A warning message will be produced for a list which begins with a comma:</p>

<pre><code>            my %string = (
              ,       &quot;saddr&quot;,    $stest,  &quot;daddr&quot;,
              $dtest, &quot;source&quot;,   $sname,  &quot;dest&quot;)</code></pre>

<p>This warning had been temporarily deactivated.</p>

<p>Underscores in v-strings without a leading &#39;v&#39; are now parsed correctly.</p>

<p>Several comments have been updated.</p>

<p>31 May 2021, ef44e70.</p>

</dd>
<dt id="Fix-parsing-error-at-operator-following-a-comma"><b>Fix parsing error at operator following a comma</b></dt>
<dd>

<p>The following lines are syntactically correct but some were producing a syntax error</p>

<pre><code>    print &quot;hello1\n&quot;, || print &quot;hi1\n&quot;;
    print &quot;hello2\n&quot;, &amp;&amp; print &quot;bye2\n&quot;;
    print &quot;hello3\n&quot;, or print &quot;bye3\n&quot;;
    print &quot;hello4\n&quot;, and print &quot;bye4\n&quot;;</code></pre>

<p>For example, the first line produced this message</p>

<pre><code>    1: print &quot;hello1\n&quot;, || print &quot;hi1\n&quot;;
                       - ^
    found || where term expected (previous token underlined)</code></pre>

<p>This has been fixed. This fixes case c015.</p>

<p>27 May 2021, b537a72.</p>

</dd>
<dt id="Added-optional-o-in-octal-number-definitions"><b>Added optional o in octal number definitions</b></dt>
<dd>

<p>An optional letter &#39;o&#39; or &#39;O&#39; in the octal representation of numbers, which was added in perl version 5.33.5, is now recogized. The leading zero is still required.</p>

<p>For example:</p>

<pre><code>    $a = 0o100;
    $a = 0O100;</code></pre>

<p>26 May 2021, 544df8c.</p>

</dd>
<dt id="Fix-several-problems-with--lp-formatting"><b>Fix several problems with -lp formatting</b></dt>
<dd>

<p>This update fixes several problems with -lp formatting which are all somewhat related.</p>

<p>ISSUE #1 (cases c002 and c004): A problem involving -lp -wn and certain qw lists</p>

<p>The last line of a welded qw list was being outdented even if it contained text as well as the closing container token. This update fixes the problem and simplifies the logic.</p>

<p>A few examples (all use &#39;perltidy -wn -lp&#39;):</p>

<pre><code>    # OLD and NEW: OK, closing qw paren is on separate line
    $roads-&gt;add_capacity_path( qw( CoolCity 10 ChocolateGulch 8
                               PecanPeak 10 BlueberryWoods 6
                               HotCity
    ) );

    # OLD: poor; outdented text not aligned with previous text
    $roads-&gt;add_capacity_path( qw( CoolCity 10 ChocolateGulch 8
                               PecanPeak 10 BlueberryWoods 6
    HotCity ) );

    # NEW:
    $roads-&gt;add_capacity_path( qw( CoolCity 10 ChocolateGulch 8
                               PecanPeak 10 BlueberryWoods 6
                               HotCity ) );

    # OLD:
    $roads-&gt;add_capacity_path( qw( ChocolateGulch 3 StrawberryFields 0
    StrawberryFields ) );

    # NEW:
    $roads-&gt;add_capacity_path( qw( ChocolateGulch 3 StrawberryFields 0
                               StrawberryFields ) );

    # OLD:
    my $mon_name = ( qw(January February March April
                     May June July August
    September October November December) )[$mon];

    # NEW
    my $mon_name = ( qw(January February March April
                     May June July August
                     September October November December) )[$mon];</code></pre>

<p>ISSUE #2 (case c007): A rare program error could be triggered with -lp -xci</p>

<p>In some very rare circumstances it was possible to trigger a &quot;Program error&quot; message. The program still ran to completion. The conditions for this to occur were that flags -lp -xci were set, and that there was a container of sort/map/grep blocks, and there was a side comment on the closing paren. For example:</p>

<pre><code>    # OLD: perltidy -lp -xci, gave an error message and extra indentation here
    my %specified_opts = (
          (
                          map { /^no-?(.*)$/i ? ($1 =&gt; 0) : ($_ =&gt; 1) }
                          map { /^--([\-_\w]+)$/ } @ARGV
          ),    # this comment caused an error with flags -lp -xci
    );

    # NEW: perltidy -lp -xci, no error
    my %specified_opts = (
          (
             map { /^no-?(.*)$/i ? ( $1 =&gt; 0 ) : ( $_ =&gt; 1 ) }
             map { /^--([\-_\w]+)$/ } @ARGV
          ),    # this comment caused an error with flags -lp -xci
    );</code></pre>

<p>ISSUE #3 (case c008): In some unusual cases the -lp formatting style was not being applied when it should have been. For example (text is shifted right):</p>

<pre><code>    # NEW: perltidy -lp
    $result = runperl(
        switches =&gt; [ &#39;-I.&#39;, &quot;-w&quot; ],
        stderr   =&gt; 1,
        prog     =&gt; &lt;&lt;&#39;PROG&#39; );
    SIG
    PROG

    # NEW: perltidy -lp
    $result = runperl(
                       switches =&gt; [ &#39;-I.&#39;, &quot;-w&quot; ],
                       stderr   =&gt; 1,
                       prog     =&gt; &lt;&lt;&#39;PROG&#39; );
    SIG
    PROG</code></pre>

<p>25 May 2021, 6947fe9.</p>

</dd>
<dt id="Modify-welding-rules"><b>Modify welding rules</b></dt>
<dd>

<p>This is an update to the patch 19 Apr 2021, eeeaf09. It restricts that patch to -lp formatting mode.</p>

<p>This fixes case b1131.</p>

<p>21 May 2021, a4ec4c1.</p>

</dd>
<dt id="Fix-inconsistency-involving-counting-commas"><b>Fix inconsistency involving counting commas</b></dt>
<dd>

<p>Random testing produced a formatting instability involving the combination of flags -bbp=2 -xci -vt=2 -bvtc=2. The problem was traced to an error in counting the number of line ending commas in lists.</p>

<p>This fixes case b1130.</p>

<p>15 May 2021, 90cceb1.</p>

</dd>
<dt id="Slightly-modify-line-breaks-for--lp-indentation"><b>Slightly modify line breaks for -lp indentation</b></dt>
<dd>

<p>Random testing produced an edge case of formatting instability for -lp indentation which was traced to checking for an old line break at a &#39;=&gt;&#39;. This has been fixed. Some existing formatting with deeply nested structures may be slightly changed due to the fix, but most existing formatting will be unchanged.</p>

<p>This fixes b1035.</p>

<p>15 May 2021, dd42648.</p>

</dd>
<dt id="Rewrite-coding-for--bom-flag"><b>Rewrite coding for -bom flag</b></dt>
<dd>

<p>Random testing produced some examples of formatting instability involving the -bom flag in combination with certain other flags which are fixed with this update. As part of this update, a previous update to fix case b977 (21 Feb 2021, commit 28114e9) was revised to use a better criterion for deciding when not to keep a &#39;)-&gt;&#39; break. The previous criterion was that the opening and closing containers should be separated by more than one line. The new criterion is that they should contain a list. This still fixes case b977. Another case, b1120, was fixed by requiring that only parentheses expressions be considered for keeping a line break, not &#39;}-&gt;&#39; or &#39;]-&gt;&#39;.</p>

<p>Some issues are illustrated in the following examples using &#39;-bom -gnu&#39;. In the first example the leading &#39;)-&gt;&#39; was being lost due to the old b977 fix:</p>

<pre><code>    # input:
    $show = $top-&gt;Entry( &#39;-width&#39; =&gt; 20,
                       )-&gt;pack(&#39;-side&#39; =&gt; &#39;left&#39;);

    # OLD: perltidy -gnu -bom
    $show = $top-&gt;Entry(&#39;-width&#39; =&gt; 20,)-&gt;pack(&#39;-side&#39; =&gt; &#39;left&#39;);

    # NEW: perltidy -gnu -bom
    $show = $top-&gt;Entry(
                        &#39;-width&#39; =&gt; 20,
                       )-&gt;pack(&#39;-side&#39; =&gt; &#39;left&#39;);</code></pre>

<p>In the following example a leading &#39;-&gt;&#39; was being lost. The NEW version keeps the leading &#39;-&gt;&#39; but has to give up on the -lp alignment because of complexity:</p>

<pre><code>        # input
        $_make_phase_arg = join(&quot; &quot;,
                           map {CPAN::HandleConfig
                                 -&gt;safe_quote($_)} @{$prefs-&gt;{$phase}{args}},
                          );

        # OLD: perltidy -gnu -bom
        $_make_phase_arg = join(&quot; &quot;,
                                map { CPAN::HandleConfig-&gt;safe_quote($_) }
                                  @{$prefs-&gt;{$phase}{args}},
                               );

        # NEW: perltidy -gnu -bom
        $_make_phase_arg = join(
            &quot; &quot;,
            map {
                CPAN::HandleConfig
                  -&gt;safe_quote($_)
            } @{$prefs-&gt;{$phase}{args}},
        );</code></pre>

<p>In the following example, a leading &#39;)-&gt;&#39; was being converted to a leading &#39;-&gt;&#39; due to the old b977 fix:</p>

<pre><code>    # Starting script
    $lb = $t-&gt;Scrolled(&quot;Listbox&quot;, -scrollbars =&gt; &quot;osoe&quot;
                      )-&gt;pack(-fill =&gt; &quot;both&quot;, -expand =&gt; 1);

    # OLD: perltidy -bom -gnu
    $lb = $t-&gt;Scrolled( &quot;Listbox&quot;, -scrollbars =&gt; &quot;osoe&quot; )
      -&gt;pack( -fill =&gt; &quot;both&quot;, -expand =&gt; 1 );

    # NEW: perltidy -bom -gnu
    $lb = $t-&gt;Scrolled(
                       &quot;Listbox&quot;, -scrollbars =&gt; &quot;osoe&quot;
                      )-&gt;pack(-fill =&gt; &quot;both&quot;, -expand =&gt; 1);</code></pre>

<p>In the following example, a leading &#39;)-&gt;&#39; was being lost, again due to the old b977 fix:</p>

<pre><code>    $myDiag-&gt;Label(-text =&gt; $text,
                                  )-&gt;pack(-fill =&gt; &#39;x&#39;,
                                                  -padx =&gt; 3,
                                                  -pady =&gt; 3);

    # OLD: -gnu -bom
    $myDiag-&gt;Label(-text =&gt; $text,)-&gt;pack(
                                          -fill =&gt; &#39;x&#39;,
                                          -padx =&gt; 3,
                                          -pady =&gt; 3
                                         );

    # NEW -gnu -bom
    $myDiag-&gt;Label(
                   -text =&gt; $text,
      )-&gt;pack(
              -fill =&gt; &#39;x&#39;,
              -padx =&gt; 3,
              -pady =&gt; 3
             );</code></pre>

<p>This update fixes case b1120 and revises the fix for b977.</p>

<p>13 May 2021, d0ac5e9.</p>

</dd>
<dt id="Adjust-tolerances-for-some-line-length-tests"><b>Adjust tolerances for some line length tests</b></dt>
<dd>

<p>Random testing produced some edge cases of unstable formatting involving the -lp format. These were fixed by using a slightly larger tolerance in the length test for containers which were broken in the input file.</p>

<p>This fixes cases b1059 b1063 b1117.</p>

<p>13 May 2021, 24a11d3.</p>

</dd>
<dt id="Do-not-apply--lp-formatting-to-containers-with-here-doc-text"><b>Do not apply -lp formatting to containers with here-doc text</b></dt>
<dd>

<p>If a container contains text of a here-doc then the indentation is fixed by the here-doc text, so applying -lp formatting does not work well. So this update turns off the -lp formatting in this case.</p>

<p>But note that if a container contains a here target but not the here text so it still gets the -lp indentation:</p>

<pre><code>    # perltidy -lp
    &amp;WH::Spell::AddSpell(
                          &quot;Cause Light Wounds&quot;, &quot;WFP&quot;,
                          &quot;CauseLightWounds&quot;,   &lt;&lt;&#39;EOH&#39;);
    ...
    EOH</code></pre>

<p>This fixes case b1081.</p>

<p>10 May 2021, 4f7a56b.</p>

</dd>
<dt id="Fix-some-edge-welding-cases"><b>Fix some edge welding cases</b></dt>
<dd>

<p>Some adjustments in welding coding was made to maintain stability for some unusual parameter combinations.</p>

<p>This fixes cases b1111 b1112.</p>

<p>9 May 2021, 68f619a.</p>

</dd>
<dt id="Improve-tolerance-for-welding-qw-quotes"><b>Improve tolerance for welding qw quotes</b></dt>
<dd>

<p>The tolerance for welding qw quotes has been update to be the same as used for welding other tokens. This fixes case b1129.</p>

<p>9 May 2021, d1de85f.</p>

</dd>
<dt id="Revise-weld-tolerances-simplify-code-fix-welded-ci"><b>Revise weld tolerances, simplify code, fix welded ci</b></dt>
<dd>

<p>The welding process uses a tolerance to keep results stable. Basically, a zero tolerance is used if it looks like it is welding an existing weld, while a finite tolerance is used otherwise. The effect is to reject a few marginal welds to gain stability. The coding to do this was simplified and the tolerance was made more precise to fix case b1124.</p>

<p>Another change with this update is that at welded containers, the value of the -ci flag of an outer opening token is transferred to the inner opening token. This may improve some indentation in a few cases if the -lp flag is also used. It has no effect if -lp is not used.</p>

<pre><code>    # OLD: perltidy -wn -gnu
    emit_symbols([qw(
     ctermid
     get_sysinfo
     Perl_OS2_init
     ...
     CroakWinError
    )]);

    # NEW: perltidy -wn -gnu
    emit_symbols([qw(
        ctermid
        get_sysinfo
        Perl_OS2_init
        ...
        CroakWinError
    )]);</code></pre>

<p>9 May 2021, ad8870b.</p>

</dd>
<dt id="Correct-brace-types-mismarked-by-tokenizer-update"><b>Correct brace types mismarked by tokenizer, update</b></dt>
<dd>

<p>This is a generalization of commit 7d3bf4 in which the tokenizer sends a signal to the formatter if the type of a brace following an unknown bareword had to be guessed. The formatter has more information and can fix the problem. This fixes case b1128.</p>

<p>8 May 2021, b3eaf23.</p>

</dd>
<dt id="Added-warning-when--ci-has-to-be-reduced-ref-rt-136415"><b>Added warning when -ci has to be reduced; ref rt #136415</b></dt>
<dd>

<p>In commit c16c5ee an update was made to prevent instability with -xci when the value of -ci exceeds -i (which is not recommended). This update adds a warning message to avoid confusing the user.</p>

<p>7 May 2021, e9e14e4.</p>

</dd>
<dt id="Improve-indentation-of-welded-multiline-qw-quotes"><b>Improve indentation of welded multiline qw quotes</b></dt>
<dd>

<p>Formatting of multiline qw lists with welding works best if the opening and closing qw tokens are on separate lines, like this:</p>

<pre><code>    # perltidy -wn
    my $mon_name = ( qw(
        January February March April
        May June July August
        September October November December
    ) )[$mon];

    # perltidy -wn -lp
    my $mon_name = ( qw(
                     January February March April
                     May June July August
                     September October November December
    ) )[$mon];</code></pre>

<p>Otherwise formatting can be poor, particularly if the last line has text and a closing container.</p>

<pre><code>    # OLD: perltidy -wn
    my $mon_name = ( qw(January February March April
        May June July August
    September October November December) )[$mon];</code></pre>

<p>Note that perltidy does not change the line breaks within multiline quotes, so they must be changed by hand if desired.</p>

<p>This update indents the last line of a multiline quote which contains both text and the closing token, such as:</p>

<pre><code>    # NEW: perltidy -wn
    my $mon_name = ( qw(January February March April
        May June July August
        September October November December) )[$mon];</code></pre>

<p>This update is only when the -lp flag is not used. If -lp is used and the last line contains text, the last line is still outdented:</p>

<pre><code>    $ OLD and NEW: perltidy -wn -lp
    my $mon_name = ( qw(January February March April
                     May June July August
    September October November December) )[$mon];</code></pre>

<p>This is difficult to fix. The best solution is to place the closing qw qw containers on a separate line.</p>

<p>This fix is for case c002.</p>

<p>6 May 2021, 176f8a7.</p>

</dd>
<dt id="Test-length-of-closing-multiline-qw-quote-before-welding"><b>Test length of closing multiline qw quote before welding</b></dt>
<dd>

<p>Random testing produced an unstable state which was due to not checking for excessive length of the last line of a multiline qw quote. A check was added, this fixes issue b1039.</p>

<p>5 May 2021, b72ad24.</p>

</dd>
<dt id="Update-welding-rule-to-avoid-blinking-states"><b>Update welding rule to avoid blinking states</b></dt>
<dd>

<p>Random testing with unusual parameter combinations produced some unstable welds. For example case b1106 has these parameters</p>

<pre><code>    --noadd-whitespace
    --continuation-indentation=6
    --delete-old-whitespace
    --line-up-parentheses
    --maximum-line-length=36
    --variable-maximum-line-length
    --weld-nested-containers</code></pre>

<p>and was switching between these two states:</p>

<pre><code>            return map{
                ($_,[$self-&gt;$_(@_[1..$#_])])
            }@every;

            return map { (
                $_, [ $self-&gt;$_( @_[ 1 .. $#_ ] ) ]
            ) } @every;</code></pre>

<p>An existing rule, WELD RULE 2, was updated to prevent welding to an intact one-line weld, as in the first snippet, if it is on a separate line from the first opening token. With this change, both of these states are stable.</p>

<p>This update fixes cases b1082 b1102 b1106 b1115.</p>

<p>4 May 2021, 07efa9d.</p>

</dd>
<dt id="Fix-problem-of-conflict-of--otr-and--lp"><b>Fix problem of conflict of -otr and -lp</b></dt>
<dd>

<p>Several random test cases produced an instability involving -otr and -lp. In -lp mode, when an opening paren follows an equals and is far to the right, a break is made at the equals to minimize the indentation of the next lines. The -otr flag is a suggestion that an opening paren should be place on the right. A check has been made to avoid this in -lp mode following an equals, since that defeats the purpose of the original break.</p>

<p>This fixes cases b964 b1040 b1062 b1083 b1089.</p>

<p>4 May 2021, 24a0d32.</p>

</dd>
<dt id="Add-option--pvtc-3-requested-in-rt136417"><b>Add option -pvtc=3, requested in rt136417</b></dt>
<dd>

<p>A new integer option, n=3, has been added to the vertical tightness closing flags. For a container with n=3, the closing token will behave as for n=0 if the opening token is preceded by an &#39;=&#39; or &#39;=&gt;&#39;, and like n=1 otherwise.</p>

<p>3 May 2021, 93063a7.</p>

</dd>
<dt id="Fix-vertical-alignment-issue-in-rt136416"><b>Fix vertical alignment issue in rt136416</b></dt>
<dd>

<p>This update fixes a problem with unwanted vertical alignment rasied in rt#136416. The example is</p>

<pre><code>    use File::Spec::Functions &#39;catfile&#39;, &#39;catdir&#39;;
    use Mojo::Base &#39;Mojolicious&#39;,        &#39;-signatures&#39;;</code></pre>

<p>An update was made to reject alignments in use statements with different module names. The test file t/snippets/align35.in has more examples.</p>

<p>3 May 2021, 048126c.</p>

</dd>
<dt id="Fix-some-rare-issues-with-the--lp-option"><b>Fix some rare issues with the -lp option</b></dt>
<dd>

<p>Random testing produced some rare cases of unstable formatting involving the <b>-lp</b> option which are fixed with this update. This is a generalization of commit edc7878 of 23 Jan 2021. This fixes cases b1109 b1110.</p>

<p>2 May 2021, a8d1c8b.</p>

</dd>
<dt id="Correct-brace-types-mismarked-by-tokenizer"><b>Correct brace types mismarked by tokenizer</b></dt>
<dd>

<p>This is a generalization of commit 7d23bf4 to fix some additional cases found in random testing in which the type of a curly brace could not be determined in the tokenizer and was not being corrected by the formatter.</p>

<p>This fixes cases b1125 b1126 b1127.</p>

<p>2 May 2021, dac97cb.</p>

</dd>
<dt id="Avoid-instability-of-combination--bbx-2--lp-and--xci"><b>Avoid instability of combination -bbx=2 -lp and -xci</b></dt>
<dd>

<p>Random testing produced several cases in which the flags -bbx=2 -lp and -xci were causing formatting instability. The fix is to locally turn off -xci when -lp and -bbx=2 are in effect. This is an extension of commit 2b05051.</p>

<p>This fixes cases b1090 b1095 b1101 b1116 b1118 b1121 b1122 b1099</p>

<p>1 May 2021, 4cb81ba.</p>

</dd>
<dt id="Restrict-use-of-flag--cab-3-to-simple-structures"><b>Restrict use of flag -cab=3 to simple structures</b></dt>
<dd>

<p>Logic was added to turn off -cab=3 in complex structures. Otherwise, instability can occur. When it is overridden the behavior of the closest match, -cab=2, is used instead.</p>

<p>For example, using these parameters for case b1113</p>

<pre><code>    --noadd-whitespace
    --break-before-hash-brace-and-indent=2
    --break-before-hash-brace=1
    --comma-arrow-breakpoints=3
    --continuation-indentation=9
    --maximum-line-length=76
    --variable-maximum-line-length</code></pre>

<p>formatting of the following snippet was unstable:</p>

<pre><code>    $STYLESHEET{&#39;html-light&#39;}={
        &#39;tags&#39;=&gt;{
            &#39;predefined identifier&#39;=&gt;
                     {
                &#39;start&#39;=&gt;&#39;&lt;font color=&quot;#2040a0&quot;&gt;&lt;strong&gt;&#39;,
                &#39;stop&#39;=&gt;&#39;&lt;/strong&gt;&lt;/font&gt;&#39;
                     },
        }
    };</code></pre>

<p>This update fixes cases b1096 b1113.</p>

<p>29 Apr 2021, 32a1830.</p>

</dd>
<dt id="Update-docs-for-git-64-regarding--lp-and-side-comments"><b>Update docs for git #64 regarding -lp and side comments</b></dt>
<dd>

<p>The wording regarding when -lp reverts to the default indentation scheme has been revised to include side comment as follows:</p>

<p>In situations where perltidy does not have complete freedom to choose line breaks it may temporarily revert to its default indentation method. This can occur for example if there are blank lines, block comments, multi-line quotes, or side comments between the opening and closing parens, braces, or brackets.</p>

<p>The word &#39;may&#39; is significant for side comments. In a list which is just one level deep side comments will work (perhaps with -iscl if side comments are long). For example this is ok</p>

<pre><code>    # perltidy -lp
    $gif-&gt;arc(
               50, 50,     # Center x, y.
               30, 30,     # Width, Height.
               0,  360,    # Start Angle, End Angle.
               $red
    );</code></pre>

<p>But if a list is more than one level deep then the default indentation is used.</p>

<p>28 Apr 2021, 49977b8.</p>

</dd>
<dt id="Fix-line-break-rules-for-uncontained-commas-cleanups"><b>Fix line break rules for uncontained commas + cleanups</b></dt>
<dd>

<p>This is an adjustment of update 344519e which had to do with breaking lines with commas which were not inside of a container. In a few cases it was producing very long lines when <b>-l=0</b> was set. The solution was to remove the concatenation operator from the list of operators at which breaks were prevented.</p>

<p>Other updates are: Remove unused indentation table. Correct maximum_line_length table for -vmll when -wc is also set. Also fix whitespace rule for &#39;$ =&#39; within a signature to fix case b1123.</p>

<p>26 Apr 2021, d014c2a.</p>

</dd>
<dt id="Fix-problem-with--wn-and--wc-n"><b>Fix problem with -wn and -wc=n</b></dt>
<dd>

<p>Random testing produced some cases in which the -wn flag was unstable when -wc=n was used with very small n. This has been fixed.</p>

<p>This fixes cases: b1098 b1107 25 Apr 2021, 92babdf.</p>

</dd>
<dt id="Adjust-line-break-rules-for-uncontained-commas"><b>Adjust line break rules for uncontained commas</b></dt>
<dd>

<p>Random testing produced case c1119 which was unstable due to the formatting rules for breaking lines at commas which occur outside of containers. The rules were modified to fix the problem.</p>

<p>20 Apr 2021, 344519e.</p>

</dd>
<dt id="Fix-a-bad-line-break-choice-at-a-slash"><b>Fix a bad line break choice at a slash</b></dt>
<dd>

<p>Random testing produced case c001 in which the following snipppet</p>

<pre><code>   ok $mi/(@mtime-1) &gt;= 0.75 &amp;&amp; $ai/(@atime-1) &gt;= 0.75 &amp;&amp;
             $ss/(@mtime+@atime) &gt;= 0.2;</code></pre>

<p>when processed with these parameters</p>

<pre><code>    --maximum-line-length=20
    --nowant-right-space=&#39; / &#39;
    --want-break-before=&#39;* /&#39;</code></pre>

<p>produced the following result</p>

<pre><code>    ok $mi
      /( @mtime - 1 ) &gt;=
      0.75
      &amp;&amp; $ai
      /( @atime - 1 )
      &gt;= 0.75
      &amp;&amp; $ss
      /( @mtime +
          @atime ) &gt;=
      0.2;</code></pre>

<p>using &#39;perl -cw&#39; on this snippet gives a syntax error</p>

<pre><code>    syntax error at /tmp/issues.t line 5, near &quot;/( &quot;
        (Might be a runaway multi-line // string starting on line 2)</code></pre>

<p>The error is due to perl&#39;s weird parsing rules near a possible indrect object. This is a situation where perltidy must ignore a user spacing and line break request. This should have been done but in this case a flag to prevent this was not being propagated to later stages of formatting. This has been fixed.</p>

<p>20 Apr 2021, 4fbc69a.</p>

</dd>
<dt id="Fix-rare-problem-with--lp--wn"><b>Fix rare problem with -lp -wn</b></dt>
<dd>

<p>Random testing produced case b1114 which gave unstable formatting with these parameters</p>

<pre><code>    --noadd-whitespace
    --indent-columns=8
    --line-up-parentheses
    --maximum-line-length=25
    --weld-nested-containers</code></pre>

<p>and this snippet</p>

<pre><code>    is(length(pack(&quot;j&quot;, 0)),
        $Config{ivsize});</code></pre>

<p>Fixed 19 Apr 2021, eeeaf09.</p>

</dd>
<dt id="Fix-issue-git-63"><b>Fix issue git#63</b></dt>
<dd>

<p>The following lines produced an error message due to the side comment</p>

<pre><code>    my $fragment = $parser-&gt;    #parse_html_string
      parse_balanced_chunk($I);</code></pre>

<p>Fixed 18 Apr 2021, c2030cf.</p>

</dd>
<dt id="Avoid-welding-at-sort-map-grep-paren-calls"><b>Avoid welding at sort/map/grep paren calls</b></dt>
<dd>

<p>Random testing produced several cases of unstable welds in which the inner container something like &#39;sort (&#39;. The problem was that there are special rules which prevent a break following such a paren. The problem was fixed by preventing welds at these locations.</p>

<p>This update fixes cases b1077 b1092 b1093 b1094 b1104 b1105 b1108.</p>

<p>17 Apr 2021, d679b48.</p>

</dd>
<dt id="Fix-issue-git-62"><b>Fix issue git#62</b></dt>
<dd>

<p>This fixes issue git #62. A similar issue for the % operator was fixed. 17 Apr 2021, f80d677.</p>

</dd>
<dt id="Fix-problem-involving--bbx-2--xci--osbr-and-similar--otr-flags"><b>Fix problem involving -bbx=2 -xci -osbr and similar -otr flags</b></dt>
<dd>

<p>Random testing produced case b1100 in which the output style produced by the --opening-token-right flags interfered with counting line-ending commas, and this in turn caused the -bbx flag to turn off the -xci flag. This problem was fixed.</p>

<p>15 Apr 2021, 21ef53b.</p>

</dd>
<dt id="Fix-rare-line-break-problem"><b>Fix rare line break problem</b></dt>
<dd>

<p>Random testing produced case b1097 with this parameter set</p>

<pre><code>    --brace-vertical-tightness-closing=1
    --continuation-indentation=8
    --indent-columns=10
    --maximum-line-length=36</code></pre>

<p>and either this output</p>

<pre><code>          my (@files) = @{
                    $args{-files} };</code></pre>

<p>or this output</p>

<pre><code>          my (@files) =
                  @{ $args{-files}
                  };</code></pre>

<p>The different results were caused by the unusual combination of parameters. The problem was fixed by not allowing the formatter to consider existing breaks at highly stressed locations such as these.</p>

<p>15 Apr 2021, 9f15b9d.</p>

</dd>
<dt id="Fix-problem-parsing-anonymous-subs-with-attribute-lists"><b>Fix problem parsing anonymous subs with attribute lists</b></dt>
<dd>

<p>Random testing produced case b994 with unstable formatting:</p>

<pre><code>    do
    sub :
    lvalue
    {
    return;
    }</code></pre>

<p>when run with parameters:</p>

<pre><code>    --continuation-indentation=0
    --ignore-old-breakpoints
    --maximum-line-length=7
    --opening-anonymous-sub-brace-on-new-line</code></pre>

<p>The line &#39;sub :&#39; was being correctly parsed but the following opening block brace was not correctly marked as an anonymous sub brace. This fixes cases b994 and b1053.</p>

<p>15 Apr 2021, 84c1123.</p>

</dd>
<dt id="Correct-brace-types-mismarked-by-tokenizer1"><b>Correct brace types mismarked by tokenizer</b></dt>
<dd>

<p>Testing with random parameters produced a case in which a brace following an unknown bareword was marked by the tokenizer as a code block brace rather than a hash brace. This can cause poor formatting. The problem was solved by having the tokenizer send a signal to the formatter if a block type was guessed. The formatter has more information and can fix the problem. This fixes case b1085.</p>

<p>11 Apr 2021, 7d23bf4.</p>

</dd>
<dt id="Unify-coding-for-welded-quotes-and-other-welded-containers"><b>Unify coding for welded quotes and other welded containers</b></dt>
<dd>

<p>Random testing produced some cases where welded quotes were not converging. These were found to be due to the same problem previouly encountered and fixed for normal containers. The problem was fixed by moving the corrected coding to a new common sub.</p>

<p>This update fixes cases b1066 b1067 b1071 b1079 b1080.</p>

<p>10 Apr 2021, 5d73dd5.</p>

</dd>
<dt id="Slight-change-in-weld-length-calculation"><b>Slight change in weld length calculation</b></dt>
<dd>

<p>Random testing produced some cases of instability with some unusual input parameter combinations involving the -wn parameter. This was fixed by revising a line length calculation. This fixes cases b604 and b605.</p>

<p>9 Apr 2021, a25cfaa.</p>

</dd>
<dt id="Improve-treatment-of--vmll-with--wn"><b>Improve treatment of -vmll with -wn</b></dt>
<dd>

<p>Random testing showed a weakness in the treatment of the -vmll flag in combination with the -wn flag. This has been fixed.</p>

<p>This fixes cases b866 b1074 b1075 b1084 b1086 b1087 b1088</p>

<p>8 Apr 2021, a6effa3.</p>

</dd>
<dt id="Merge-weld-rule-6-into-rule-3"><b>Merge weld rule 6 into rule 3</b></dt>
<dd>

<p>One of the welding rules, RULE 6, has been merged into RULE 3 for generality. This rule restricts welding to an opening container followed by a bare word, which can cause instability in some cases. The updated code is less restrictive and fixes some cases recently found with random testing, b1078 b1091.</p>

<p>8 Apr 2021, f28ab55.</p>

</dd>
<dt id="Moved-logic-of-previous-update-to-the-FileWriter-module"><b>Moved logic of previous update to the FileWriter module</b></dt>
<dd>

<p>The previous update regarding blank line generation was not sufficiently general to handle all possible parameter combinations. The problem was solved and simplified by moving the logic to a lower level, in the FileWriter module.</p>

<p>6 Apr 2021, 756e930.</p>

</dd>
<dt id="Fix-problem-with-excess-blank-line-generation-with--blao"><b>Fix problem with excess blank line generation with -blao</b></dt>
<dd>

<p>Random testing produced some cases where excess blank lines could be generated with the parameter -blank-lines-after-opening-block. Case b1073 has the following script</p>

<pre><code>    sub stop {

        1;
    }</code></pre>

<p>and the following parameters</p>

<pre><code>    --blank-lines-after-opening-block=2
    --maximum-consecutive-blank-lines=10
    --maximum-line-length=15</code></pre>

<p>When run, blank lines keep getting generated until the maximum is reached. This has been fixed.</p>

<p>6 Apr 2021, 9216298.</p>

</dd>
<dt id="Fix-edge-case-involving--wn-and--lp-or--bbao"><b>Fix edge case involving -wn and -lp or -bbao</b></dt>
<dd>

<p>A change was made to a welding rule involving the -lp option or -wbb=&#39;=&#39;, and very short maximum line lengths. This correctly fixes case b1041. It replaces a fix for this case reported on 2 Apr 2021.</p>

<p>5 Apr 2021.</p>

</dd>
<dt id="Modify-a-condition-for-applying--bbx-2"><b>Modify a condition for applying -bbx=2</b></dt>
<dd>

<p>Random testing produced some edge cases in which formatting with the -bbx=2 flags, in combination with certain other parameters, was not converging. An existing criterion for the -bbx=2 flag to apply is that there be a broken sub-list with at least one line-ending comma. This was updated to also require either a fat comma or one additional line-ending comma. This filters out some problem cases without changing much existing formatting.</p>

<p>This update fixes cases b1068 b1069 b1070 b1072 b1073 b1076.</p>

<p>5 Apr 2021, 16c4591.</p>

</dd>
<dt id="Improve-previous--wn-update"><b>Improve previous -wn update</b></dt>
<dd>

<p>The previous update produced some problems in testing which are corrected with this update.</p>

<p>5 Apr 2021, ffef089.</p>

</dd>
<dt id="Fix-rare-convergence-problem-with--wn"><b>Fix rare convergence problem with -wn</b></dt>
<dd>

<p>Random testing produced some cases in which unusual parameter combinations caused lack of convergence for the -wn flag. The problem was fixed by adjusting a tolerance in the line length calculation.</p>

<p>This fixes cases b1041 b1055.</p>

<p>2 Apr 2021, a8b6259.</p>

</dd>
<dt id="Avoid-conflict-of--bli-and--xci"><b>Avoid conflict of -bli and -xci</b></dt>
<dd>

<p>Random testing produced a case with the combination -bli and -xci which did not converge. This was fixed by turning off -xci for braces under -bli control.</p>

<p>This fixes case b1065.</p>

<p>2 Apr 2021, d20ea80.</p>

</dd>
</dl>

<h1 id="Issues-fixed-after-release-20210111">Issues fixed after release 20210111</h1>

<dl>

<dt id="Avoid-conflict-of--bbp-2-and--xci"><b>Avoid conflict of -bbp=2 and -xci</b></dt>
<dd>

<p>Random testing produced a number of cases of unstable formatting when both -xci and -bbp=2 or similar flags were set. The problem was that -xci can cause one-line blocks to break open, causing the -bbp=2 flag to continually switch formatting. The problem is fixed by locally turning off -xci at containers which do not themselves contain broken containers.</p>

<p>This fixes cases b1033 b1036 b1037 b1038 b1042 b1043 b1044 b1045 b1046 b1047 b1051 b1052 b1061.</p>

<p>30 Mar 2021, 2b05051.</p>

</dd>
<dt id="Fix-rule-for-welding-with-barewords"><b>Fix rule for welding with barewords</b></dt>
<dd>

<p>Random testing produced a case which was not converging due to a rule which avoids welding when a bareword follows. The rule was modified to allow an exception for an existing one-line weld. A non-fatal typo was also discovered and fixed.</p>

<p>This fixes cases b1057 b1064.</p>

<p>29 Mar 2021, d677082.</p>

</dd>
<dt id="Fix-conflict-between--wba-and--opr"><b>Fix conflict between -wba=&#39;||&#39; and -opr</b></dt>
<dd>

<p>Random testing produced a problem with convergence due to a conflict between two parameters for the following code</p>

<pre><code>    my $lxy =
      ( @$cx - @$cy ) ||
      (
        length ( int ( $cx-&gt;[-1] ) ) -
        length ( int ( $cy-&gt;[-1] ) ) );</code></pre>

<p>when using these parameters</p>

<pre><code>    --break-after-all-operators
    --maximum-line-length=61
    --opening-paren-right</code></pre>

<p>Both the &#39;||&#39; and the &#39;(&#39; want to be at the end of a line according to the parameters. The problem is resolved by giving priority to the &#39;||&#39;. This fixes case b1060.</p>

<p>29 Mar 2021, 6921a7d.</p>

</dd>
<dt id="Follow-user-requests-better-to-break-before-operators"><b>Follow user requests better to break before operators</b></dt>
<dd>

<p>Random testing produced some cases in which user requests to break before selected operators were not being followed. For example</p>

<pre><code>    # OLD: perltidy -wbb=&#39;.=&#39;
    $value .=
      ( grep /\s/, ( $value, $next ) )
      ? &quot; $next&quot;
      : $next;

    # FIXED: perltidy -wbb=&#39;.=&#39;
    $value
      .= ( grep /\s/, ( $value, $next ) )
      ? &quot; $next&quot;
      : $next;</code></pre>

<p>This fixes case b1054.</p>

<p>28 Mar 2021, 94f0877.</p>

</dd>
<dt id="Fix-problems-with-combinations-of--iob--lp"><b>Fix problems with combinations of -iob -lp</b></dt>
<dd>

<p>This is an correction to the update of 13 Mar 2021, 71adc77. Random testing produced several additional problems with convergence involving the combination -iob -lp. This update fixes the problem by overriding -iob at some breakpoins which are essential to the -lp parameter.</p>

<p>This update fixes these old cases: b1021 b1023</p>

<p>and these new cases: b1034 b1048 b1049 b1050 b1056 b1058</p>

<p>27 Mar 2021, cc94623.</p>

</dd>
<dt id="Add-flag--lpxl-s-to-provide-control-over--lp-formatting"><b>Add flag -lpxl=s to provide control over -lp formatting</b></dt>
<dd>

<p>The flag -lpxl=s provides control over which containers get -lp formatting. A shortcut flag -lfp is also added for limiting -lp to simple function calls.</p>

<p>Updated 25 Mar 2021, bfc00fp.</p>

</dd>
<dt id="Fix-error-message-for-multiple-conflicting-specifications-in--wnxl"><b>Fix error message for multiple conflicting specifications in -wnxl</b></dt>
<dd>

<p>There was an error in the coding for an error message which checks for conflicting requests in the -wnxl parameter.</p>

<p>Fixed 21 Mar 2021, 2ef97a2.</p>

</dd>
<dt id="Fix-issue-git-57-Warn_count-was-not-initialized"><b>Fix issue git #57, Warn_count was not initialized</b></dt>
<dd>

<p>This update fixes issue git #57, in which a warning flag was not getting zeroed on each new call to perltidy.</p>

<p>19 Mar 2021, b6d296a.</p>

</dd>
<dt id="Fix-rare-problem-with-combination--lp--wn--naws"><b>Fix rare problem with combination -lp -wn -naws</b></dt>
<dd>

<p>This update fixes case b1032 by includeing lines starting with &#39;if&#39;, &#39;or&#39;, and || among the stable breakpoints for welding when -lp -naws flags are also set.</p>

<p>This update also modifies update 7a6be43 of 16 Mar 2021 to exclude list items when checking token lengths. This reduces changes to existing formatting while still fixing the problem in case b1031.</p>

<p>18 Mar 2021, 6200034.</p>

</dd>
<dt id="Fix-definition-of-list-within-list-for--bbx-flags"><b>Fix definition of list within list for -bbx flags</b></dt>
<dd>

<p>Testing produced a blinking state involving a -bbx=2 flag with an unusual combination of other parameters. The problem was traced to the definition of a list containing another list being too restrictive. This update fixes case 1024.</p>

<p>17 Mar 2021, 7f5da0a.</p>

</dd>
<dt id="Fix-problem-with--xci-and-long-tokens"><b>Fix problem with -xci and long tokens</b></dt>
<dd>

<p>Testing produced an unstable situation involving the -xci flag and tokens which exceed the maximum line length. This fix identifies this situation and locally deactivates the -xci flag. This fixes case b1031.</p>

<p>16 Mar 2021, 7a6be43.</p>

</dd>
<dt id="Fix-error-in-parsing-use-statement-curly-brace"><b>Fix error in parsing use statement curly brace</b></dt>
<dd>

<p>Testing with random parameters produced some cases where the -xci option was not producing stable results when the maximum line length was set to a very small value. The problem was traced to the tokenizer misparsing a hash brace of a use statement as a code block type. This influences the value of continuation indentation within the braces. The problem was fixed.</p>

<p>This fixes cases b1022 b1025 b1026 b1027 b1028 b1029 b1030</p>

<p>16 Mar 2021, 6371be2.</p>

</dd>
<dt id="Fix-problems-with-combinations-of--iob--lp--wn--dws--naws"><b>Fix problems with combinations of -iob -lp -wn -dws -naws</b></dt>
<dd>

<p>Testing with random parameters produced some situation where the parameter -iob interfered with convergence when parameters -lp and/or -wn were also set. The combination -wn -lp -dws -naws also produced some non-converging states in testing. This update fixes these issues.</p>

<p>The following cases are fixed: b1019 b1020 b1021 b1023</p>

<p>13 Mar 2021, 71adc77.</p>

</dd>
<dt id="Simplify-sub-weld_nested_containers"><b>Simplify sub weld_nested_containers</b></dt>
<dd>

<p>This update consolidates a number of specialized rules for welding into fewer, simpler rules which accomplish the same effect.</p>

<p>These cases are fixed with this update: b186 b520 b872 b937 b996 b997 b1002 b1003 b1004 b1005 b1006 b1013 b1014</p>

<p>There are no current open issues with the weld logic.</p>

<p>10 Mar 2021, cf3ed23.</p>

</dd>
<dt id="Adjust-line-length-tolerance-for-welding"><b>Adjust line length tolerance for welding</b></dt>
<dd>

<p>A minor tolerance adjustment was needed to fix some edge welding cases.</p>

<p>This fixes cases b995 b998 b1000 b1001 b1007 b1008 b1009 b1010 b1011 b1012 b1016 b1017 b1018</p>

<p>7 Mar 2021, b9166ca.</p>

</dd>
<dt id="Fix-problem-with--vtc-n-and-outdented-long-lines"><b>Fix problem with -vtc=n and outdented long lines</b></dt>
<dd>

<p>Random testing produced an issue with -vtc=1 and an outdented long line. The parameters for b999 are</p>

<pre><code>    --maximum-line-length=75
    --paren-vertical-tightness-closing=1</code></pre>

<p>File &#39;b999.in&#39; state 1 is</p>

<pre><code>                while ( $line =~
    s/^([^\t]*)(\t+)/$1.(&quot; &quot; x ((length($2)&lt;&lt;3)-(length($1)&amp;7)))/e
                  )</code></pre>

<p>and state 2 is</p>

<pre><code>                while ( $line =~
    s/^([^\t]*)(\t+)/$1.(&quot; &quot; x ((length($2)&lt;&lt;3)-(length($1)&amp;7)))/e)</code></pre>

<p>The problem was fixed by turning off caching for outdented long lines. This fixes case b999.</p>

<p>7 Mar 2021, 3da7e41.</p>

</dd>
<dt id="Fix-problem-with-combination--lp-and--wbb"><b>Fix problem with combination -lp and -wbb=&#39;=&#39;</b></dt>
<dd>

<p>Random testing produced case b932 in which the combination -lp and -wbb=&#39;=&#39; was not stable.</p>

<p>File &#39;b932.par&#39; is:</p>

<pre><code>    --line-up-parentheses
    --maximum-line-length=51
    --want-break-before=&#39;=&#39;</code></pre>

<p>File &#39;b932.in&#39; in the desired state is:</p>

<pre><code>    my @parts
      = decompose( &#39;(\s+|/|\!|=)&#39;,
                   $line, undef, 1, undef, &#39;[&quot;\&#39;]&#39; );</code></pre>

<p>The alternate state is</p>

<pre><code>    my @parts = decompose( &#39;(\s+|/|\!|=)&#39;,
                     $line, undef, 1, undef, &#39;[&quot;\&#39;]&#39; );</code></pre>

<p>The problem was that the -lp code which set a line break at the equals did not check the -wba flag setting.</p>

<p>This update fixes case b932.</p>

<p>7 Mar 2021, 63129c3.</p>

</dd>
<dt id="Fix-edge-formatting-cases-with-parameter--bbx-2"><b>Fix edge formatting cases with parameter -bbx=2</b></dt>
<dd>

<p>Random testing produced some cases where formatting with parameters of the form --break-before-..=2 can lead to unstable final states. The problem lies in the definition of a broken list. The problem is fixed by defining a broken list for this particular flag to be a list with at least one non-terminal line-ending comma. This insures that the list will remain broken on subsequent iterations. This fixes cases b789 and b938.</p>

<p>6 Mar 2021, 360d669.</p>

</dd>
<dt id="Add-flag--fpva---function-paren-vertical-alignment"><b>Add flag -fpva, --function-paren-vertical-alignment</b></dt>
<dd>

<p>A flag -fpva, --function-paren-vertical-alignment, is added to prevent vertical alignment of function parens when the -sfp flag is used. This is on by default, so that existing formatting remains unchanged unless the user requests that vertical alignment not occur with -nfpva.</p>

<p>5 Mar 2021, 312be4c.</p>

</dd>
<dt id="Fix-for-issue-git-53-do-not-align-spaced-function-parens"><b>Fix for issue git #53, do not align spaced function parens</b></dt>
<dd>

<p>Introducing a space before a function call paren had a side effect of allowing the vertical aligner to align the parens, as in the example.</p>

<pre><code>    # OLD and NEW, default without -sfp:
    log_something_with_long_function( &#39;This is a log message.&#39;, 2 );
    Coro::AnyEvent::sleep( 3, 4 );

    # OLD: perltidy -sfp 
    log_something_with_long_function ( &#39;This is a log message.&#39;, 2 );
    Coro::AnyEvent::sleep            ( 3, 4 );

    # NEW: perltidy -sfp 
    log_something_with_long_function ( &#39;This is a log message.&#39;, 2 );
    Coro::AnyEvent::sleep ( 3, 4 );</code></pre>

<p>This update changes the default to not do this vertical alignment. This should have been the default but this side-effect was missed when the -sfp parameter was added. Note that parens following keywords are likewise not vertically aligned.</p>

<p>5 Mar 2021, 00431bf.</p>

</dd>
<dt id="Fix-issue-git-54-involving--bbp-n-and--bbpi-n"><b>Fix issue git#54 involving -bbp=n and -bbpi=n</b></dt>
<dd>

<p>In this issue, different results were obtained depending upon the existence of a comma in a list. To fix this, the definition of a list was adjusted from requiring one or more commas to requiring either a fat comma or a comma.</p>

<p>At the same time, a known problem involving the combination -lp -bbp=n -bbpi=n was fixed. This fixes cases b826 b909 b989.</p>

<p>4 Mar 2021, 872d4b4.</p>

</dd>
<dt id="Fix-several-minor-weld-issues"><b>Fix several minor weld issues</b></dt>
<dd>

<p>Some edge cases for the welding parameter -wn have been fixed. There are no other currently known weld issues. Some debug code for welding has been left in the code for possible future use.</p>

<p>This fixes cases b109 b110 b520 b756 b901 b937 b965 b982 b988 b991 b992 b993</p>

<p>3 Mar 2021, cfef087.</p>

</dd>
<dt id="Update-tokenizer-recognition-of-indirect-object"><b>Update tokenizer recognition of indirect object</b></dt>
<dd>

<p>This is the parameter file b990.pro: --noadd-whitespace --continuation-indentation=0 --maximum-line-length=7 --space-terminal-semicolon</p>

<p>Applying perltidy -pro=b990.pro to the following snippet gave two states</p>

<pre><code>    # State 1
    print
    H;

    # State 2
    print H
    ;</code></pre>

<p>The tokenizer was alternately parsing &#39;H&#39; as either possble indirect object, &#39;Z&#39;, or indirect object, &#39;Y&#39;. Two fixes were tested. The first was to modify the tokenizer to recognize a &#39;;&#39; as well as a space as a direct object terminator. An alternative fix is to not allowing a break before type &#39;Y&#39; so that the tokenizer kept parsing as type &#39;Y&#39;. Both fixes work, but the latter fix would change existing formatting by the -extrude option, so the first fix was used. With this fix, the stable state is &#39;State 1&#39; above.</p>

<p>This update is a generalization of the update <a href="#Fixed-blinker-related-to-line-break-at-indirect-object">&quot;Fixed blinker related to line break at indirect object&quot;</a> of 16 Jan 2021.</p>

<p>This fixes case b990. 1 Mar 2021, 49cd66f.</p>

</dd>
<dt id="Do-not-start-a-batch-with-a-blank-token"><b>Do not start a batch with a blank token</b></dt>
<dd>

<p>Perltidy does final formatting in discrete batches of tokens, where a batch is a continuous section of the total token list. A batch begins a new line and will be broken into one or more lines. If a batch starts with a blank token it will simply be skipped on on output. However, some rare problems have been found in random testing which can occur if a batch starts with a blank. An example is case b984 which has the following parameters:</p>

<pre><code>        # this is file &#39;b984.pro&#39;
        --block-brace-vertical-tightness=2
        --indent-columns=10
        --maximum-line-length=27
        --outdent-keywords
        --variable-maximum-line-length

          # OLD: perltidy -pro=b984.pro
          unless (
                    exists $self-&gt;{
                              &#39;accession_number&#39;} )
          {         return &quot;unknown&quot;;
          }

          # NEW: perltidy -pro=b984.pro
          unless (
                    exists $self-&gt;{
                              &#39;accession_number&#39;} )
          {       return &quot;unknown&quot;;
          }</code></pre>

<p>Both look OK, but the OLD version did not outdent the keyword &#39;return&#39; as requested with the -okw flag.</p>

<p>This update fixes cases b149 b888 b984 b985 b986 b987.</p>

<p>28 Feb 2021, 8aaf599.</p>

</dd>
<dt id="Avoid-double-spaces-in--csc-text-output"><b>Avoid double spaces in -csc text output</b></dt>
<dd>

<p>Random testing produced some rare cases where two spaces could occur in -csc text. This happened when there were multiple lines and the formatter placed a leading blank in one of the continuation lines as padding. This has been fixed.</p>

<p>For example</p>

<pre><code>    while (
        &lt;&gt;;
      )
    {
       ...
    } ## end while ( &lt;&gt;; )</code></pre>

<p>Previously, the last line had an extra space after the &#39;;&#39;</p>

<pre><code>    } ## end while ( &lt;&gt;;  )</code></pre>

<p>Another example</p>

<pre><code>    while (
        do {
            { package DB; @a = caller( $i++ ) }
        }
      )
    {
      ...
    } ## end while ( do { { package DB...}})</code></pre>

<p>Previously the last line had an extra space between the opening braces:</p>

<pre><code>    } ## end while ( do {  { package DB...}})</code></pre>

<p>27 Feb 2021, b22e891.</p>

</dd>
<dt id="Remove-control-of-debug-flag--fll"><b>Remove control of debug flag -fll</b></dt>
<dd>

<p>Random testing produced an unstable state when a debug flag, -nfll, was set. The only time it is appropriate to set this flag is if the -extrude option is set, so a check was added to verify this. This fixes case b935.</p>

<p>27 Feb 2021, 9155b3d.</p>

</dd>
<dt id="Restrict-previous-update-to-just--vmll"><b>Restrict previous update to just -vmll</b></dt>
<dd>

<p>The previous update was found to occasionally needlessly change existing formatting with very long long lines. So it is restricted to just when -vmll is set. For example, it is ok to keep the long quote following the opening paren in the following case.</p>

<pre><code>  # perltidy -gnu
  ok( &quot;got to the end without dying (note without DEBUGGING passing this test means nothing)&quot;
    );</code></pre>

<p>26 Feb 2021, 2b88464.</p>

</dd>
<dt id="Add-a-gap-calculation-in-line-length-tests-with--vmll"><b>Add a gap calculation in line length tests with -vmll</b></dt>
<dd>

<p>This fixes case b965. The -vmll flag can produce gaps in lines which need to be included in weld line length estimates.</p>

<p>26 Feb 2021, a643cf2.</p>

</dd>
<dt id="Update-rule-for-spacing-paren-after-constant-function"><b>Update rule for spacing paren after constant function</b></dt>
<dd>

<p>Random testing produced an unstable state for the following snippet (case b934)</p>

<pre><code>        sub pi();
        if (
            $t &gt;
            pi( )
              )</code></pre>

<p>when run with these parameters:</p>

<pre><code>  --continuation-indentation=6
  --maximum-line-length=17
  --paren-vertical-tightness-closing=2</code></pre>

<p>The formatting was stable without the first line, which declares &#39;pi&#39; to be a constant sub. The problem was fixed by updating a regex to treat the spacing of a paren following a sub the same for the two token types, &#39;U&#39; or &#39;C&#39; (constant function).</p>

<p>This fixes case b934, 12bfdfe.</p>

<p>26 Feb 2021.</p>

</dd>
<dt id="Improve-line-length-test-for-the--vtc-2-option"><b>Improve line length test for the -vtc=2 option</b></dt>
<dd>

<p>This is a small change to the update of 13 Feb 2021, f79a4f1. Random testing produced additional blinking states caused by the combination of -vtc=2 and -vmll flag, plus several others. The problem was that a line length check in the vertical aligner was being skipped as an optimization if it didn&#39;t appear necessary. The unusual properties of the -vmll flag require that the check always be done.</p>

<p>This fixes cases b656 b862 b971 b972.</p>

<p>26 Feb 2021, 80107e0.</p>

</dd>
<dt id="Improve-one-line-block-length-tests"><b>Improve one-line block length tests</b></dt>
<dd>

<p>Some oscillating states produced in random parameter tests were traced to problems with forming one-line blocks. A more precise length test was added to fix this.</p>

<p>This fixes cases b562 b563 b574 b777 b778 b924 b936 b975 b976 b983.</p>

<p>In the process of fixing this issue, a glitch was discovered in the previous coding of the -bl (braces-left) flag that caused somewhat random results for block types sort/map/grep/eval. The problem was a conflict between the logic for forming one-line blocks and the logic for applying the -bl flag. Usually, -bl formatting was not applied to these block types, but occasionally it was. To minimize changes in existing formatting, in the new version the -bl flag is not applied to these block types. A future flag could be added to give user control over which of these block types are under -bl control.</p>

<p>25 Feb 2021, 92bec8d.</p>

</dd>
<dt id="Add-tolerance-to-one-line-block-length-tests"><b>Add tolerance to one-line block length tests</b></dt>
<dd>

<p>Testing with random input parameters produced some cases in which a stable solution could not be found due to attempts to form one-line blocks near the end of a long line. The problem was fixed by adding a small tolerance to the line length test. This does not change existing formatting.</p>

<p>This fixes cases b069 b070 b077 b078.</p>

<p>21 Feb 2021, 0b97b94.</p>

</dd>
<dt id="Restrict--bom-at-cuddled-method-calls"><b>Restrict -bom at cuddled method calls</b></dt>
<dd>

<p>The -bom flag tries to keep old breakpoints at lines beginning with &#39;-&gt;&#39; and also with some lines beginning with &#39;)-&gt;&#39;. These latter lines can lead to blinking states in cases where the opening paren is on the previous line. To fix this, a restriction was added that the line difference between the opening and closing parens should be more than 1.</p>

<p>This fixes case b977.</p>

<p>21 Feb 2021, 28114e9.</p>

</dd>
<dt id="Add-weld-rule-to-avoid-conflict-between--wn-and--bom"><b>Add weld rule to avoid conflict between -wn and -bom</b></dt>
<dd>

<p>Testing with ramdom input parameters produced states which were oscillating because of a conflict between the -wn and -bom parameters. The problem was resolved by giving the -bom parameter priority over -wn.</p>

<p>These cases are fixed with this update: b966 b973</p>

<p>20 Feb 2021.</p>

</dd>
<dt id="Limit-the-value-of--ci-n-to-that-of--i-n-when--xci-is-set"><b>Limit the value of -ci=n to that of -i=n when -xci is set</b></dt>
<dd>

<p>Testing with random input parameters produced a number of oscillating states which had both parameter -xci as well as a value of -ci=n which exceeded the value of -i=n. To correct this, perltidy will silently reduce the -ci value to the -i value when -xci is also set. This should not change existing formatting because a value of -ci greater than -i would not normally be used in practice.</p>

<p>These cases are fixed with this update: b707 b770 b912 b920 b930 b933 b939 b940 b941 b942 b978 b974 b979 b980 b981</p>

<p>20 Feb 2021, c16c5ee.</p>

</dd>
<dt id="Modify-length-tolerance-for-welding-to-qw-lists"><b>Modify length tolerance for welding to qw lists</b></dt>
<dd>

<p>Several cases of alternating states were produced in random testing which were caused by line length limits being reached when welding to qw lists. This was fixed by adding a small tolerance to line length tests.</p>

<p>This fixes cases b654 b655 b943 b944 b967 b968 b969 b970.</p>

<p>19 Feb 2021, 0baafc8.</p>

</dd>
<dt id="Modify-space-rule-between-binary-plus-or-minus-and-a-bareword"><b>Modify space rule between binary plus or minus and a bareword</b></dt>
<dd>

<p>The update of 13 Feb 2021, cf414fe, has been modified to be less restrictive. Space between a binary plus and minus and a bareword may now be removed in some cases where no tokenization ambiguity exists. 18 Feb 2021, a8564c8.</p>

</dd>
<dt id="Do-not-apply--xci-if-it-would-put-tokens-beyond-the-maximum-line-length"><b>Do not apply -xci if it would put tokens beyond the maximum line length</b></dt>
<dd>

<p>This update fixes cases b899 b935. 17 Feb 2021, b955a7c.</p>

</dd>
<dt id="Do-not-weld-to-a-hash-brace"><b>Do not weld to a hash brace</b></dt>
<dd>

<p>The reason is that it has a very strong bond strength to the next token, so a line break after it may not work. Previously we allowed welding to something like &#39;@{&#39; but even that caused blinking states (cases b751, b779).</p>

<p>This will not change much existing code. This update fixes cases b751 b779.</p>

<p>16 Feb 2021, eb2f4e7.</p>

</dd>
<dt id="Avoid-line-breaks-after-token-type-G"><b>Avoid line breaks after token type &#39;G&#39;</b></dt>
<dd>

<p>Random testing with very short maximum line lengths produced some blinking states which were traced to the tokenizer alternately parsed an unknown bareword as type &#39;w&#39; or type &#39;G&#39;, depending on whether or not an opening block brace immediately followed on the same line. To fix this, a rule was added which prevents a line break between a type &#39;G&#39; token and an opening code block brace.</p>

<p>This update fixes these cases: b900 b902 b928 b929</p>

<p>15 Feb 2021, f005a95.</p>

</dd>
<dt id="Restrict-breaking-at-old-uncontained-commas"><b>Restrict breaking at old uncontained commas</b></dt>
<dd>

<p>Random testing with very short maximum line lengths produced some blinking states which were traced to duplicating old comma breakpoints which were not really good breakpoints. A patch was made to be more selective.</p>

<p>These cases are fixed with this update: b610 b757 b931</p>

<p>15 Feb 2021, 98b41a0.</p>

</dd>
<dt id="Modify-line-length-test-for-the--vtc-2-option"><b>Modify line length test for the -vtc=2 option</b></dt>
<dd>

<p>The line length test which was added Feb 13 2021 turns out to be more restrictive than necessary. A modification was made to only apply it if a new one-line block would be formed. This prevents it from needlessly changing existing formatting.</p>

<p>The following cases were re-activated after this update: b654 b655 b656 b862</p>

<p>15 Feb 2021, 4673fdd.</p>

</dd>
<dt id="Use-increased-line-length-tolerance-if-ci-exceeds-i"><b>Use increased line length tolerance if ci exceeds i</b></dt>
<dd>

<p>In testing perltidy with random input parameters, some blinking states occurred when the value of -ci was significantly larger than the value of -i. (In actual practice, -ci is not normally set greater than -i). This update adds a tolerance to line length tests which avoids this problem. This fixes the following cases</p>

<p>b775 b776 b826 b908 b910 b911 b923 b925 b926 b927</p>

<p>14 Feb 2021, 8451f2f.</p>

</dd>
<dt id="Keep-space-between-binary-plus-or-minus-and-a-bareword"><b>Keep space between binary plus or minus and a bareword</b></dt>
<dd>

<p>This update makes a space between a binary + or - and a bareword an essential whitespace. Otherwise, they may be converted into unary + or - on the next pass, which can lead to blinking states. Fixes cases b660 b670 b780 b781 b787 b788 b790.</p>

<p>13 Feb 2021, cf414fe.</p>

</dd>
<dt id="Prevent-breaks-after-unary-plus-and-minus"><b>Prevent breaks after unary plus and minus</b></dt>
<dd>

<p>Some alternating states were produced when extremely maximum line lengths forced a break after a unary plus or minus. Fixes cases b670 b790.</p>

<p>13 Feb 2021, cf414fe.</p>

</dd>
<dt id="Add-line-length-test-for-the--vtc-2-option"><b>Add line length test for the -vtc=2 option</b></dt>
<dd>

<p>Random testing produced a number of cases of blinking states which were caused when the -vtc=2 flag caused the vertical aligner to combine lines which exceeded the allowable line length. These long lines were then getting reduced in size on every other iteration. A line length test was added in the vertical aligner to prevent this. This fixes these cases:</p>

<p>b654 b655 b656 b657 b761 b762 b763 b764 b765 b766 b767 b768 b769 b862 b904 b905 b906 b907 b913 b914 b915 b916 b917 b918 b919</p>

<p>13 Feb 2021, f79a4f1.</p>

</dd>
<dt id="Define-left-side-bond-strengths-for-unary-plus-and-minus"><b>Define left side bond strengths for unary plus and minus</b></dt>
<dd>

<p>Random testing produced a blinking state which was traced to the unary plus not having a defined strength in the line break algorithm. This was fixed by setting it to be the same as the left strength of a plus. This fixes case b511. 12 Feb 2021, 58a7895.</p>

</dd>
<dt id="Fix-problem-with-breaking-at-an-sign"><b>Fix problem with breaking at an = sign</b></dt>
<dd>

<p>Random testing produced some blinking cases which were related to detecting an old good breakpoint at an equals. If the user requested that a break be done before an equals, and the input script had a break after an equals, then that break should not have been marked as a good existing break point before a keyword. This update fixes cases b434 b903.</p>

<p>11 Feb 2021, f9a8543.</p>

</dd>
<dt id="Fix-conflict-of--kbl-0-and-essential-space-after-cut"><b>Fix conflict of -kbl=0 and essential space after =cut</b></dt>
<dd>

<p>Random testing produced a case where a blank line after an =cut was alternately being deleted and added due to a conflict with the flag setting -keep-old-blank-lines=0. This was resolved by giving prioritiy to the essential blank line after the =cut line.</p>

<p>This fixes case b860. 11 Feb 2021, 8c13609.</p>

</dd>
<dt id="Do-not-break-one-line-block-at-here-target"><b>Do not break one-line block at here target</b></dt>
<dd>

<p>A blinking state produced by random testing was traced to a line of coding which which unnecessarily prevented one-line blocks from being formed when a here-target was encountered. This has been fixed.</p>

<p>For example, the code block in the following contains a here target and was being broken into two lines:</p>

<pre><code>    unless ($INC{$file}) {
        die &lt;&lt;&quot;END_DIE&quot; }</code></pre>

<p>These will now be output with the blocks intact, like this</p>

<pre><code>    unless ($INC{$file}) { die &lt;&lt;&quot;END_DIE&quot; }</code></pre>

<p>This fixes case b523. 11 Feb 2021, 6d5bb74.</p>

</dd>
<dt id="Skip-processing--kgb-flags-in-lists-or-if--maximum-consecutive-blank-lines-0"><b>Skip processing -kgb* flags in lists or if -maximum-consecutive-blank-lines=0</b></dt>
<dd>

<p>Random testing produced an alternating state which was caused by -kgb flags being active on keywords which were in a list rather than a code block. A check was added to prevent this. Also, the -kgb* flags have no effect if no blank lines can be output, so a check was added for this situation. This fixes case b760.</p>

<p>10 Feb 2021, 177fc3a.</p>

</dd>
<dt id="Modify-tolerance-in-testing-for-welds"><b>Modify tolerance in testing for welds</b></dt>
<dd>

<p>Random testing with unusual parameters produced some blinking weld states which were fixed by modifying a tolerance used in a line length test. The following cases were fixed with this update:</p>

<p>b746 b748 b749 b750 b752 b753 b754 b755 b756 b758 b759 b771 b772 b773 b774 b782 b783 b784 b785 b786</p>

<p>9 Feb 2021, a4609ac.</p>

</dd>
<dt id="Modified-rule-for-breaking-lines-at-old-commas"><b>Modified rule for breaking lines at old commas</b></dt>
<dd>

<p>Random testing produced some blinking cases resulting from the treatment of old line breaks at commas not contained within containers. The following cases were fixed with this update:</p>

<p>b064 b065 b068 b210 b747</p>

<p>This change has no effect on scripts with normal parameter values. 9 Feb 2021, 5c23661.</p>

</dd>
<dt id="Restrict-references-to-old-line-breaks"><b>Restrict references to old line breaks</b></dt>
<dd>

<p>A number of cases of blinking states were traced to code which biased the breaking of long lines to existing breaks. This was fixed by restricting this coding to just use old comma line break points.</p>

<p>The following cases were fixed with this update:</p>

<p>b193 b194 b195 b197 b198 b199 b216 b217 b218 b219 b220 b221 b244 b245 b246 b247 b249 b251 b252 b253 b254 b256 b257 b258 b259 b260 b261 b262 b263 b264 b265 b266 b268 b269 b270 b271 b272 b274 b275 b278 b280 b281 b283 b285 b288 b291 b295 b296 b297 b299 b302 b304 b305 b307 b310 b311 b312 b313 b314 b315 b316 b317 b318 b319 b320 b321 b322 b323 b324 b325 b326 b327 b329 b330 b331 b332 b333 b334 b335 b336 b337 b338 b339 b340 b341 b342 b343 b344 b345 b346 b347 b348 b349</p>

<p>8 Feb 2021, 66be455.</p>

</dd>
<dt id="Fix-rare-problem-involving-interaction-of--olbn-n-and--wn-flags"><b>Fix rare problem involving interaction of -olbn=n and -wn flags</b></dt>
<dd>

<p>Random testing revealed a rare alternating state which could occur when both flags --one-line-block-nesting=n and --weld-nested-containers are set, and the maximum line length is set very low. The problem was fixed by ignoring the first flag at welded tokens. This should not have any effect on scripts with realistic parameter values.</p>

<p>The following case was fixed with this update: b690.</p>

<p>6 Feb 2021, 3e96930.</p>

</dd>
<dt id="add-rule-to-avoid-welding-at-some-barewords"><b>add rule to avoid welding at some barewords</b></dt>
<dd>

<p>A rule was added to prevent certain rare blinking states involving welding. The rule is that if an opening container is immediately followed by a bareword which is unknown, a weld will be avoided.</p>

<p>The following cases were fixed with this update: b611 b626.</p>

<p>6 Feb 2021, 6b1f44a</p>

</dd>
<dt id="further-simplify--bbxi-n-implementation"><b>further simplify -bbxi=n implementation</b></dt>
<dd>

<p>This update adds a new variable which indicates if a container is permanently broken due to a side comment or blank line. This helps reduce the number of cases where the -bbxi=n flag cannot be applied. Another change was to always apply the -bbx=n flag, even if the -bbxi=n flag cannot be applied. These two flags now operate almost exactly as in previous versions but without the blinking problem. The only difference is that now the -bbxi=n flag with n&gt;0 will revert to n=0 for some short containers which might not be broken open.</p>

</dd>
<dt id="reset--bbxi-2-to--bbxi-0-if--lp-is-set-to-avoid-blinking-states"><b>reset -bbxi=2 to -bbxi=0 if -lp is set to avoid blinking states</b></dt>
<dd>

<p>The options of the form bbxi=2, such as break-before-paren-and-indent=2, have been found to cause blinking states if the -lp flag is set. Both of these options are fairly rare. To correct this the -bbxi=2 flag is now reset to -bbxi=0 if the -lp flag is set. Note that -bbxi=2 and -bbxi=0 give the same formatting result with the common setting -ci=4 and -i=4.</p>

<p>The following cases were fixed with this update:</p>

<p>b396 b397 b398 b429 b435 b457 b502 b503 b504 b505 b538 b540 b542 b617 b618 b619 b620 b621</p>

<p>3 Feb 2021, 67ab0ef.</p>

</dd>
<dt id="rewrite-sub-break_before_list_opening_containers"><b>rewrite sub break_before_list_opening_containers</b></dt>
<dd>

<p>sub break_before_list_opening_containers was rewritten to reduce the chance of producing alternating states.</p>

<p>The following cases were fixed with this update:</p>

<p>b030 b032 b455 b456 b458 b459 b460 b461 b462 b536 b622 b651 b652 b653 b708 b709 b710 b713 b714 b719 b723 b724 b725 b726 b727 b729 b731 b733 b735 b736 b737 b738 b739 b740 b743 b744</p>

<p>3 Feb 2021, 5083ab9.</p>

</dd>
<dt id="redefine-list-to-have-at-least-one-internal-comma"><b>redefine list to have at least one internal comma</b></dt>
<dd>

<p>Random testing produced some blinking states which could be fixed by changing the definition of a list, for formatting purposes, to have one or more interior commas rather than simply one or more commas. The difference is that something with a single terminal comma, like &#39;( $x, )&#39;, is no longer classified as a list. This makes no difference except when perltidy is stress tested with unusual parameters.</p>

<p>The following cases were fixed with this update:</p>

<p>b116 b119 b122 b174 b179 b187 b361 b369 b370 b372 b376 b427 b428 b448 b449 b450 b451 b452 b453 b469 b473 b474 b475 b476 b477 b479 b480 b481 b482 b497 b552 b553 b554 b558 b559 b634 b637 b642 b644 b645 b647 b650 b661 b662 b663 b664 b666 b677 b685 b688 b698 b699 b700 b702 b703 b704 b711 b712 b715 b716 b717 b718 b721 b730 b734 b741 b742</p>

<p>1 Feb 2021, 35078f7.</p>

</dd>
<dt id="rewrite-and-combine-coding-for--bbx-n-and--bbxi-n"><b>rewrite and combine coding for -bbx=n and -bbxi=n</b></dt>
<dd>

<p>Random testing produced a large number of blinking states involving parameters such as --break-before-parens=n and --break-before-parens-and-indent=n and similar pairs. The problem was traced to the fact that the former parameter was implemented late in the pipeline whereas the latter parameter was implemented early in the pipeline. Normally there was no problem, but in some extreme cases, often involving very short maximum line lengths, this could produce alternating output states. The problem was resolved by combining the implementation of both flags in a single new sub to avoid any inconsistencies. The following cases were fixed with this update:</p>

<p>b018 b066 b071 b079 b090 b105 b146 b149 b158 b160 b161 b163 b164 b166 b167 b169 b170 b171 b172 b178 b185 b190 b192 b203 b206 b222 b223 b224 b237 b359 b362 b377 b379 b381 b382 b389 b395 b407 b408 b409 b410 b411 b412 b414 b417 b418 b419 b421 b433 b438 b443 b444 b478 b483 b484 b486 b490 b492 b493 b494 b496 b506 b507 b517 b521 b522 b524 b525 b535 b537 b539 b541 b543 b546 b550 b551 b555 b564 b566 b567 b569 b570 b572 b573 b575 b576 b577 b578 b579 b580 b582 b586 b587 b588 b589 b590 b591 b592 b593 b603 b607 b609 b613 b615 b616 b623 b624 b630 b635 b636 b638 b639 b640 b641 b643 b646 b648 b649 b658 b659 b665 b667 b668 b669 b671 b672 b673 b674 b675 b676 b678 b679 b680 b681 b682 b683 b684 b686 b687 b689 b691 b692 b693 b694 b695 b696 b697 b701 b705 b706 b720 b722 b728 b732 b745</p>

<p>31 Jan 2021, 10e8bfd.</p>

</dd>
<dt id="adjust-line-length-and-token-count-tolerances-for--wn"><b>adjust line length and token count tolerances for -wn</b></dt>
<dd>

<p>Most remaining edge cases of blinking states involving the -wn parameter have been fixed by adjusting some tolerances in sub weld_nested_containers. The following cases are fixed with this update:</p>

<p>b156 b157 b186 b196 b454 b520 b527 b530 b532 b533 b534 b612 b614 b625 b627</p>

<p>This update has no effect for realistic parameter settings.</p>

<p>30 Jan 2021, d359a60.</p>

</dd>
<dt id="fix-additional-edge-blinker-cases-involving--wn"><b>fix additional edge blinker cases involving -wn</b></dt>
<dd>

<p>Some blinking cases produced in random testing were traced to welding in very short lines (length = 20 for example) in which a weld was made to a square bracket containing just a single parameter, so that it had no good internal breaking points. A rule was added to avoid welding to a square bracket not containing any commas. The following cases were fixed with the update:</p>

<p>b002 b003 b005 b006 b007 b009 b010 b014 b015 b017 b020 b111 b112 b113 b124 b126 b128 b151 b153 b439 b606</p>

<p>29 Jan 2021, 33f1f2b.</p>

</dd>
<dt id="fix-additional-edge-blinker-cases-involving--wn1"><b>fix additional edge blinker cases involving -wn</b></dt>
<dd>

<p>Random testing produced some blinking states which were traced to the precision of a line length test. In sub weld_nested_containers, the test</p>

<pre><code>    $do_not_weld ||= $excess_length_to_K-&gt;($Kinner_opening) &gt; 0;</code></pre>

<p>was changed to allow a 1 character margin of error:</p>

<pre><code>    $do_not_weld ||= $excess_length_to_K-&gt;($Kinner_opening) &gt;= 0;</code></pre>

<p>The following cases were fixed with this update:</p>

<p>b025 b075 b091 b109 b110 b152 b154 b155 b162 b168 b176 b422 b423 b424 b425 b426 b565</p>

<p>29 Jan 2021, 33f1f2b.</p>

</dd>
<dt id="fix-some-edge-blinker-cases-involving--wn"><b>fix some edge blinker cases involving -wn</b></dt>
<dd>

<p>Random testing produced some blinking states which were eliminated by a simplification of the definition of a one_line_weld in sub weld_nested_containers. The following cases were fixed with this update:</p>

<p>b131 b134 b136 b205 b233 b238 b284 b350 b352 b358 b385 b487 b604 b605</p>

<p>29 Jan 2021, 33f1f2b.</p>

</dd>
<dt id="fix-some-edge-blinker-cases-involving--bbxi-n-esp.-with--boc"><b>fix some edge blinker cases involving -bbxi=n esp. with -boc</b></dt>
<dd>

<p>The following cases were fixed with this update:</p>

<p>b041 b182 b184 b366 b367 b368 b370 b371 b382 b420 b432 b438 b464 b466 b467 b468 b500 b501 b508 b509 b510 b512 b513 b514 b515 b516 b526 b528 b529 b531 b544 b545 b547 b548 b549 b556 b557 b568 b571 b581 b583 b584 b585 b594 b595 b596 b597 b598 b599 b600 b601 b602 b608 b041 b182 b184 b355 b356 b366 b367 b368 b371 b420 b432 b464 b465 b466 b467 b468 b500 b501 b508 b509 b510 b512 b513 b514 b515 b516 b526 b528 b529 b531 b544 b545 b547 b548 b549 b556 b557 b568 b571 b581 b583 b584</p>

<p>28 Jan 2021.</p>

</dd>
<dt id="fix-problem-with-combination--cab-2-and-bbhbi-n"><b>fix problem with combination -cab=2 and bbhbi=n</b></dt>
<dd>

<p>Random testing produced a number of cases in which the combination -cab=2 and bbhbi=n and similar flags were in conflict, causing alternating states. This was fixed by not changing ci for containers which can fit entirely on one line, which is what -cab=2 says to do. The following cases were fixed with this update:</p>

<p>b046 b061 b081 b084 b089 b093 b130 b133 b135 b138 b142 b145 b147 b150 b165 b173 b191 b211 b294 b309 b360 b363 b364 b365 b373 b386 b387 b388 b392 b437 b440 b472 b488 b489</p>

<p>27 Jan 2021, 6d710de.</p>

</dd>
<dt id="fix-problem-with--freeze-whitespace"><b>fix problem with -freeze-whitespace</b></dt>
<dd>

<p>Random testing produced a case in which the --freeze-whitespace flag (which is mainly useful for testing) could cause a blank space which kept increasing. The problem was caused by the &quot;vertical tightness&quot; mechanism. Turning it off when the -freeze-whitespace-flag is on fixed the problem. The following cases were fixed with this update:</p>

<p>b037 b038 b043 b059 b060 b067 b072 b215 b225 b267 b273 b276 b279 b282 b289 b292 b300 b303 b354 b374 b375 b383 b384 b402 b403 b404 b405 b436 b441 b445 b446 b471 b485 b498 b499</p>

<p>27 Jan 2021, 6d710de.</p>

</dd>
<dt id="Avoid-blinking-states-associated-with--bbpi-and-similar-flags"><b>Avoid blinking states associated with -bbpi and similar flags</b></dt>
<dd>

<p>Random testing with extreme parameter values revealed blinking states associated with the -bbpi and related flags. The problem was that continuation indentation was sometimes being added according to the flag but the lists were not actually being broken. After this was fixed the following cases ran correctly:</p>

<p>b024 b035 b036 b040 b042 b047 b049 b050 b051 b052 b053 b054 b057 b062 b063 b073 b074 b076 b080 b083 b085 b086 b087 b088 b102 b103 b104 b106 b107 b108 b115 b118 b121 b123 b125 b127 b132 b137 b139 b140 b141 b143 b144 b148 b159 b175 b177 b180 b181 b188 b189 b200 b201 b202 b204 b207 b212 b213 b214 b226 b227 b228 b229 b230 b232 b239 b240 b241 b243 b248 b250 b255 b277 b286 b287 b290 b293 b298 b301 b306 b308 b328 b351 b353 b357 b378 b380 b390 b391 b393 b394 b399 b400 b401 b406 b413 b415 b416 b430 b431 b442 b447 b463 b470 b491 b495</p>

<p>27 Jan 2021, 96144a3.</p>

</dd>
<dt id="Revise-coding-for-the---freeze-whitespace-option"><b>Revise coding for the --freeze-whitespace option</b></dt>
<dd>

<p>Random testing produced some blinking states which were traced to an incorrect implementation of the <b>--freeze-whitespace</b> option (which is mainly useful in stress testing perltidy). A related flag, --add-whitespace is involved. This update corrects these problems. Test cases include b057, b183, b242. 24 Jan 2021, 9956a57.</p>

</dd>
<dt id="Fix-for-issue-git-51-closing-qw-paren-not-outdented-when--ndnl-is-set"><b>Fix for issue git #51, closing qw paren not outdented when -ndnl is set</b></dt>
<dd>

<p>The problem is that a bare closing qw paren was not being outdented if the flag &#39;-nodelete-old-newlines is set. For example</p>

<pre><code>    # OLD (OK, outdented): perltidy -ci=4 -xci
    {
        modules =&gt; [
            qw(
                JSON
            )
        ],
    }


    # OLD (indented) : perltidy -ndnl -ci=4 -xci
    {
        modules =&gt; [
            qw(
                JSON
                )
        ],
    }

    # FIXED: perltidy -ndnl -ci=4 -xci
    {
        modules =&gt; [
            qw(
                JSON
            )
        ],
    }</code></pre>

<p>The problem happened because the -ndnl flag forces each line to be written immediately, so the next line (which needs to be checked in this case) was not available when the outdent decision had to be made. A patch to work around this was added 24 Jan 2021, 52996fb.</p>

</dd>
<dt id="Some-issues-with-the--lp-option"><b>Some issues with the -lp option</b></dt>
<dd>

<p>Random testing revealed some problems involving the <b>-lp</b> option which are fixed with this update.</p>

<p>The problem is illustrated with the following snippet</p>

<pre><code>    # perltidy -lp
    Alien::FillOutTemplate(
                &quot;$main::libdir/to-$main::desttype/$main::filetype/spec&quot;,
                &quot;$workdir/$fields{NAME}-$fields{VERSION}-$fields{RELEASE}.spec&quot;,
                %fields
    );</code></pre>

<p>which alternately formats to this form</p>

<pre><code>    # perltidy -lp
    Alien::FillOutTemplate(
                &quot;$main::libdir/to-$main::desttype/$main::filetype/spec&quot;,
                &quot;$workdir/$fields{NAME}-$fields{VERSION}-$fields{RELEASE}.spec&quot;,
                %fields );</code></pre>

<p>when formatted with the single parameter <b>-lp</b>. A number of similar examples were found in testing. The problem was traced to the treatment of the space which perltidy tentatively adds wherever there is a newline, just in case the formatted output has different line breaks. The problem was that the indentation level of these spaces was being set as the level of the next token rather than the previous token. Normally the indentation level of a space has no effect, but the <b>-lp</b> option does use it and this caused the problem. This was fixed 23 Jan 2021, edc7878.</p>

</dd>
<dt id="added-rule-for--wn-do-not-weld-to-a-hash-brace"><b>added rule for -wn, do not weld to a hash brace</b></dt>
<dd>

<p>In random testing, the following two alternating states</p>

<pre><code>    # State 1
    {
        if ( defined
        ($symbol_table{$direccion}) )
    }
    
    # State 2
    {
        if (defined (
                $symbol_table{
                    $direccion}
            )
        )
    }</code></pre>

<p>were occurring with the following particular parameter set</p>

<pre><code>    --weld-nested-containers
    --maximum-line-length=40
    --continuation-indentation=7
    --paren-tightness=2
    --extended-continuation-indentation</code></pre>

<p>The problem was traced to welding to the opening hash brace. A rule was added to prevent this, and testing with a large body of code showed that it did not significantly change existing formatting. With this change, the above snippet formats in the stable state</p>

<pre><code>    {
        if (defined(
            $symbol_table{$direccion}
        ))
    }</code></pre>

<p>20 Jan 2021, 4021436.</p>

</dd>
<dt id="Do-not-let--kgb-option-delete-essential-blank-after-cut"><b>Do not let -kgb option delete essential blank after =cut</b></dt>
<dd>

<p>A blinking state was found in random testing for the following snippet</p>

<pre><code>    =head1 TODO
    
    handle UNIMARC encodings
    
    =cut
    
    use strict;
    use warnings;</code></pre>

<p>when run with the following parameters</p>

<pre><code>    --keyword-group-blanks-size=&#39;2.8&#39;
    --keyword-group-blanks-before=0</code></pre>

<p>The space after the =cut was alternately being added as an essential blank which is required by pod utilities, and then deleted by these parameters. This was fixed 17 Jan 2021, b9a5f5d.</p>

</dd>
<dt id="Turn-off--boc-flag-if--iob-is-set"><b>Turn off -boc flag if -iob is set</b></dt>
<dd>

<p>In random testing, the cause of a blinker was traced to both flags --ignore-old-breakpoints and --break-at-old-comma-breakpoints being set. There is a warning message but the -boc flag was not actually being turned off. This was fixed 17 Jan 2021, b9a5f5d.</p>

</dd>
<dt id="Modified-spacing-rule-for-token-type-Y"><b>Modified spacing rule for token type Y</b></dt>
<dd>

<p>A space following a token type &#39;Y&#39; (filehandle) should not be removed. Otherwise it might be converted into type &#39;Z&#39; (possible filehandle). If that were to happen, the space could not be added back automatically in later formatting, so the user would have to do it by hand. This fix prevents this from happening. 17 Jan 2021, bef9a83.</p>

</dd>
<dt id="Fixed-blinker-related-to-line-break-at-indirect-object"><b>Fixed blinker related to line break at indirect object</b></dt>
<dd>

<p>In random testing a blinker was reduced to the following snippet</p>

<pre><code>    {
             print FILE
              GD::Barcode
              -&gt;new();
    }</code></pre>

<p>which switched to the following state on each iteration</p>

<pre><code>    {
             print FILE GD::Barcode
              -&gt;new();
    }</code></pre>

<p>with the following parameters</p>

<pre><code>    --maximum-line-length=20
    --indent-columns=9
    --continuation-indentation=1</code></pre>

<p>The problem was that the token &#39;FILE&#39; was either parsed as type &#39;Y&#39; or &#39;Z&#39; depending on the existence of a subsequent space. These have different line break rules, causing a blinker. The problem was fixed by modifying the tokenizer to consider a newline to be a space. Updated 16 Jan 2021, d40cca9.</p>

</dd>
<dt id="Turn-off--bli-if--bar-is-set"><b>Turn off -bli if -bar is set</b></dt>
<dd>

<p>A conflict arises if both <b>-bli</b> and <b>-bar</b> are set. In this case a warning message is given and <b>-bli</b> is turned off. Updated 15 Jan 2021, ef69531.</p>

</dd>
<dt id="Fixed-blinker-related-to-large--ci-short-line-length-and--bbsbi-2--bbsb-1"><b>Fixed blinker related to large -ci, short line length and -bbsbi=2 -bbsb=1</b></dt>
<dd>

<p>A blinking state was discovered in testing between the following two states</p>

<pre><code>    my$table=
         [[1,2,3],[2,4,6],[3,6,9],
         ];

    my$table=
        [[1,2,3],[2,4,6],[3,6,9],];</code></pre>

<p>with these parameters</p>

<pre><code>    --continuation-indentation=5
    --maximum-line-length=31
    --break-before-square-bracket-and-indent=2
    --break-before-square-bracket=1
    --noadd-whitespace</code></pre>

<p>The problem was found to be caused by the -bbsb parameters causing the indentation level of the first square bracket to change depending upon whether the term was broken on input or not. Two fixes would correct this. One is to turn off the option if the -ci=n value exceeds the -i=n value. The other is to require a broken container to span at least three lines before turning this option on. The latter option was made to sub &#39;adjust_container_indentation&#39;. With this change the snippet remains stable at the second state above. Fixed 14 Jan 2021, 5c793a1.</p>

</dd>
<dt id="Fixed-blinker-related-to-large--ci-short-line-length-and--wn"><b>Fixed blinker related to large -ci, short line length and -wn</b></dt>
<dd>

<p>In random testing with convergence a &#39;blinker&#39; (oscillating states) was found for the following script</p>

<pre><code>    sub _prompt {

          print $_[0];
          return (
                readline
                       (*{$_[1]})!~
                       /^q/i)
                 ; # Return false if user types &#39;q&#39;

    }</code></pre>

<p>with the following specific parameters:</p>

<pre><code>    --maximum-line-length=32
    --indent-columns=6
    --continuation-indentation=7
    --weld-nested-containers
    --extended-continuation-indentation
    --noadd-whitespace</code></pre>

<p>The other state was</p>

<pre><code>    sub _prompt {

          print $_[0];
          return (
                readline(
                      *{
                            $_
                                   [
                                   1
                                   ]
                      }
                )!~/^q/i
                 )
                 ; # Return false if user types &#39;q&#39;

    }</code></pre>

<p>All of the listed parameters are required to cause this, but the main cause is the very large continuation indentation and short line length. Welding was being turned on and off in this case. Normally welding is not done if all containers are on a single line, but an exception was made to detect a situation like this and keep the welded string together. Updated 13 Jan 2021, 5c793a1.</p>

</dd>
<dt id="Fixed-incorrect-guess-of-division-vs-pattern"><b>Fixed incorrect guess of division vs pattern</b></dt>
<dd>

<p>A syntax error was produced in random testing when perltidy was fed the following line:</p>

<pre><code>    sub _DR () { pi2 /360 } sub _RD () { 360 /pi2 }</code></pre>

<p>The bareword &#39;pi2&#39; was not recognized and the text between the two slashes was a taken as a possible pattern argument in a parenless call to pi2. Two fixes were made to fix this. Perltidy looks for &#39;pi&#39; but not &#39;pi2&#39;, so the first fix was to expand its table to include all variations of &#39;pi&#39; in Trig.pm. Second, the fact that the first slash was followed by a number should have tipped the guess to favor division, so this was fixed. As it was, a backup spacing rule was used, which favored a pattern.</p>

<p>The formatted result is now</p>

<pre><code>    sub _DR () { pi2 / 360 }
    sub _RD () { 360 / pi2 }</code></pre>

<p>This update was made 13 Jan 2021, a50ecf8.</p>

</dd>
<dt id="Correct-formula-for-estimating-line-length-with--wn-option"><b>Correct formula for estimating line length with -wn option</b></dt>
<dd>

<p>A formula used to estimating maximum line length when the -wn option is set was missing a term for continuation indentation. No actual changes in formatting have been seen. This update made 12 Jan 2021.</p>

</dd>
<dt id="Fixed-unusual-blinker-related-to-large--ci-and--mft-n"><b>Fixed unusual blinker related to large -ci and -mft=n</b></dt>
<dd>

<p>The following blinker was found in random testing. The following statement (with @j starting at level 0)</p>

<pre><code>    @j = ( $x, $y, $z );</code></pre>

<p>run with the following parameters</p>

<pre><code>    --indent-columns=5
    --continuation-indentation=7
    --maximum-line-length=20
    --break-before-paren-and-indent=2
    --break-before-paren=2
    --maximum-fields-per-table=4</code></pre>

<p>caused an oscillation between two states. An unusual feature which contributed to the problem is the very large ci value. This is fixed in a patch made 12 Jan 2021, 9a97dba.</p>

</dd>
</dl>

<h1 id="Issues-fixed-after-release-20201207">Issues fixed after release 20201207</h1>

<dl>

<dt id="Improve-indentation-of-multiline-qw-quotes-when--xci-flag-is-set"><b>Improve indentation of multiline qw quotes when -xci flag is set</b></dt>
<dd>

<p>The indentation of multiline qw quotes runs into problems when there is nesting, as in the following.</p>

<pre><code>    # OLD: perltidy -xci -ci=4
    for my $feep (
        qw{
        pwage      pwchange   pwclass    pwcomment
        pwexpire   pwgecos    pwpasswd   pwquota
        }
        )</code></pre>

<p>The problem is that multiline qw quotes do not get the same indentation treatment as lists.</p>

<p>This update fixes this in the following circumstances:</p>

<pre><code>  - the leading qw( and trailing ) are on separate lines
  - the closing token is one of ) } ] &gt;
  - the -xci flag is set</code></pre>

<p>The above example becomes</p>

<pre><code>    # NEW: perltidy -xci -ci=4
    for my $feep (
        qw{
            pwage      pwchange   pwclass    pwcomment
            pwexpire   pwgecos    pwpasswd   pwquota
        }
        )</code></pre>

<p>The reason that the -xci flag is required is to minimize unexpected changes to existing scripts. The extra indentation is removed if the -wn flag is also given, so both old and new versions with -wn give</p>

<pre><code>    # OLD and NEW: perltidy -wn -xci -ci=4
    for my $feep ( qw{
        pwage      pwchange   pwclass    pwcomment
        pwexpire   pwgecos    pwpasswd   pwquota
    } )</code></pre>

<p>This update added 8 Jan 2021, 474cfa8.</p>

</dd>
<dt id="Improve-alignment-of-leading-equals-in-rare-situation"><b>Improve alignment of leading equals in rare situation</b></dt>
<dd>

<p>A rare case in which a vertical alignment opportunity of leading equals was missed has been fixed. This involved lines with additional varying alignment tokens, such as &#39;unless&#39; and second &#39;=&#39; in lines 1-3 below. In this example lines 4 and 5 were not &#39;looking&#39; backwards to align their leading equals.</p>

<pre><code>    # OLD:
    $them = &#39;localhost&#39; unless ( $them = shift );
    $cmd  = &#39;!print&#39;    unless ( $cmd  = shift );
    $port = 2345        unless ( $port = shift );
    $saddr = &#39;S n a4 x8&#39;;
    $SIG{&#39;INT&#39;} = &#39;dokill&#39;;

    # NEW
    $them       = &#39;localhost&#39; unless ( $them = shift );
    $cmd        = &#39;!print&#39;    unless ( $cmd  = shift );
    $port       = 2345        unless ( $port = shift );
    $saddr      = &#39;S n a4 x8&#39;;
    $SIG{&#39;INT&#39;} = &#39;dokill&#39;;</code></pre>

<p>Fixed 5 Jan 2021, 9244678.</p>

</dd>
<dt id="Moved-previous-patch-to-a-better-location"><b>Moved previous patch to a better location</b></dt>
<dd>

<p>The previous patch was moved to a location where it only applies if there is a side comment on the line with a closing token. This minimizes changes to other side comment locations.</p>

</dd>
<dt id="Further-improvement-in-rules-for-forgetting-last-side-comment-location"><b>Further improvement in rules for forgetting last side comment location</b></dt>
<dd>

<p>The code for forgetting the last side comment location was rewritten to improve formatting in some edge cases. The update also fixes a very rare problem discovered during testing and illustrated with the following snippet. The problem occurs for the particular combination of parameters -sct -act=2 and when a closing paren has a side comment:</p>

<pre><code>    OLD: perltidy -sct -act=2
    foreach $line (
        [0, 1, 2], [3, 4, 5], [6, 7, 8],    # rows
        [0, 3, 6], [1, 4, 7], [2, 5, 8],    # columns
        [0, 4, 8], [2, 4, 6])                                     # diagonals

    NEW: perltidy -sct -act=2
    foreach $line (
        [0, 1, 2], [3, 4, 5], [6, 7, 8],    # rows
        [0, 3, 6], [1, 4, 7], [2, 5, 8],    # columns
        [0, 4, 8], [2, 4, 6])    # diagonals</code></pre>

<p>In the old version the last side comment was aligned before the closing paren was attached to the previous line, causing the final side comment to be far to the right. A patch in the new version just places it at the default location. This is the best than can be done for now, but is preferable to the old formatting. 3 Jan 2021, e57d8db.</p>

</dd>
<dt id="Improve-rule-for-forgetting-last-side-comment-location"><b>Improve rule for forgetting last side comment location</b></dt>
<dd>

<p>The code which aligns side comments remembers the most recent side comment and in some cases tries to start aligning at that column for later side comments. Sometimes the old side comment column was being remembered too long, causing occasional poor formatting and causing a noticeable and unexpected drift of side comment locations to the right. The rule for forgetting the previous side comment column has been modified to reduce this problem. The new rule is essentially to forget the previous side comment location at a new side comment with different indentation level or significant number of lines without side comments (about 12). The previous implementation forgetting changes in indentation level across code blocks only. Below is an example where the old method gets into trouble and the new method is ok:</p>

<pre><code>        # OLD:
        foreach my $r (@$array) {
            $Dat{Data}{ uc $r-&gt;[0] } = join( &quot;;&quot;, @$r );    # store all info
            my $name = $Dat{GivenName}{ uc $r-&gt;[0] } || $r-&gt;[1];

            # pass array as ad-hoc string, mark missing values
            $Dat{Data}{ uc $r-&gt;[0] } = join(
                &quot;;&quot;,
                (
                    uc $r-&gt;[0], uc $name,                   # symbol, name
                    $r-&gt;[2],    $r-&gt;[3], $r-&gt;[4],           # price, date, time
                    $r-&gt;[5],    $r-&gt;[6],                    # change, %change
                    $r-&gt;[7],    &quot;-&quot;, &quot;-&quot;, &quot;-&quot;,    # vol, avg vol, bid,ask
                    $r-&gt;[8],               $r-&gt;[9],     # previous, open
                    &quot;$r-&gt;[10] - $r-&gt;[11]&quot;, $r-&gt;[12],    # day range,year range,
                    &quot;-&quot;,                   &quot;-&quot;, &quot;-&quot;, &quot;-&quot;, &quot;-&quot;
                )
            );                                          # eps,p/e,div,yld,cap
        }</code></pre>

<p>The second side comment is at a deeper indentation level but was not being forgotten, causing line length limits to interfere with later alignment. The new rule gives a better result:</p>

<pre><code>        # NEW:
        foreach my $r (@$array) {
            $Dat{Data}{ uc $r-&gt;[0] } = join( &quot;;&quot;, @$r );    # store all info
            my $name = $Dat{GivenName}{ uc $r-&gt;[0] } || $r-&gt;[1];

            # pass array as ad-hoc string, mark missing values
            $Dat{Data}{ uc $r-&gt;[0] } = join(
                &quot;;&quot;,
                (
                    uc $r-&gt;[0], uc $name,               # symbol, name
                    $r-&gt;[2],    $r-&gt;[3], $r-&gt;[4],       # price, date, time
                    $r-&gt;[5],    $r-&gt;[6],                # change, %change
                    $r-&gt;[7],    &quot;-&quot;, &quot;-&quot;, &quot;-&quot;,          # vol, avg vol, bid,ask
                    $r-&gt;[8],               $r-&gt;[9],     # previous, open
                    &quot;$r-&gt;[10] - $r-&gt;[11]&quot;, $r-&gt;[12],    # day range,year range,
                    &quot;-&quot;,                   &quot;-&quot;, &quot;-&quot;, &quot;-&quot;, &quot;-&quot;
                )
            );    # eps,p/e,div,yld,cap
        }</code></pre>

<p>The following exampel shows an unexpected alignment in the cascade of trailing comments which are aligned but slowly separating from their closing containers:</p>

<pre><code>    # OLD:
    {
        $a = [
            Cascade    =&gt; $menu_cb,
            -menuitems =&gt; [
                [ Checkbutton =&gt; &#39;Oil checked&#39;, -variable =&gt; \$OIL ],
                [
                    Button   =&gt; &#39;See current values&#39;,
                    -command =&gt; [
                        \&amp;see_vars, $TOP,

                    ],    # end see_vars
                ],        # end button
            ],            # end checkbutton menuitems
        ];                # end checkbuttons cascade
    }</code></pre>

<p>This was caused by forgetting side comments only across code block changes. The new result is more reasonable:</p>

<pre><code>    # NEW:
    {
        $a = [
            Cascade    =&gt; $menu_cb,
            -menuitems =&gt; [
                [ Checkbutton =&gt; &#39;Oil checked&#39;, -variable =&gt; \$OIL ],
                [
                    Button   =&gt; &#39;See current values&#39;,
                    -command =&gt; [
                        \&amp;see_vars, $TOP,

                    ],    # end see_vars
                ],    # end button
            ],    # end checkbutton menuitems
        ];    # end checkbuttons cascade
    }</code></pre>

<p>This change will cause occasional differences in side comment locations from previous versions but overall it gives fewer unexpected results so it is a worthwhile change. 29-Dec-2020, 76993f4.</p>

</dd>
<dt id="Fixed-very-minor-inconsistency-in-redefining-lists-after-prune-step"><b>Fixed very minor inconsistency in redefining lists after prune step</b></dt>
<dd>

<p>In rare cases it is necessary to update the type of lists, and this influences vertical alignment. This update fixes a minor inconsistency in doing this. In some rare cases with complex list elements vertical alignment can be improved. 27 Dec, 2020, 751faec.</p>

<pre><code>            # OLD
            return join( &#39;&#39;,
                $pre,   &#39;&lt;IMG &#39;,   $iconsizes{$alt} || &#39;&#39;,
                $align, &#39;BORDER=&#39;, $nav_border,
                &#39; ALT=&quot;&#39;, $alt,        &quot;\&quot;\n&quot;,
                &#39; SRC=&quot;&#39;, $ICONSERVER, &quot;/$icon&quot;,
                &#39;&quot;&gt;&#39; );

            # NEW
            return join( &#39;&#39;,
                $pre,     &#39;&lt;IMG &#39;,     $iconsizes{$alt} || &#39;&#39;,
                $align,   &#39;BORDER=&#39;,   $nav_border,
                &#39; ALT=&quot;&#39;, $alt,        &quot;\&quot;\n&quot;,
                &#39; SRC=&quot;&#39;, $ICONSERVER, &quot;/$icon&quot;,
                &#39;&quot;&gt;&#39; );</code></pre>

</dd>
<dt id="Improved-vertical-alignment-of-some-edge-cases"><b>Improved vertical alignment of some edge cases</b></dt>
<dd>

<p>The existing rules for aligning two lines with very different lengths were rejecting some good alignments, such as the first line of numbers in the example below:</p>

<pre><code>    # OLD:
    @gg_3 = (
        [
            0.0, 1.360755E-2, 9.569446E-4, 9.569446E-4,
            1.043498E-3, 1.043498E-3
        ],
        [
            9.569446E-4, 9.569446E-4, 0.0, 7.065964E-5,
            1.422811E-4, 1.422811E-4
        ],
        ...
    );

    # NEW:
    @gg_3 = (
        [
            0.0,         1.360755E-2, 9.569446E-4, 9.569446E-4,
            1.043498E-3, 1.043498E-3
        ],
        [
            9.569446E-4, 9.569446E-4, 0.0, 7.065964E-5,
            1.422811E-4, 1.422811E-4
        ],
        ...
    );</code></pre>

<p>The rule in sub &#39;two_line_pad&#39; was updated to allow alignment of any lists if the patterns match exactly (all numbers in this case). Updated 27-Dec-2020, 035d2b7.</p>

</dd>
<dt id="Avoid--lp-style-formatting-of-lists-containing-multiline-qw-quotes"><b>Avoid -lp style formatting of lists containing multiline qw quotes</b></dt>
<dd>

<p>The -lp formatting style often does not work well when lists contain multiline qw quotes. This update avoids this problem by not formatting such lists with the -lp style. For example,</p>

<pre><code>    # OLD, perltidy -gnu
    @EXPORT = (
        qw(
          i Re Im rho theta arg
          sqrt log ln
          log10 logn cbrt root
          cplx cplxe
          ),
        @trig,
              );


    # NEW, perltidy -gnu
    @EXPORT = (
        qw(
          i Re Im rho theta arg
          sqrt log ln
          log10 logn cbrt root
          cplx cplxe
        ),
        @trig,
    );</code></pre>

<p>27-Dec-2020, 948c9bd.</p>

</dd>
<dt id="improve-formatting-of-multiline-qw"><b>improve formatting of multiline qw</b></dt>
<dd>

<p>This update adds a sequence numbering system for multiline qw quotes. In the perltidy tokenizer normal container pair types, like { }, (), [], are given unique serial numbers which are used as keys to data structures. qw quoted lists do not get serial numbers by the tokenizer, so this update creates a separate serial number scheme for them to correct this problem. One formatting problem that this solves is that of preventing the closing token of a multiline quote from being outdented more than the opening token. This is a general formatting rule which should be followed. Without a sequence number, the closing qw token could not lookup its corresponding opening indentation so it had to resort to a default, breaking the rule, as in the following:</p>

<pre><code>    # OLD, perltidy -wn
    # qw line
    if ( $pos == 0 ) {
        @return = grep( /^$word/,
            sort qw(
              ! a b d h i m o q r u autobundle clean
              make test install force reload look
        ) ); #&lt;-- outdented more than &#39;sort&#39;
    }

    # Here is the same with a list instead of a qw; note how the
    # closing sort paren does not outdent more than the &#39;sort&#39; line.
    # This is the desired result for qw.
    # perltidy -wn
    if ( $pos == 0 ) {
        @return = grep( /^$word/,
            sort (

                &#39;!&#39;,          &#39;a&#39;, &#39;b&#39;, &#39;d&#39;, &#39;h&#39;, &#39;i&#39;, &#39;m&#39;, &#39;o&#39;, &#39;q&#39;, &#39;r&#39;, &#39;u&#39;,
                &#39;autobundle&#39;, &#39;clean&#39;,
                &#39;make&#39;,       &#39;test&#39;, &#39;install&#39;, &#39;force&#39;, &#39;reload&#39;, &#39;look&#39;
            ) );  #&lt;-- not outdented more than &#39;sort&#39;
    }

    # NEW (perltidy -wn)
    if ( $pos == 0 ) {
        @return = grep( /^$word/,
            sort qw(
              ! a b d h i m o q r u autobundle clean
              make test install force reload look
            ) ); #&lt;-- not outdented more than sort
    }</code></pre>

<p>Here is another example # OLD: $_-&gt;meta-&gt;make_immutable( inline_constructor =&gt; 0, constructor_name =&gt; &quot;_new&quot;, inline_accessors =&gt; 0, ) for qw( Class::XYZ::Package Class::XYZ::Module Class::XYZ::Class</p>

<pre><code>        Class::XYZ::Overload
    );  #&lt;-- outdented more than the line with &#39;for qw(&#39;

    # NEW:
    $_-&gt;meta-&gt;make_immutable(
        inline_constructor =&gt; 0,
        constructor_name   =&gt; &quot;_new&quot;,
        inline_accessors   =&gt; 0,
      )
      for qw(
      Class::XYZ::Package
      Class::XYZ::Module
      Class::XYZ::Class

      Class::XYZ::Overload
      ); #&lt;-- outdented same as the line with &#39;for qw(&#39;</code></pre>

<p>26 Dec 2020, cdbf0e4.</p>

</dd>
<dt id="improve-list-marking-method"><b>improve list marking method</b></dt>
<dd>

<p>In the process of making vertical alignments, lines which are simple lists of items are treated different from other lines. The old method for finding and marking these lines had a few problems which are corrected with this update. The main problem was that the old method ran into trouble when there were side comments. For example, the old method was not marking the following list and as a result the two columns of values were not aligned:</p>

<pre><code>    # OLD
    return (
        $startpos, $ldelpos - $startpos,         # PREFIX
        $ldelpos,  1,                            # OPENING BRACKET
        $ldelpos + 1, $endpos - $ldelpos - 2,    # CONTENTS
        $endpos - 1, 1,                          # CLOSING BRACKET
        $endpos, length($$textref) - $endpos,    # REMAINDER
    );

    # NEW
    return (
        $startpos,    $ldelpos - $startpos,           # PREFIX
        $ldelpos,     1,                              # OPENING BRACKET
        $ldelpos + 1, $endpos - $ldelpos - 2,         # CONTENTS
        $endpos - 1,  1,                              # CLOSING BRACKET
        $endpos,      length($$textref) - $endpos,    # REMAINDER
    );</code></pre>

<p>Another problem was that occasionally unwanted alignments were made between lines which were not really lists because the lines were incorrectly marked. For example (note padding after first comma)</p>

<pre><code>    # OLD: (undesirable alignment)
    my ( $isig2, $chisq ) = ( 1 / ( $sig * $sig ), 0 );
    my ( $ym,    $al, $cov, $bet, $olda, $ochisq, $di, $pivt, $info ) =
      map { null } ( 0 .. 8 );

    # NEW: (no alignment)
    my ( $isig2, $chisq ) = ( 1 / ( $sig * $sig ), 0 );
    my ( $ym, $al, $cov, $bet, $olda, $ochisq, $di, $pivt, $info ) =
      map { null } ( 0 .. 8 );</code></pre>

<p>This update was made 22 Dec 2020, 36d4c35.</p>

</dd>
<dt id="Fix-git-51-closing-quote-pattern-delimiters-not-following--cti-flag-settings"><b>Fix git #51, closing quote pattern delimiters not following -cti flag settings</b></dt>
<dd>

<p>Closing pattern delimiter tokens of qw quotes were not following the -cti flag settings for containers in all cases, as would be expected, in particular when followed by a comma. For example, the closing qw paren below was indented with continuation indentation but would not have that extra indentation if it followed the default -cpi setting for a paren:</p>

<pre><code>    # OLD:
    @EXPORT = (
        qw(
          i Re Im rho theta arg
          sqrt log ln
          log10 logn cbrt root
          cplx cplxe
          ),
        @trig
    );

    # NEW
    @EXPORT = (
        qw(
            i Re Im rho theta arg
            sqrt log ln
            log10 logn cbrt root
            cplx cplxe
        ),
        @trig
    );</code></pre>

<p>This update makes closing qw quote terminators follow the settings for their corresponding container tokens as closely as possible. For a closing &#39;&gt;&#39; the setting for a closing paren will now be followed. Other closing qw terminators will remain indented, to minimize changes to existing formatting. For example (&#39;&gt;&#39; is outdented):</p>

<pre><code>    @EXPORT = (
        qw&lt;
          i Re Im rho theta arg
          sqrt log ln
          log10 logn cbrt root
          cplx cplxe
        &gt;,
        @trig
    );</code></pre>

<p>but (&#39;;&#39; remains indented):</p>

<pre><code>    @EXPORT = (
        qw;
          i Re Im rho theta arg
          sqrt log ln
          log10 logn cbrt root
          cplx cplxe
          ;,
        @trig
    );</code></pre>

<p>This update was added 18 Dec 2020 and modified 24 Dec 2020, 538688f.</p>

</dd>
<dt id="Update-manual-pages-regarding-issue-git-50"><b>Update manual pages regarding issue git #50</b></dt>
<dd>

<p>Additional wording was added to the man pages regarding situations in which perltidy does not change whitespace. This update was added 17 Dec 2020.</p>

</dd>
<dt id="Rewrote-sub-check_match"><b>Rewrote sub check_match</b></dt>
<dd>

<p>Moved inner part of sub check_match into sub match_line_pair in order to make info available earlier. This gave some minor alignment improvements. This was done 16 Dec 2020, 7ba4f3b.</p>

<pre><code>    # OLD:
    @tests = (
        @common,     &#39;$_&#39;,
        &#39;&quot;\$_&quot;&#39;,     &#39;@_&#39;,
        &#39;&quot;\@_&quot;&#39;,     &#39;??N&#39;,
        &#39;&quot;??N&quot;&#39;,     chr 256,
        &#39;&quot;\x{100}&quot;&#39;, chr 65536,
        &#39;&quot;\x{10000}&quot;&#39;, ord &#39;N&#39; == 78 ? ( chr 11, &#39;&quot;\013&quot;&#39; ) : ()
    );

    # NEW:
    @tests = (
        @common,       &#39;$_&#39;,
        &#39;&quot;\$_&quot;&#39;,       &#39;@_&#39;,
        &#39;&quot;\@_&quot;&#39;,       &#39;??N&#39;,
        &#39;&quot;??N&quot;&#39;,       chr 256,
        &#39;&quot;\x{100}&quot;&#39;,   chr 65536,
        &#39;&quot;\x{10000}&quot;&#39;, ord &#39;N&#39; == 78 ? ( chr 11, &#39;&quot;\013&quot;&#39; ) : ()
    );</code></pre>

</dd>
<dt id="Improved-vertical-alignments-by-avoiding-pruning-step"><b>Improved vertical alignments by avoiding pruning step</b></dt>
<dd>

<p>There is a step in vertical alignment where the alignments are formed into a tree with different levels, and some deeper levels are pruned to preserve lower level alignments. This usually works well, but some deeper alignments will be lost, which is what was happening in the example below. It turns out that if the tree pruning is skipped when alignment depths increase monotonically across lines, as in the example, then better overall alignment is achieved by the subsequent &#39;sweep&#39; pass.</p>

<pre><code>    # OLD
    my $cmd = shift @ARGV;
    if    ( $cmd eq &quot;new&quot; )         { $force_new = 1; }
    elsif ( $cmd eq &quot;interactive&quot; ) { $interactive = 1; $batch       = 0; }
    elsif ( $cmd eq &quot;batch&quot; )       { $batch       = 1; $interactive = 0; }
    elsif ( $cmd eq &quot;use_old&quot; )     { $use_old = 1; }
    elsif ( $cmd eq &quot;show&quot; )        { $show    = 1; last; }
    elsif ( $cmd eq &quot;showall&quot; )     { $showall = 1; last; }
    elsif ( $cmd eq &quot;show_all&quot; )    { $showall = 1; last; }
    elsif ( $cmd eq &quot;remove&quot; )      { $remove  = 1; last; }
    elsif ( $cmd eq &quot;help&quot; )        { $help    = 1; last; }

    # NEW
    my $cmd = shift @ARGV;
    if    ( $cmd eq &quot;new&quot; )         { $force_new   = 1; }
    elsif ( $cmd eq &quot;interactive&quot; ) { $interactive = 1; $batch       = 0; }
    elsif ( $cmd eq &quot;batch&quot; )       { $batch       = 1; $interactive = 0; }
    elsif ( $cmd eq &quot;use_old&quot; )     { $use_old     = 1; }
    elsif ( $cmd eq &quot;show&quot; )        { $show        = 1; last; }
    elsif ( $cmd eq &quot;showall&quot; )     { $showall     = 1; last; }
    elsif ( $cmd eq &quot;show_all&quot; )    { $showall     = 1; last; }
    elsif ( $cmd eq &quot;remove&quot; )      { $remove      = 1; last; }
    elsif ( $cmd eq &quot;help&quot; )        { $help        = 1; last; }</code></pre>

<p>This update was made 14 Dec 2020, 44e0afa.</p>

</dd>
<dt id="Improved-some-marginal-vertical-alignments"><b>Improved some marginal vertical alignments</b></dt>
<dd>

<p>This update fixed a rare situation in which some vertical alignment was missed. The problem had to do with two lines being incorrectly marked as a marginal match. A new routine, &#39;match_line_pairs&#39; was added to set a flag with the information needed to detect and prevent this. This fix was made 13 Dec 2020, 9a8e49b.</p>

<pre><code>    # OLD
    $sec = $sec + ( 60 * $min );
    $graphcpu[$sec] = $line;
    $secmax  = $sec  if ( $sec &gt; $secmax );
    $linemax = $line if ( $line &gt; $linemax );

    # NEW
    $sec            = $sec + ( 60 * $min );
    $graphcpu[$sec] = $line;
    $secmax         = $sec  if ( $sec &gt; $secmax );
    $linemax        = $line if ( $line &gt; $linemax );</code></pre>

</dd>
<dt id="Do-not-align-equals-across-changes-in-continuation-indentation"><b>Do not align equals across changes in continuation indentation</b></dt>
<dd>

<p>A rule was added to prevent vertical alignment of lines with leading &#39;=&#39; across a change in continuation indentation. Sometimes aligning across a change in CI can come out okay, but sometimes it can be very poor. For example:</p>

<pre><code>    # BAD:
    $!               = 2, die qq/$0: can&#39;t stat -${arg}&#39;s &quot;$file&quot;./
        unless $time = ( stat($file) )[$STAT_MTIME];

    # FIXED:
    $! = 2, die qq/$0: can&#39;t stat -${arg}&#39;s &quot;$file&quot;./
      unless $time = ( stat($file) )[$STAT_MTIME];</code></pre>

<p>The second line is a continuation of the first, and this update prevents this alignment. The above &#39;BAD&#39; formatting was in the previous developmental version of perltidy, not the previous release. This update added 12 Dec 2020, 5b56147.</p>

</dd>
<dt id="Improve-vertical-alignment-in-some-two-line-matches"><b>Improve vertical alignment in some two-line matches</b></dt>
<dd>

<p>When two lines would be perfectly aligned except for the line length limit, previously they would only be aligned if they had a common leading equals. The update removes this restriction and allows as many alignments to be made as possible. The results are generally improved. This update was made 11 Dec 2020, f3c6cd8. Some examples:</p>

<p># In this example the side comments were limiting the matches</p>

<pre><code>    # OLD
    shift @data if @data and $data[0] =~ /Contributed\s+Perl/;    # Skip header
    pop @data if @data and $data[-1] =~ /^\w/;    # Skip footer, like

    # NEW
    shift @data if @data and $data[0]  =~ /Contributed\s+Perl/;    # Skip header
    pop @data   if @data and $data[-1] =~ /^\w/;    # Skip footer, like</code></pre>

<p># The same is true here.</p>

<pre><code>    # OLD
    if ($tvg::o_span) { $tvg::hour_span = $tvg::o_span; }
    if ( $tvg::hour_span % 2 &gt; 0 ) { $tvg::hour_span++; }    # Multiple of 2

    # NEW
    if ($tvg::o_span)              { $tvg::hour_span = $tvg::o_span; }
    if ( $tvg::hour_span % 2 &gt; 0 ) { $tvg::hour_span++; }    # Multiple of 2</code></pre>

<p>In the next example, the first comma is now aligned but not the second, because of the line length limit:</p>

<pre><code>    # OLD
    is( MyClass-&gt;meta, $mc, &#39;... these metas are still the same thing&#39; );
    is( MyClass-&gt;meta-&gt;meta, $mc-&gt;meta, &#39;... these meta-metas are the same thing&#39; );

    # NEW
    is( MyClass-&gt;meta,       $mc, &#39;... these metas are still the same thing&#39; );
    is( MyClass-&gt;meta-&gt;meta, $mc-&gt;meta, &#39;... these meta-metas are the same thing&#39; );</code></pre>

<p>In this last example, the first comma is not aligned, but alignment resumes after the second comma.</p>

<pre><code>    # OLD
    is( $obj-&gt;name, $COMPRESS_FILE, &quot;   Name now set to &#39;$COMPRESS_FILE&#39;&quot; );
    is( $obj-&gt;prefix, &#39;&#39;, &quot;   Prefix now empty&quot; );

    # NEW
    is( $obj-&gt;name, $COMPRESS_FILE, &quot;   Name now set to &#39;$COMPRESS_FILE&#39;&quot; );
    is( $obj-&gt;prefix, &#39;&#39;,           &quot;   Prefix now empty&quot; );</code></pre>

</dd>
<dt id="Improve-vertical-alignment-in-some-marginal-matches"><b>Improve vertical alignment in some marginal matches</b></dt>
<dd>

<p>In perltidy a &#39;marginal match&#39; occurs for example when two lines share some alignment tokens but are somewhat different. When this happens some limits are placed on the size of the padding spaces that can be introduced. In this update the amount of allowed padding is significantly increased for certain &#39;good&#39; alignment tokens. Results of extensive testing were favorable provided that the change is restricted to alignments of &#39;=&#39;, &#39;if&#39; and &#39;unless&#39;. Update made 10 Dec 2020, a585f0b.</p>

<pre><code>    # OLD
    my @roles = $self-&gt;role_names;
    my $role_names = join &quot;|&quot;, @roles;

    # NEW
    my @roles      = $self-&gt;role_names;
    my $role_names = join &quot;|&quot;, @roles;

    # OLD
    $sysname .= &#39;del&#39; if $self-&gt;label =~ /deletion/;
    $sysname .= &#39;ins&#39; if $self-&gt;label =~ /insertion/;
    $sysname .= uc $self-&gt;allele_ori-&gt;seq if $self-&gt;allele_ori-&gt;seq;

    # NEW
    $sysname .= &#39;del&#39;                     if $self-&gt;label =~ /deletion/;
    $sysname .= &#39;ins&#39;                     if $self-&gt;label =~ /insertion/;
    $sysname .= uc $self-&gt;allele_ori-&gt;seq if $self-&gt;allele_ori-&gt;seq;</code></pre>

</dd>
<dt id="Improve-vertical-alignment-of-lines-ending-in-fat-comma"><b>Improve vertical alignment of lines ending in fat comma</b></dt>
<dd>

<p>A minor adjustment was made to the rule for aligning lines which end in &#39;=&gt;&#39;. When there are just two lines in an alignment group, the alignment is avoided if the first of the two ends in a &#39;=&gt;&#39;. Previously, alignment was avoided if either ended in a &#39;=&gt;&#39;. The old rule was preventing some good alignments in a later stage of the iteration. In the following example, the last two lines are processed separately because they do not match the comma in &#39;sprintf&#39;. The new rule allows the fat comma alignment to eventually get made later in the iteration. Update made 9 Dec 2020, ca0ddf4.</p>

<pre><code>    # OLD
    $template-&gt;param(
        classlist =&gt; $classlist,
        ...,
        suggestion =&gt; $suggestion,
        totspent   =&gt; sprintf( &quot;%.2f&quot;, $totspent ),
        totcomtd   =&gt; sprintf( &quot;%.2f&quot;, $totcomtd ),
        totavail   =&gt; sprintf( &quot;%.2f&quot;, $totavail ),
        nobudget =&gt; $#results == -1 ? 1 : 0,
        intranetcolorstylesheet =&gt;
          C4::Context-&gt;preference(&quot;intranetcolorstylesheet&quot;),
        ...
    );

    # NEW
    $template-&gt;param(
        classlist =&gt; $classlist,
        ...,
        suggestion              =&gt; $suggestion,
        totspent                =&gt; sprintf( &quot;%.2f&quot;, $totspent ),
        totcomtd                =&gt; sprintf( &quot;%.2f&quot;, $totcomtd ),
        totavail                =&gt; sprintf( &quot;%.2f&quot;, $totavail ),
        nobudget                =&gt; $#results == -1 ? 1 : 0,
        intranetcolorstylesheet =&gt;
          C4::Context-&gt;preference(&quot;intranetcolorstylesheet&quot;),
        ...
    );</code></pre>

</dd>
<dt id="Avoid-processing-a-file-more-than-once"><b>Avoid processing a file more than once</b></dt>
<dd>

<p>In the unlikely event that a user enters a filename more than once on the command line to perltidy, as for &#39;file1.pl&#39; here</p>

<pre><code>  perltidy file1.pl file1.pl </code></pre>

<p>then that file will be processed more than once. This looks harmless, but if the user was also using the -b (backup) parameter, then the original backup would be overwritten, which is not good. To avoid this, a filter has been placed on the list of files to remove duplicates. 9 Dec 2020, 646a542.</p>

</dd>
<dt id="Fix-for-issue-git-49-exit-status-not-correctly-set"><b>Fix for issue git #49, exit status not correctly set</b></dt>
<dd>

<p>The exit status flag was not being set for the -w option if the -se or if the -q flag were set. Issue git #44 was similar but a special case of the problem. The problem was fixed 8 Dec 2020, cb6028f.</p>

</dd>
</dl>

<h1 id="Issues-fixed-after-release-20201202">Issues fixed after release 20201202</h1>

<dl>

<dt id="Fix-for-issue-git-47"><b>Fix for issue git #47</b></dt>
<dd>

<p>This issue has to do with the --weld-nested-containers option in the specific case of formatting a function which returns a list of anonymous subs. For example</p>

<pre><code>    $promises[$i]-&gt;then(
        sub { $all-&gt;resolve(@_); () },
        sub {
            $results-&gt;[$i] = [@_];
            $all-&gt;reject(@$results) if --$remaining &lt;= 0;
            return ();
        }
    );</code></pre>

<p>A bug introduced in v20201202 caused an incorrect welding to occur when the -wn flag was set</p>

<pre><code>    $promises[$i]-&gt;then( sub { $all-&gt;resolve(@_); () },
        sub {
        $results-&gt;[$i] = [@_];
        $all-&gt;reject(@$results) if --$remaining &lt;= 0;
        return ();
        } );</code></pre>

<p>This bug has been fixed, and code which has been incorrectly formatted will be correctly formatted with the next release. The bug was a result of a new coding introduced in v20201202 for fixing some issues with parsing sub signatures. Previously they were sometimes parsed the same as prototypes and sometimes as lists, now they are always parsed as lists. Fixed 6 Dec 2020, 6fd0c4f.</p>

</dd>
</dl>

<h1 id="Issues-fixed-after-release-20201001">Issues fixed after release 20201001</h1>

<dl>

<dt id="removed-excess-spaces-in-a-package-declaration"><b>removed excess spaces in a package declaration</b></dt>
<dd>

<p>Testing revealed that for a line such as</p>

<pre><code>   package        Bob::Dog;</code></pre>

<p>which has extra spaces or even tabs after the keyword &#39;package&#39;, the extra spaces or tabs were not being removed. This was fixed 28 Nov 2020, 008443d. The line now formats to</p>

<pre><code>    package Bob::Dog;</code></pre>

</dd>
<dt id="do-not-automatically-delete-closing-side-comments-with---indent-only"><b>do not automatically delete closing side comments with --indent-only</b></dt>
<dd>

<p>For the parameter combination --indent-only and --closing-side-comments, old closing side comments were getting deleted but new closing side comments were not made. A fix was made to prevent this deletion. This fix was made 27 Nov 2020, 957e0ca.</p>

</dd>
<dt id="fix-to-stop-at-1-iteration-when-using---indent-only"><b>fix to stop at 1 iteration when using --indent-only</b></dt>
<dd>

<p>Previously, for the combination --indent-only and -conv, two iterations would be done. Only one iteration is necessary in this case. Fix made 23 Nov 2020, ae493d8.</p>

</dd>
<dt id="fix-for-formatting-signed-numbers-with-spaces"><b>fix for formatting signed numbers with spaces</b></dt>
<dd>

<p>In developing an improved convergence test, an issue slowing convergence was found related to signed numbers as in the following line,</p>

<pre><code>    @london = (deg2rad(-  0.5), deg2rad(90 - 51.3));</code></pre>

<p>The leading &#39;-&#39; here is separated from the following number &#39;0.5&#39;. This is handled by tokenizing the minus as type &#39;m&#39; and the number as type &#39;n&#39;. The whitespace between them is removed in formatting, and so the space is gone in the output. But a little problem is that the default rule for placing spaces within the parens is based on the token count, after the first formatting the result is</p>

<pre><code>    @london = ( deg2rad( -0.5 ), deg2rad( 90 - 51.3 ) );</code></pre>

<p>The next time it is formatted, the &#39;-0.5&#39; counts as one token, resulting in</p>

<pre><code>    @london = ( deg2rad(-0.5), deg2rad( 90 - 51.3 ) );</code></pre>

<p>Notice that the space within the parens around the &#39;-0.5&#39; is gone. An update was made to fix this, so that the final state is reached in one step. This fix was made 23 Nov 2020, f477c8b.</p>

</dd>
<dt id="fix-to-prevent-conversion-of-a-block-comment-to-hanging-side-comment"><b>fix to prevent conversion of a block comment to hanging side comment</b></dt>
<dd>

<p>A rare situation was identified during testing in which a block comment could be converted to be a hanging side comment. For example:</p>

<pre><code>    sub macro_get_names {    #
    #
    # %name = macro_get_names();  (key=macrohandle, value=macroname)
    #
        local (%name) = ();
        ...
    }</code></pre>

<p>For the following specific contitions the block comment in line 2 could be converted into a hanging side comment, which is undesirable:</p>

<pre><code>   1. The line contains nothing except for a &#39;#&#39; with no leading space
   2. It follows a line with side comment
   3. It has indentation level &gt; 0</code></pre>

<p>An update was made to prevent this from happening. There are two cases, depending on the value of --maximum-consecutive-blank-lines, or -mbl. If this value is positive (the default) then a blank line is inserted above the block comment to prevent it from becoming a hanging side comment. If this -mbl is zero, then the comment is converted to be a static block comment which again prevents it from becoming a hanging side comment. This fix was made 23 Nov 2020, 2eb3de1.</p>

</dd>
<dt id="improved-convergence-test"><b>improved convergence test</b></dt>
<dd>

<p>A better test for convergence has been added. When iterations are requested, the new test will stop after the first pass if no changes in line break locations are made. Previously, at least two passes were required to verify convergnece unless the output stream had the same checksum as the input stream. Extensive testing has been made to verify the correctness of the new test. This update was made 23 Nov 2020, 29efb63.</p>

</dd>
<dt id="fixed-problem-with-vertical-alignments-involving-if-statements"><b>fixed problem with vertical alignments involving &#39;if&#39; statements</b></dt>
<dd>

<p>An update was made to break vertical alignment when a new sequence of if-like statements or ternary statements is encountered. This situation was causing a loss of alignment in some cases. For example</p>

<pre><code>  OLD:
    $m1 = 0;
    if ( $value =~ /\bset\b/i )      { $m0 = 1; }
    if ( $value =~ /\barithmetic/i ) { $m1 = 1; }
    if    ( $m0 &amp;&amp; !$m1 ) { $CONFIG[1] = 0; }
    elsif ( !$m0 &amp;&amp; $m1 ) { $CONFIG[1] = 1; }
    else                  { $ok        = 0; last; }

 NEW:
    $m1 = 0;
    if    ( $value =~ /\bset\b/i )      { $m0        = 1; }
    if    ( $value =~ /\barithmetic/i ) { $m1        = 1; }
    if    ( $m0 &amp;&amp; !$m1 )               { $CONFIG[1] = 0; }
    elsif ( !$m0 &amp;&amp; $m1 )               { $CONFIG[1] = 1; }
    else                                { $ok        = 0; last; }</code></pre>

<p>This update was made 15 Nov 2020, 2b7784d.</p>

</dd>
<dt id="added-option--wnxl-s-to-give-control-of-welding-by-the--wn-parameter"><b>added option -wnxl=s to give control of welding by the -wn parameter</b></dt>
<dd>

<p>The parameter string can restrict the types of containers which are welded. This was added 11 Nov 2020 in &#39;added -wnxl=s for control of -wn&#39;, 2e642d2.</p>

</dd>
<dt id="merged-pull-request-git-46"><b>merged pull request git #46</b></dt>
<dd>

<p>The man page gave the incorrect string for -fse. This was fixed 11 Nov 2020 in 1f9869e.</p>

</dd>
<dt id="recognize-overloaded-RPerl-operators-to-avoid-error-messages"><b>recognize overloaded RPerl operators to avoid error messages</b></dt>
<dd>

<p>RPerl uses some bareword operators which caused error messages. An update was made to avoid this problem in files containing &#39;use RPerl&#39;. This update was made 6 Nov 2020, f8bd088.</p>

</dd>
<dt id="fix-issue-git-45--wn-and--vtc-n-now-work-together"><b>fix issue git #45, -wn and -vtc=n now work together</b></dt>
<dd>

<p>When -wn was set, the -vtc=n flag was being ignored. This was a simple fix made 5 Nov 2020 in &#39;fix issue git #45, -wn and -vtc=n now work together&#39;, 1fbc381.</p>

</dd>
<dt id="implement-request-RT-133649-added-parameters--kbb-s-and--kba-s"><b>implement request RT #133649, added parameters -kbb=s and -kba=s</b></dt>
<dd>

<p>These parameters request that old breakpoints be kept before or after selected token types. For example, -kbb=&#39;=&gt;&#39; means that newlines before fat commas should be kept. This was added 4 Nov 2020.</p>

</dd>
<dt id="added-parameters--maxue-n-and-maxle-n"><b>added parameters -maxue=n and maxle=n</b></dt>
<dd>

<p>These parameters had tentatively been hardwired in the tokenizer. Now the user can control them or turn the checks off altogether.</p>

</dd>
<dt id="Fix-problem-parsing"><b>Fix problem parsing &#39;$$*&#39;</b></dt>
<dd>

<p>In random testing, an error was encountered parsing the following line</p>

<pre><code>  $self-&gt;{&quot;mod_id&quot;}=($$*1001)%(10**(rand()*6));
                       ---^
  found Number where operator expected (previous token underlined)</code></pre>

<p>The line parsed correctly with a space between the &#39;$$&#39; and the &#39;*&#39;. The problem had to do with an error in some newer code for postfix dereferencing, and this was fixed on 2 Nov 2020, &#39;fix problem scanning &#39;$$&#39;; revise call to operator_expected&#39;, 49d993b.</p>

</dd>
<dt id="Update-for-git-44-fix-exit-status-for-assert-tidy-untidy"><b>Update for git #44, fix exit status for assert-tidy/untidy</b></dt>
<dd>

<p>The exit status was always 0 for --assert-tidy if the user had turned off error messages with -quiet. This was fixed by gluesys/master in &#39;fix exit status for assert-tidy/untidy options&#39;, 625d250.</p>

</dd>
<dt id="Fixed-problem-parsing-extruded-signature"><b>Fixed problem parsing extruded signature</b></dt>
<dd>

<p>A parsing error was encountered in a test parsing the following extruded signature:</p>

<pre><code>  sub foo2
  (
  $
  first
  ,
  $
  ,
  $
  third
  )
  {
  return
  &quot;first=$first, third=$third&quot;
  ;
  }</code></pre>

<p>The second &#39;$&#39; combined with the &#39;,&#39; on the next line to form a punctuation variable. This was fixed 20 Oct 2020 in &#39;fixed problem parsing extruded signature&#39;, 9b454f6.</p>

<p>The file parses correctly now, with formatted output</p>

<pre><code>  sub foo2 ( $first, $, $third ) {
      return &quot;first=$first, third=$third&quot;;
  }</code></pre>

</dd>
<dt id="Fixed-several-uses-of-undefined-variables-found-in-testing"><b>Fixed several uses of undefined variables found in testing</b></dt>
<dd>

<p>Several instances of incorrect array indexing were found in testing and fixed. These each involved incorrectly indexing with index -1. They were found by placing undefs at the end of arrays. None of these was causing incorrect formatting. They were fixed 26 Oct 2020 in &#39;fixed several instances of incorrect array indexing&#39;, c60f694.</p>

</dd>
<dt id="Prevent-syntax-error-by-breaking-dashed-package-names"><b>Prevent syntax error by breaking dashed package names</b></dt>
<dd>

<p>In stress testing perltidy with the -extrude option, the following test snippet</p>

<pre><code>  use perl6-alpha;</code></pre>

<p>was broken into sepate lines</p>

<pre><code>  use
  perl6
  -
  alpha
  ;</code></pre>

<p>A rule was added to prevent breaking around a dash separating two barewords. Rerunning gives</p>

<pre><code>  use
  perl6-alpha
  ;</code></pre>

<p>This was fixed 26 Oct 2020 in &#39;prevent breaking package names with trailing dashes&#39;, 9234be4.</p>

</dd>
<dt id="Prevent-syntax-error-by-breaking-dashed-barewords"><b>Prevent syntax error by breaking dashed barewords</b></dt>
<dd>

<p>In stress testing perltidy with the -extrude option, using the following test snippet</p>

<pre><code>  my %var;
  {
      $var{-y}  = 1;
      $var{-q}  = 1;
      $var{-qq} = 1;
      $var{-m}  = 1;
      $var{y}   = 1;
      $var{q}   = 1;
      $var{qq}  = 1;
      $var{m}   = 1;
  }</code></pre>

<p>a syntax error was created when newlines were placed before or after the dashes. It is necessary to always keep a dash on the same line with its surrounding tokens. A rule was added to do this. The new &#39;extruded&#39; result for the above snippet is:</p>

<pre><code>  my%var
  ;
  {
  $var{-y}
  =
  1
  ;
  $var{-q}
  =
  1
  ;
  $var{-qq}
  =
  1
  ;
  $var{-m}
  =
  1
  ;
  $var{y}
  =
  1
  ;
  $var{q}
  =
  1
  ;
  $var{qq}
  =
  1
  ;
  $var{m}
  =
  1
  ;
  }</code></pre>

<p>This update was added 26 Oct 2020, &#39;prevent syntax error by breaking dashed barewords&#39;, e121cae.</p>

</dd>
<dt id="more-types-of-severe-errors-will-prevent-formatting"><b>more types of severe errors will prevent formatting</b></dt>
<dd>

<p>Files for which &#39;severe errors&#39; are found have always been output verbatim rather than being formatted. The definition of &#39;severe error&#39; has been expanded to include a final indentation level error greater than 1, more than 2 brace errors, and more than 3 &quot;unexpected token type&quot; parsing errors. The goal is to avoid formatting a non-perl script or a perl script with severe errors. So for example the following snippet has a level error of 2</p>

<pre><code>  {{{{
  }}</code></pre>

<p>was previously output with default parameters as</p>

<pre><code>  { 
      {
          {
              {}
          }</code></pre>

<p>along with an error message. But now it is just output verbatim as</p>

<pre><code>  {{{{
  }}</code></pre>

<p>along with an error message. This update was added 25 Oct 2020, &#39;avoid formatting files with more types of severe errors&#39;, 2a86f51.</p>

</dd>
<dt id="added-state-as-keyword"><b>added &#39;state&#39; as keyword</b></dt>
<dd>

<p>A statement such as the following was generating an error message at the colon:</p>

<pre><code>   state $a : shared;</code></pre>

<p>The problem was that &#39;state&#39; was not in the list of keywords. This has been fixed and the line now parses without error. The &#39;state.t&#39; test file for perl 5.31 now formats without error. This was added 18 Oct 2020 in &quot;add &#39;state&#39; as keyword&quot;, d73e15f.</p>

</dd>
<dt id="sub-signatures-no-longer-parsed-with-prototypes"><b>sub signatures no longer parsed with prototypes</b></dt>
<dd>

<p>Simple signatures (those without commas) were being parsed with code originally written for prototypes. This prevented them from being formatted with the usual formatting rules. This was changed so that all signatures are now formatted with the normal formatting rules. For example:</p>

<pre><code> # Old, input and after formatting:
 sub t123 ($list=wantarray) { $list ? &quot;list&quot; : &quot;scalar&quot; }

 # New, after formatting
 sub t123 ( $list = wantarray ) { $list ? &quot;list&quot; : &quot;scalar&quot; }</code></pre>

<p>Notice that some spaces have been introduced within the signature. Previously the contents of the parens not changed unless the parens contained a list.</p>

<p>This change introduced a problem parsing extended syntax within signatures which has been fixed. In the following snippet, the &#39;:&#39; caused a parsing error which was fixed.</p>

<pre><code>  # perltidy -sal=&#39;method&#39;
  method foo4 ( $class : $bar, $bubba ) { $class-&gt;bar($bar) }</code></pre>

<p>The &#39;:&#39; here is given a type of &#39;A&#39;. This may be used to change the spacing around it. For example:</p>

<pre><code>  # perltidy -sal=&#39;method&#39; -nwls=&#39;A&#39;
  method foo4 ( $class: $bar, $bubba ) { $class-&gt;bar($bar) }</code></pre>

<p>This update was added 18 Oct 2020, in &#39;format all signatures separately from prototypes&#39;, e6a10f3. The test file &#39;signatures.t&#39; distributed with perl5.31 formats without error now.</p>

</dd>
<dt id="fix-parsing-problem-with"><b>fix parsing problem with $#</b></dt>
<dd>

<p>A problem with parsing variables of the form $# and $#array was found in testing and fixed. For most variables the leading sigil may be separated from the remaining part of the identifier by whitespace. An exception is for a variable beginning with &#39;$#&#39;. If there is any space between the &#39;$&#39; and &#39;#&#39; then the &#39;#&#39; starts a comment. So the following snippet is has valid syntax and is equivalent to $ans=40;</p>

<pre><code>    my $ #
    #
    ans = 40;</code></pre>

<p>This was being misparsed and was fixed 17 Oct 2020, in &#39;fixed parsing error with spaces in $#&#39; a079cdb.</p>

</dd>
<dt id="fix-missing-line-break-for-hash-of-subs-with-signatures"><b>fix missing line break for hash of subs with signatures</b></dt>
<dd>

<p>During testing the following error was found and fixed. Given the following input snippet:</p>

<pre><code>    get(
        on_ready =&gt; sub ($worker) {
            $on_ready-&gt;end;
            return;
        },
        on_exit =&gt; sub ( $worker, $status ) { return; },
    );</code></pre>

<p>The resulting formatting was</p>

<pre><code>    get(
        on_ready =&gt; sub ($worker) {
            $on_ready-&gt;end;
            return;
        }, on_exit =&gt; sub ( $worker, $status ) { return; },
    );</code></pre>

<p>Notice that the break after the comma has been lost. The problem was traced to a short-cut taken by the code looking for one-line blocks. The unique circumstances in which this occurred involved a hash of anonymous subs, one with a signature with multiple parameters and short enough to be a one-line block, as in the last sub definition line. This was fixed 17 Oct 2020 in &#39;fix missing line break for hash of subs with signatures&#39;, 51428db.</p>

</dd>
<dt id="fix-issues-with-prototype-and-signature-parsing"><b>fix issues with prototype and signature parsing</b></dt>
<dd>

<p>Problems with parsing prototypes and signatures were found during testing and fixed 17 Oct 2020 in &#39;fixed problem parsing multi-line signatures with comments&#39;, 017fd07. For example the following snippet was mis-parsed because of the hash mark.</p>

<pre><code>    sub test ( # comment ))) 
        $x, $x) { $x+$y }</code></pre>

<p>Complex signature expressions such as the following are now parsed without error:</p>

<pre><code>    sub t086
        ( #foo)))
        $ #foo)))
        a #foo)))
        ) #foo)))
        { $a.$b }</code></pre>

</dd>
<dt id="improve-guess-for-pattern-or-division"><b>improve guess for pattern or division</b></dt>
<dd>

<p>The following line caused a tokenization error in which the two slashes were parsed as a pattern.</p>

<pre><code>   my $masksize = ceil( Opcode::opcodes / 8 );    # /</code></pre>

<p>This problem was discovered in random testing. When a slash follows a bareword whose prototype is not known to perltidy, it has to guess whether the slash starts a pattern or is a division. The guessing logic was rewritten and improved 14 Oct 2020 in &#39;rewrote logic to guess if divide or pattern&#39;, afebe2f.</p>

</dd>
<dt id="fix--bos-to-keep-isolated-semicolon-breaks-after-block-braces"><b>fix -bos to keep isolated semicolon breaks after block braces</b></dt>
<dd>

<p>The flag <b>-bos</b>, or <b>--break-at-old-semicolon-breakpoints</b>, keeps breaks at old isolated semicolons. For example</p>

<pre><code>    $z = sqrt($x**2 + $y**2)
      ;</code></pre>

<p>In testing it was found not to be doing this after braces which require semicolons, such as &#39;do&#39; and anonymous subs. This was fixed 12 Oct 2020 in &#39;fix -bos to work with semicolons after braces&#39;, 03ee7fc. For example</p>

<pre><code>    my $dist = sub {
        $z = sqrt( $x**2 + $y**2 )
          ;
      }
      ;</code></pre>

</dd>
<dt id="keep-break-after-use-overload"><b>keep break after &#39;use overload&#39;</b></dt>
<dd>

<p>If a line break occurs after <b>use overload</b> then it will now be kept. Previously it was dropped. For example, this would be kept intact:</p>

<pre><code>                use overload
                    &#39;+&#39; =&gt; sub {
                        print length $_[2], &quot;\n&quot;;
                        my ( $x, $y ) = _order(@_);
                        Number::Roman-&gt;new( int $x + $y );
                    },
                    &#39;-&#39; =&gt; sub {
                        my ( $x, $y ) = _order(@_);
                        Number::Roman-&gt;new( int $x - $y );
                    },
                    ...</code></pre>

<p>This keeps the list from shifting to the right and can avoid problems in formatting the list with certain styles, including with the -xci flag. Fixed 12 Oct 2020 in &#39;keep break after use overload statement&#39;, 8485afa.</p>

</dd>
<dt id="added-flag--xci-to-improve-formatting-when--ci-and--i-are-equal-issue-git-28"><b>added flag -xci to improve formatting when -ci and -i are equal, issue git #28</b></dt>
<dd>

<p>This flag causes continuation indentation to &quot;extend&quot; deeper into structures. If you use <b>-ci=n</b> and <b>-i=n</b> with the same value of <b>n</b> you will probably want to set this flag. Since this is a fairly new flag, the default is <b>-nxci</b> to avoid disturbing existing formatting.</p>

</dd>
<dt id="terminal-braces-not-indenting-correctly-with--bli-formatting-issue-git-40"><b>terminal braces not indenting correctly with -bli formatting, issue git #40</b></dt>
<dd>

<p>This problem is illustrated with the following snippet when run with -bli -blil=&#39;*&#39;</p>

<pre><code>    #-bli -bli list=&#39;*&#39;
    try
      {
        die;
      }
    catch
      {
        die;
      };    # &lt;-- this was not indenting</code></pre>

<p>This was due to conflicting rules and was fixed 1 Oct 2020 in commit &#39;fix issue git #40, incorrect closing brace indentation with -bli&#39;, a5aefe9.</p>

<p>At the same time, it was noted that block types sort/map/grep and eval were not following -bli formatting when -blil=&#39;*&#39; and this was fixed. For example, with corrected formatting, we would have</p>

<pre><code>  # perltidy -bli -blil=&#39;*&#39;
    eval
      {
        my $app = App::perlbrew-&gt;new( &quot;install-patchperl&quot;, &quot;-q&quot; );
        $app-&gt;run();
      }
      or do
      {
        $error          = $@;
        $produced_error = 1;
      };</code></pre>

</dd>
</dl>

<h1 id="Issues-fixed-after-release-20200907">Issues fixed after release 20200907</h1>

<p>This is a detailed log of changes since the release 20200907. All bugs were found with the help of automated random testing.</p>

<dl>

<dt id="Keep-any-space-between-a-bareword-and-quote"><b>Keep any space between a bareword and quote</b></dt>
<dd>

<p>In random testing, the -mangle option introduced a syntax error by deleting the space between barewords and quotes (test file &#39;MxScreen&#39;), such as:</p>

<pre><code>  oops&quot;Your login, $Bad_Login, is not valid&quot;;</code></pre>

<p>Sub &#39;is_essential_whitespace&#39; was updated to prevent this on 27 Sep 2020, in &#39;keep any space between a bareword and quote&#39;, f32553c.</p>

</dd>
<dt id="Fixed-some-incorrect-indentation-disagreements-reported-in-LOG-file"><b>Fixed some incorrect indentation disagreements reported in LOG file</b></dt>
<dd>

<p>The .LOG file reports any disagreements between the indentation of the input and output files. This can help locate brace errors. These were incorrect when some of the options were used, including --whitespace-cycle, -bbhb, -nib. This was corrected 24 Sep 2020, &#39;fixed incorrect log entry for indentation disagreement&#39;, 3d40545. At the same time, locations of closing brace indentation disagreements are now tracked and reported in the .ERR file when there is a brace error. This can help localize the error if the file was previously formatted by perltidy.</p>

</dd>
<dt id="If-an-cut-starts-a-POD-section-within-code-give-a-warning"><b>If an =cut starts a POD section within code, give a warning</b></dt>
<dd>

<p>Previously only a complaint was given, which went into the log file and was not normally seen. Perl silently accepts this but it can cause significant problems with pod utilities, so a clear warning is better. This situation arose in testing on random files in combination with a -dp flag and it took some time to understand the results because of the lack of a warning.</p>

</dd>
<dt id="Switched-from-using-an-eval-block-to-the--can-function-for-sub-finish_formatting"><b>Switched from using an eval block to the -</b>can() function for sub finish_formatting&gt;</dt>
<dd>

<p>This is not a bug, but is cleaner coding and insures that error messages get reported. This change was made 20 Sep 2020, &#39;switch from eval { } to -&gt;can(&#39;finish_formatting&#39;)&#39;, 28f2a4f.</p>

</dd>
<dt id="fixed-uninitialized-value-reference"><b>fixed uninitialized value reference</b></dt>
<dd>

<p>The following message was generated during automated testing</p>

<pre><code> Use of uninitialized value $cti in numeric eq (==) at /home/steve/bin/Perl/Tidy/Formatter.pm line 12079.
 Use of uninitialized value $cti in numeric eq (==) at /home/steve/bin/Perl/Tidy/Formatter.pm line 12089.
 Use of uninitialized value $cti in numeric eq (==) at /home/steve/bin/Perl/Tidy/Formatter.pm line 12097.</code></pre>

<p>The problem could be simplified to running perltidy -wn on this snippet:</p>

<pre><code>     __PACKAGE__-&gt;load_components( qw(
&gt;         Core
&gt; 
&gt;     ) );</code></pre>

<p>This was fixed 20 Sep 2020 in &#39;fixed_uninitialized_value&#39;, 8d6c4ed.</p>

</dd>
<dt id="fix-incorrect-parsing-of-certain-deprecated-empty-here-docs"><b>fix incorrect parsing of certain deprecated empty here-docs </b></dt>
<dd>

<p>The following snippet was being incorrectly parsed:</p>

<pre><code> print &lt;&lt;
 # Hello World 13!
 
   ;
 print &quot;DONE\n&quot;;</code></pre>

<p>This is a deprecated here-doc without a specified target but currently still a valid program. It would have been correctly parsed if the semicolon followed the &#39;&lt;&lt;&#39; operator rather than the here-doc.</p>

<p>This was found in random testing and fixed 16 Sep 2020. A warning message about deprecated here-doc targets was added.</p>

</dd>
<dt id="make-the-arrow-a-vertical-alignment-token-git-39"><b>make the arrow a vertical alignment token, git #39</b></dt>
<dd>

<p>The -&gt; can now be vertically aligned if a space is placed before it with -wls=&#39;-&gt;&#39;. Added 15 Sep 2020 as part of previous item, 9ac6af6.</p>

</dd>
<dt id="add-flags--bbhb-n--bbsb-n-bbp-n-git-38"><b>add flags -bbhb=n, -bbsb=n, =bbp=n, git #38</b></dt>
<dd>

<p>These flags give control over the opening token of a multiple-line list. They are described in the man pages, perltidy.html. Added 15 Sep 2020 in &quot;added flags -bbhb=n, -bbsb=n, -bbq=n, suggestion git #38&quot;. 9ac6af6.</p>

</dd>
<dt id="Allow-vertical-alignment-of-line-ending-fat-comma"><b>Allow vertical alignment of line-ending fat comma</b></dt>
<dd>

<p>A change was made to allow a &#39;=&gt;&#39; at the end of a line to align vertically, provided that it aligns with two or more other &#39;=&gt;&#39; tokens. This update was 14 Sep 2020, &#39;Allow line-ending &#39;=&gt;&#39; to align vertically&#39;, ea96739.</p>

</dd>
<dt id="fixed-uninitialized-value-reference1"><b>fixed uninitialized value reference</b></dt>
<dd>

<p>The following message was generated when running perltidy on random text:</p>

<pre><code> Use of uninitialized value $K_semicolon in subtraction (-) at /home/steve/bin/Perl/Tidy/Formatter.pm line 16467.</code></pre>

<p>This was fixed 14 Sep 2020, included in &#39;Allow line-ending &#39;=&gt;&#39; to align vertically&#39;, ea96739.</p>

</dd>
<dt id="Do-not-create-a-zero-size-file-by-deleting-semicolons"><b>Do not create a zero size file by deleting semicolons</b></dt>
<dd>

<p>A rule was added to prevent a file consisting of a single semicolon</p>

<pre><code> ;</code></pre>

<p>from becoming a zero length file. This could cause problems with other software. Fixed 13 Sep 2020, &#39;do not create a zero length file by deleting semicolons&#39;, b39195e.</p>

</dd>
<dt id="fixed-uninitialized-value-reference2"><b>fixed uninitialized value reference</b></dt>
<dd>

<p>The following message was generated when running perltidy on random text:</p>

<pre><code> Use of uninitialized value $cti in numeric eq (==) at /home/steve/bin/Perl/Tidy/Formatter.pm line 11926.
 Use of uninitialized value $cti in numeric eq (==) at /home/steve/bin/Perl/Tidy/Formatter.pm line 11936.
 Use of uninitialized value $cti in numeric eq (==) at /home/steve/bin/Perl/Tidy/Formatter.pm line 11944.</code></pre>

<p>This was fixed 13 Sep 2020 in &#39;fixed unitialized variable problem &#39;, adb2096.</p>

</dd>
<dt id="fixed-uninitialized-value-reference3"><b>fixed uninitialized value reference</b></dt>
<dd>

<p>The following message was generated when running perltidy on random text:</p>

<pre><code> substr outside of string at /home/steve/bin/Perl/Tidy/Tokenizer.pm line 7362.
 Use of uninitialized value in concatenation (.) or string at /home/steve/bin/Perl/Tidy/Tokenizer.pm line 7362.</code></pre>

<p>This was fixed 13 Sep 2020 in &#39;fixed unitialized variable problem&#39;, 5bf49a3.</p>

</dd>
<dt id="fixed-uninitialized-value-reference4"><b>fixed uninitialized value reference</b></dt>
<dd>

<p>The following message was generated when running perltidy on random text:</p>

<pre><code> Use of uninitialized value $K_opening in subtraction (-) at /home/steve/bin/Perl/Tidy/Formatter.pm line 16467.</code></pre>

<p>This was fixed 13 Sep 2020 in &#39;fix undefined variable reference&#39;, 1919482.</p>

</dd>
<dt id="hashbang-warning-changed"><b>hashbang warning changed</b></dt>
<dd>

<p>The following snippet generated a warning that there might be a hash-bang after the start of the script.</p>

<pre><code> $x = 2;
 #!  sunos does not yet provide a /usr/bin/perl
 $script = &quot;$^X $script&quot;;</code></pre>

<p>To prevent this annoyance, the warning is not given unless the first nonblank character after the &#39;#!&#39; is a &#39;/&#39;. Note that this change is just for the warning message. The actual hash bang check does not require the slash.</p>

<p>Fixed 13 Sep 2020, &#39;prevent unnecessary hash-bang warning message&#39; 4f7733e and &#39;improved hash-bang warning filter&#39;, fa84904.</p>

</dd>
<dt id="uninitialized-index-referenced"><b>uninitialized index referenced</b></dt>
<dd>

<p>An unitialized index was referenced when running on a file of randomly generated text:</p>

<pre><code>  Use of uninitialized value $K_oo in subtraction (-) at /home/steve/bin/Perl/Tidy/Formatter.pm line 7259.</code></pre>

<p>This was fixed 12 Sep 2020 in &#39;fixed undefined index&#39;, 616bb88.</p>

</dd>
<dt id="Oops-message-triggered"><b>Oops message triggered</b></dt>
<dd>

<p>The parameter combination -lp -wc triggered an internal bug message from perltidy:</p>

<pre><code> 398: Program bug with -lp.  seqno=77 should be 254 and i=1 should be less than max=-1
 713: The logfile perltidy.LOG may contain useful information
 713: 
 713: Oops, you seem to have encountered a bug in perltidy.  Please check the
 713: BUGS file at http://perltidy.sourceforge.net.  If the problem is not
 713: listed there, please report it so that it can be corrected.  Include the
 ...</code></pre>

<p>The problem is that the parameters --line-up-parentheses and --whitespace-cycle=n are not compatible. The fix is to write a message and turn off the -wc parameter when the both occur. This was fixed 8 Sep 2020 in &quot;do not allow -wc and -lp together, can cause bugs&quot;, 7103781.</p>

</dd>
<dt id="Internal-fault-detected-by-perltidy"><b>Internal fault detected by perltidy</b></dt>
<dd>

<p>This snippet after processing with the indicated parameters triggered a Fault message in store-token-to-go due to discontinuous internal index values :</p>

<pre><code>  perltidy --noadd-newlines --space-terminal-semicolon

  if ( $_ =~ /PENCIL/ ) { $pencil_flag= 1 } ; ;
  $yy=1;</code></pre>

<p>This triggered the message:</p>

<pre><code> ==============================================================================
 While operating on input stream with name: &#39;&lt;stdin&gt;&#39;
 A fault was detected at line 7472 of sub &#39;Perl::Tidy::Formatter::store_token_to_go&#39;
 in file &#39;/home/steve/bin/Perl/Tidy/Formatter.pm&#39;
 which was called from line 8298 of sub &#39;Perl::Tidy::Formatter::process_line_of_CODE&#39;
 Message: &#39;Unexpected break in K values: 591 != 589+1&#39;
 This is probably an error introduced by a recent programming change. 
 ==============================================================================</code></pre>

<p>The deletion of the extra, spaced, comma had created an extra space in the token array which had not been forseen in the original programming. It was fixed 10 Sep 2020 in &quot;fixed very rare fault found with automated testing&quot;, eb1b1d9.</p>

</dd>
<dt id="Error-parsing-deprecated-variable"><b>Error parsing deprecated $# variable</b></dt>
<dd>

<p>This problem can be illustrated with this two-line snippet:</p>

<pre><code>  $#
  eq$,?print&quot;yes\n&quot;:print&quot;no\n&quot;;</code></pre>

<p>Perltidy joined &#39;$#&#39; and &#39;eq&#39; to get $#eq, but should have stopped at the line end to get $# followed by keyword &#39;eq&#39;. (Note that $# is deprecated). This was fixed 11 Sep 2020 in &quot;fixed several fringe parsing bugs found in testing&quot;, 85e01b7.</p>

</dd>
<dt id="Error-message-parsing-a-file-with-angle-brackets-and-ternaries"><b>Error message parsing a file with angle brackets and ternaries</b></dt>
<dd>

<p>This problem can be illustrated with the following test snippet which was not correctly parsed.</p>

<pre><code> print$$ &lt;300?&quot;$$&lt;300\n&quot;:$$&lt;700?&quot;$$&lt;700\n&quot;:$$&lt;2_000?&quot;$$&lt;2,000\n&quot;:$$&lt;10_000?&quot;$$ &lt;10,000\n&quot;:&quot;$$&gt;9,999\n&quot;;</code></pre>

<p>The problem is related to the &#39;&lt;&#39; symbol following the &#39;$$&#39; variable, a possible filehandle, and is similar to a previous bug. The problem was corrected 11 Sep 2020 in &quot;fixed several fringe parsing bugs found in testing&quot;, 85e01b7. The line now correctly formats to</p>

<pre><code> print $$ &lt; 300  ? &quot;$$&lt;300\n&quot;
   : $$ &lt; 700    ? &quot;$$&lt;700\n&quot;
   : $$ &lt; 2_000  ? &quot;$$&lt;2,000\n&quot;
   : $$ &lt; 10_000 ? &quot;$$ &lt;10,000\n&quot;
   :               &quot;$$&gt;9,999\n&quot;;</code></pre>

</dd>
<dt id="code-crash-with-cuddled-else-formatting-on-unbalanced-files"><b>code crash with cuddled-else formatting on unbalanced files</b></dt>
<dd>

<p>A file with incorrect bracing which effectively gave negative indentation caused a crash when a stack was referenced with a negative index. The problem was fixed 8 Sept 2020 in &quot;convert array to hash to avoid trouble with neg levels in bad files&quot;, a720e0d.</p>

</dd>
<dt id="error-message-Unterminated-angle-operator"><b>error message &#39;Unterminated angle operator?&#39;</b></dt>
<dd>

<p>This error can be demonstrated with this line.</p>

<pre><code>  print $i &lt;10 ? &quot;yes&quot; : &quot;no&quot;;</code></pre>

<p>Perl has some strange parsing rules near a possible filehandle, and they change over time. The &#39;&lt;&#39; here is a less than symbol, but perltidy expected that it might be the start of an angle operator, based on the old rules, and gave a warning. The formatting was still correct, but the warning was confusing. This has been fixed 8 Sep 2020 in &#39;remove confusing warning message&#39;, 0a4d725.</p>

</dd>
<dt id="Line-broken-after-here-target"><b>Line broken after here target</b></dt>
<dd>

<p>This problem is illustrated with the following snippet</p>

<pre><code>  $sth= $dbh-&gt;prepare (&lt;&lt;&quot;END_OF_SELECT&quot;) or die &quot;Couldn&#39;t prepare SQL&quot; ;
      SELECT COUNT(duration),SUM(duration) 
      FROM logins WHERE username=&#39;$user&#39;
  END_OF_SELECT</code></pre>

<p>When run with a short line length it got broken after the here target, causing an error. This was due to a recent program change and fixed 7 Sep 2020 in &#39;fixed bug where long line with here target got broken&#39;, 8f7e4cb.</p>

</dd>
<dt id="undefined-variable-named-test2"><b>undefined variable named &#39;test2&#39;</b></dt>
<dd>

<p>An uninitialized value was being referenced and triggered this message:</p>

<pre><code> undefined test2, i_opening=5, max=18, caller=Perl::Tidy::Formatter ./perltidy-20200907.pl 13465
 Use of uninitialized value $test2 in numeric eq (==) at ./perltidy-20200907.pl line 19692.</code></pre>

<p>Fixed 8 Sep 2020 in &#39;fixed rare problem with stored index values for -lp option&#39;, 4147c8c.</p>

</dd>
<dt id="Line-order-switched-at-start-of-quoted-text"><b>Line order switched at start of quoted text</b></dt>
<dd>

<p>This problem arose in several scripts involving the parameter --line-up-parentheses pluse one or more of the vertical tightness flags. It can be illustrated with the following snippet:</p>

<pre><code>    perltidy --line-up-parentheses --paren-vertical-tightness=1

    if (
        ( $name, $chap ) =
        $cur_fname =~ m!^Bible/
          .*?/          # testament
          .*?/          # range of books
          (.*?)/        # book name
          .*?           # optional range of verses
          (\d+)$!x
      )
    {
        $cur_name = &quot;$name $chap&quot;;
    }</code></pre>

<p>This gave</p>

<pre><code>    if (( $name, $chap ) =
          .*?/          # testament
        $cur_fname =~ m!^Bible/
          .*?/          # range of books
          (.*?)/        # book name
          .*?           # optional range of verses
          (\d+)$!x
      )
    {
        $cur_name = &quot;$name $chap&quot;;
    }</code></pre>

<p>Notice the incorrect line order. The problem was an incorrect order of operations in the vertical aligner flush, leaving a line stranded and coming out in the wrong order. This was fixed 11 Sep 2020.</p>

</dd>
<dt id="crash-due-to-bad-index-named-j_terminal_match"><b>crash due to bad index named &#39;$j_terminal_match&#39;</b></dt>
<dd>

<p>This crash was due to an index error which caused a non-existent object to be referenced. The problem is fixed 2020-09-07 in &quot;fix problem of undefined values involving j_terminal_match&quot;, c5bfa77. The particular parameters which caused this were:</p>

<pre><code>    --noadd-newlines --nowant-left-space=&#39;=&#39; </code></pre>

</dd>
<dt id="an-issue-with-the--x-flag"><b>an issue with the -x flag</b></dt>
<dd>

<p>This is not a bug but did take some time to resolve. The problem was reduced to the following script run with the -x flag (--look-for-hash-bang)</p>

<pre><code> print(SCRIPT$headmaybe . &lt;&lt;EOB . &lt;&lt;&#39;EOF&#39; .$tailmaybe),$!;
 #!$wd/perl
 EOB
 print &quot;\$^X is $^X, \$0 is $0\n&quot;;
 EOF</code></pre>

<p>The resulting file had a syntax error (here-doc target EOB changed).</p>

<pre><code> print(SCRIPT$headmaybe . &lt;&lt;EOB . &lt;&lt;&#39;EOF&#39; .$tailmaybe),$!;
 #!$wd/perl
 EOB print &quot;\$^X is $^X, \$0 is $0\n&quot;;
 EOF</code></pre>

<p>The problem is that the -x flag tells perltidy not to start parsing until it sees a line starting with &#39;#!&#39;, which happens to be in a here-doc in this case.</p>

<p>A warning was added to the manual 7 Sept 2020 in &quot;add warning about inappropriate -x flag&quot;, fe66743.</p>

</dd>
<dt id="error-parsing-sub-signature"><b>error parsing sub signature</b></dt>
<dd>

<p>This problem was reduced to the following snippet:</p>

<pre><code> substr
 (
  $#
 )</code></pre>

<p>The deprecated variable &#39;$#&#39; was being parsed incorrectly, and this was due to an error in which the word &#39;substr&#39; followed by a paren was taken as the start of a sub signature. The problem was fixed 8 Sep 2020 in &#39;fix problem parsing sub prototypes&#39; 569e05f. The code</p>

<pre><code>  $container_type =~ /^sub/;</code></pre>

<p>was corrected to be</p>

<pre><code>  $container_type =~ /^sub\b/;</code></pre>

</dd>
<dt id="uninitialized-value-message-found-7-Sep-2020"><b>uninitialized value message, found 7 Sep 2020</b></dt>
<dd>

<p>Unitialized values were referenced. An index was not being tested. Fixed 8 Sep 2020 in &quot;fix undefined variable&quot;, 9729965.</p>

<pre><code> Use of uninitialized value $Kon in array element at /home/steve/bin/Perl/Tidy/Formatter.pm line 4022.
 Use of uninitialized value $Kon in array element at /home/steve/bin/Perl/Tidy/Formatter.pm line 4023.
 Use of uninitialized value $Ko in subtraction (-) at /home/steve/bin/Perl/Tidy/Formatter.pm line 4023.</code></pre>

</dd>
</dl>

<h1 id="Open-Issues">Open Issues</h1>

<p>These are known issues which have not been fixed.</p>

<dl>

<dt id="lexical-subs-not-fully-supported"><b>lexical subs not fully supported</b></dt>
<dd>

<p>Basic parsing of lexical subs works but some aspects of lexical subs are not yet functional. One of these is that unlike regular subs, lexical subs can override names of builtin functions.</p>

<p>First consider the following snippet</p>

<pre><code>  sub s { 
    my $arg=$_[0];
    print &quot;s called with arg $arg\n&quot;;
  }
  s(1);
  s(2);</code></pre>

<p>The &#39;s&#39; in the two last lines is the builtin s function, not the sub. Both perltidy and perl make the same assumption here. This program happens to still run but prints nothing. It will not run if the last semicolon is removed.</p>

<p>Now consider the following snippet in which the sub has a preceding &#39;my&#39;</p>

<pre><code>  use feature &#39;lexical_subs&#39;, &#39;signatures&#39;;
  my sub s { 
    my $arg=$_[0];
    print &quot;s called with arg $arg\n&quot;;
  }
  s(1);
  s(2);</code></pre>

<p>The builtin function &#39;s&#39; is replaced by the sub s here, and the program runs. Perltidy will format this but it is assuming that the s in the two last lines are the builtin s function. If the last semicolon is removed, there will be an formatting error. So perltidy and perl make different assumptions in this case.</p>

<p>Another issue is that perltidy does not yet remember the extent of the scope of a lexical sub.</p>

</dd>
<dt id="issues-with-paren-less-calls"><b>issues with paren-less calls</b></dt>
<dd>

<p>Consider the following snippet:</p>

<pre><code>  use Test::More;
  ok open($stdin, &quot;&lt;&amp;&quot;, $1), &#39;open ... &quot;&lt;&amp;&quot;, $magical_fileno&#39;, ||  _diag $!;</code></pre>

<p>Note the unusual situation of a comma followed by an &#39;||&#39;. Perltidy will format this satisfactorily but it will write an error message. The syntax is correct, however. Perl knows the prototype of the &#39;ok&#39; function, which is called here without parens, so the last comma marks the last arg and is needed to keep the || from attaching to the last arg.</p>

<p>Full support of peren-less calls will probably never be implemented in perltidy because it would require that it parse all of the modules used to find the prototypes. This would make it impossible to run perltidy on small snippets of code from within an editor.</p>

<p>The problem can be avoid if parens are used:</p>

<pre><code>  ok ( open($stdin, &quot;&lt;&amp;&quot;, $1), &#39;open ... &quot;&lt;&amp;&quot;, $magical_fileno&#39;) ||  _diag $!;</code></pre>

</dd>
<dt id="multiple-sub-paren-calls"><b>multiple sub paren calls</b></dt>
<dd>

<p>Perltidy currently flags as an error a closing paren followed by an opening paren, as in the following</p>

<pre><code>  $subsubs[0]()(0)</code></pre>

<p>This syntax is ok. The example is from test &#39;current_sub.t&#39; in perl5.31.</p>

</dd>
</dl>


</body>

</html>