CODE: Perl version of chat example