I have a hash in perl whose keys are domain names and value is reference to array of blacklisted zones in which the domain is blacklisted.Currently I am checking the domain against 4 zones.If the domain is blacklisted in the particular zone the I push the zone names in the array.
domain1=>(zone1,zone2)
domain2=>(zone1)
domain3=>(zone3,zone4)
domain4=>(zone1,zone2,zone3,zone4)
I want to create a HTML table from these values in CGI like
domain-names zone1 zone2 zone3 zone4
domain1 true true false false
domain2 true false false false
domain3 false false true true
domain4 true true true true
I tried it using map in CGI like
print $q->tbody($q->Tr([
$q->td([
map {
map{
$_
}'$_',@{$result{$_}}
}keys %result
])
)
I am unable to the desired output.I am not sure of using if-else in map. If I manually generate the td's Then I need to write a separate td's for each condition like
If(zone1&&zone2&&!zone3&&!zone4){
print "<td>true</td><td>true</td><td><false/td><td>false</td>";
}
......
It is very tedious.How can I get that output?