use Modern::Perl qw/2015/; use CGI; use HTML::HashTable; my %fruits = ( apple => { 'granny smith' => 'green', 'pink lady' => 'red', 'golden delicious' => 'yellow' }, melon => 'yellow', strawberry => 'red', blueberry => 'blue', durian => 'light yellow' ); my $cgi = CGI->new(); print $cgi->header(), $cgi->start_html("Fruits and colors"), tablify( { DATA => \%fruits, } ), $cgi->end_html(); #### Content-Type: text/html; charset=ISO-8859-1 Fruits and colors
apple
golden delicious yellow
granny smith green
pink lady red
blueberry blue
durian light yellow
melon yellow
strawberry red