in reply to Graphical Hierarchical Tree

Since you asked for any other comments: if you set up the database so that every row has the key of the root ($article in your case, I think), then you can grab all of the replies with one sql statement.

Do the sorting out of the hierarchy on the returned results set. Your response time on an application like this is almost always > 90% a function of your sql. The time taken in the procedural (Perl) code is noise. You stand to gain substantially.