use warnings; use CGI qw /:all -nph/; #on Win32 $|++; $POST_MAX=100; $DISABLE_UPLOAD=1; print header(); print start_html(); my %HoHoH = ();#feed your hoh here my $ref2 = \%HoHoH ; print &table_center(&complextable($ref2)); print end_html; sub td_center{{-align=>center} td([@_]); }#separated for customization sub tr_center {{-align=>center}Tr([@_]); } sub table_center { table({-title=>'oOOOo', -bgcolor=>"#000000", -border=>1, -bordercolor=>"red", -cellspacing=>"0", -width=>"80%", -cellpadding=>"0"}, @_); } sub complextable { my $ref = shift; my @righe; foreach my $k (sort keys %{$ref}) { if (ref( $$ref{$k} )) { push @righe, (&tr_center (&td_center ($k,(&table_center (&complextable($$ref{$k})) ) ) ) ) ; } else { push @righe, (&tr_center(&td_center($k, $$ref{$k} ))); } } return @righe; }