- my @headers = grep m{
- ^ (?: [a-z]+ (?: (?:-\w+)+ | \ by ) ) : \s* \S
- }imx, split /\n/ or next;
- say for @headers;
- last;
+ my @headers;
+
+ LINE:
+ for (split /\n/) {
+ next if not /\S/;
+ my @header = m{
+ ^
+ (?<key> $HEADERMATCH)
+ : \s*
+ (?<val> \S .+)
+ $
+ }imx or next LINE;
+
+ push @headers, \@header;
+ }
+
+ next BLOCK if not @headers;
+
+ for (@headers) {
+ say join ': ', @$_;
+ }
+
+ last BLOCK;