From b388f9311a7891b227aa3b1f52b1d439418af782 Mon Sep 17 00:00:00 2001
From: Mischa POSLAWSKY
Date: Sun, 2 Apr 2017 15:18:22 +0200
Subject: [PATCH] latin: pairwise loop through rows
Treat as ordered hash instead of special-casing array references.
---
latin.plp | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/latin.plp b/latin.plp
index 529b334..1fda12c 100644
--- a/latin.plp
+++ b/latin.plp
@@ -46,14 +46,19 @@ and common chars.
<:
+use List::Util qw( pairs );
+
my @table = do 'writing-latn.inc.pl';
if ($! or $@) {
Alert("Table data not found", $@ || $!);
}
else {
say '
';
- print ref $_ ne 'ARRAY' ? "$_\n" : map {/^ | $_\n"} @$_
- for @table;
+ for my $row (pairs @table) {
+ my ($title, $cells) = @{$row};
+ say ' |
---|
', $title;
+ print /^ | $_\n" for @{$cells};
+ }
say " |
---|
\n";
}
--
2.30.0