##
# Get the data and store it in a message hash
while () {
chomp(my ($id,$thread,$from,$date,$content) = split /,/);
%{$msg->{$id}} = (
thread => $thread,
from => $from,
date => $date,
content => $content
);
}
##
##
foreach my $id (keys %{$msg}) {
next if ($msg->{$id}->{thread} == 0);
push @{ $msg->{ $msg->{$id}->{thread} }->{children} }, $id;
}