in reply to
Awesome WM config: Lua Source Parse
Some alternatives - consider a map statement for the inner loop and consider a heredoc for the title. You could probably make the header separator a static too.
Something like (not tested):
sub printSettings {
my @groups = shift;
my $sep = "=" x 60;
foreach my $table (@groups) {
foreach my $info (@$table) {
my $cnt = 1;
print <<EOF;
$sep
$info->[0]
$sep
EOF
print map { sprintf "%5s. %-25s %-5s $info->[1]\n", $cnt
+++, $_;} sort keys {$info->[1]};
}
}
}