#### sub thread { print '
    '; for my $node (sort {$b <=> $a} keys %created){ # for all nodes # if doesn't have a parent and isn't a user if((!$parent{$node}) && ($nodetype{$node} ne 'user')){ if($created{$node}=~/^(....)(..)(..)(..)(..)(..)$/){ $created{$node} = "$4:$5:$6 $2/$3" } print qq~$types{$nodetype{$node}} ($created{$node})
    $content{$node} by $whom{$author{$node}}
    ~; my$d = 0; for my $p1 (sort {$a <=> $b} keys %parent){ # re if( ($parent{$p1} == $node) ){ unless($d > 0){ print '
      '} print qq~$content{$p1} by $whom{$author{$p1}}
      ~; $d++; my$e = 0; for my $p2 (sort {$a <=> $b} keys %parent){ # re(2) if( ($parent{$p2} == $p1) ){ unless($e > 0){ print '
        '} print qq~$content{$p2} by $whom{$author{$p2}}
        ~; $e++; my$f = 0; for my $p3 (sort {$a <=> $b} keys %parent){ # re(3) if( ($parent{$p3} == $p2) ){ unless($f > 0){ print '
          '} print qq~$content{$p3} by $whom{$author{$p3}}
          ~; $f++; } } if($f > 0){ print '
        '} } } if($e > 0){ print '
      '} } } if($d > 0){ print '
    '} } } print '
'; } ##
## sub thread { my%children; for my $root (sort {$a <=> $b} keys %created){ # for all nodes my(@kids,$kids); # if doesn't have a parent and isn't a user if( ($nodetype{$root} ne 'user') ){ for my $child (sort {$a <=> $b} keys %parent){ # for all children if( ($parent{$child} == $root) ){ # if this is a child push @kids, $child; } # if $kids = join '|', @kids; $children{$root} = $kids; } } } the rest is predictable noise...