Perl and C++, log based UNIX chat program