magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 2000 > 12 > Programming with Perl  

Small Talk

By Randal L. Schwartz

Last month, I introduced a quick-and-dirty load balancer by developing a short program to handle the basics, without getting into all the frills and whistles and gadgets that many full-blown solutions offer. This month, I decided to take on the Web chat arena in the same way.

This came about in part because of an email conversation among the columnists and staff of this magazine. The topic was this month's collaboration theme. Usually, I ignore the issue theme and write about whatever I want, but one suggestion was to write a Web chat server.

Via email, I said I could take on the idea, and one of the other columnists mentioned that he had already written a 200-line chat server and 100-line chat client in Perl for another publication. Yet another columnist mentioned that he had written such a program in Java, with some unspecified number of lines (probably far exceeding 300). Well, that gave me the challenge I needed: to write a Web chat system in under 100 lines. I succeeded.

Chit Chat

A few of the people who helped me test the system were clamoring for the source code, and so I present it here, in Listing 1. As you can see, it's a server side script in Perl.

As for requirements, the chat system doesn't use any JavaScript. It works with any browser that supports frames and client-side pull (also known as meta-refresh). I even tested the script with the W3-mode in GNU Emacs and it works fine—the only exception is that users have to refresh the viewing window manually.




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2