in reply to perl 5.32 format question
I reduced your code down to this test case: perl -e '$_=" "; formline q{^<<<~~}, $_; length $^A or die' and a bisect reported that "9b4bdfd4 is the first bad commit". This is a commit that fixes several bugs in formats; it was first released as part of Perl v5.20.0 9 years ago.
If you read the documentation, note that a double tilde means "the line will be repeated until all the fields on the line are exhausted, i.e. undefined", however, a single tilde "anywhere in the line" means to suppress "lines where all fields are blank". Although I think the documentation could be a lot more clear on this (Update: patch applied), a double tilde implies the single tilde, as is confirmed by the relevant code in Perl 5.0.0 and today.
Anyway, the following provides your expected output both on older and recent Perl versions (tested on 5.14 to 5.36):
format REP = ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $rep_line ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~ $rep_line .
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: perl 5.32 format question
by hotpelmen (Scribe) on May 30, 2023 at 15:59 UTC |