Just parse the text data instead of working around qw// list results.
+my @table = map {[split ' ']} grep {$_} split /\n(?!\s{3})/, q(
>: origineel: zee-: meer_water: land/aardig: anders: #:
>hond: hond zeehond scheepshond? prairiehond vleerhond #rodehond
>kat: kat zeekat meerkat cat_325? vliegende_kat #tijgerkat
>: origineel: zee-: meer_water: land/aardig: anders: #:
>hond: hond zeehond scheepshond? prairiehond vleerhond #rodehond
>kat: kat zeekat meerkat cat_325? vliegende_kat #tijgerkat
#>bij: bij - waterbij aardbei moerbei hommelbij
);
if ($Request eq 'standaard') {
#>bij: bij - waterbij aardbei moerbei hommelbij
);
if ($Request eq 'standaard') {
- $table[4 + 9*7] = 'grasmodderpaard?=草泥马'; # replace turnpaard
- $table[1 + 18*7] = 'draak_'; # irl animal
+ $table[ 9][4] = 'grasmodderpaard?=草泥马'; # replace turnpaard
+ $table[18][1] = 'draak_'; # irl animal
+@table = map {[split ' ']} grep {$_} split /\n/, q(
>hond zeehond prairiehond
>kat zeekat meerkat
>muis zeemuis vleermuis
>hond zeehond prairiehond
>kat zeekat meerkat
>muis zeemuis vleermuis
}
say '<table class="gallery">';
}
say '<table class="gallery">';
-while (my $name = shift @table) {
+for my $row (@table) {
+for my $name (@{$row}) {
if ($name =~ s/^#// and !$pageinfo->{prefix}) {
if ($name =~ s/^#// and !$pageinfo->{prefix}) {
- while ($name = shift @table) {
- last if $name =~ m/^>/;
- }
- $name or next;
}
if ($name =~ s/^>//) {
# leading dash starts a new row
}
if ($name =~ s/^>//) {
# leading dash starts a new row
print '</figure>';
print '</td>';
}
print '</figure>';
print '</td>';
}