sub descend_htmltree {   my $node = shift;   my $withclickiness = shift; my $node_id = shift; my $node_counter = 0;   foreach my $tmpnode (@{$node}) { $node_counter++     if(ref($tmpnode) eq 'HASH') {       my $nodeid = "${node_id}.$node_counter"; # Magic code to generate node's position in tree       $htmloutput .= "
" if($withclickiness);       $htmloutput .= "<$tmpnode->{tag}";       foreach(keys %{$tmpnode}) {         $htmloutput .= " $_=\"$tmpnode->{$_}\"" if($_ ne 'tag' && $_ ne 'content');       }       $htmloutput .= ">";       descend_htmltree($tmpnode->{content}, $withclickiness, $current_node_id);       $htmloutput .= "{tag}>";       $htmloutput .= "
" if($withclickiness);     } else {       $htmloutput .= "$tmpnode";     }   } }