The grep can be simplified with a smart match:
for my $key (sort keys %hash) { say "$key = ", join ' ', map $_ ~~ $hash{$key} ? 1 : 0, @array; }
In reply to Re^2: making presence/absence table from a hash of arrays
by Anonymous Monk
in thread making presence/absence table from a hash of arrays
by reubs85
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |