From: Mischa POSLAWSKY
Date: Sun, 2 Apr 2017 13:18:22 +0000 (+0200)
Subject: latin: pairwise loop through rows
X-Git-Tag: v1.10~266
X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/b388f9311a7891b227aa3b1f52b1d439418af782?hp=7db6546c031c5fd8167a487cbda66d35280ec7cf
latin: pairwise loop through rows
Treat as ordered hash instead of special-casing array references.
---
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";
}