Building a Chat Applet," Vol. 3, Issue 3, p. 30
Listing 1: Unlink command.
# read the log file data
 open(LOG,"$filename");
 @logcache = <LOG>;
 chop @logcache;
 close(IN);
 unshift(@logcache,$date.' '.$contents{'chatline'});
# Calculate the number of lines our chat log contains
 $numberOfChatLines = ($#logcache + 1 );
# check to see if we have exceeded our maximum log size
 if ($numberOfChatLines > $maxChat){
    # Remove the oldest chat line
    pop(@logcache);
 }

Listing 2: Run ( ) method.
   chatServer = new URL(app.getDocumentBase(),cgiPath+"chat.cgi");
   chatServerConnection = chatServer.openConnection();
   chatServerConnection.setDoOutput(true);
   chatServerConnection.setUseCaches(false);
   chatServerConnection.setRequestProperty
      ("Content-type","application/octet-stream");
   chatServerConnection.setRequestProperty
      ("Content-length",""+completeMessage.length());

   DataOutputStream send = new DataOutputStream(chatServerConnection.getOutputStream());
   send.writeBytes(completeMessage);
   send.close();

Listing 3: Chat.CGI may be found...
Download the remaining Source Code Listings