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 > 03 > Script Junkie  

Make the Simple Things Simple

By Steve Johnson

Perl was originally created to handle complex text manipulation in UNIX when shell scripting wouldn't do. As its popularity grew, features and platforms were added, resulting in an object-oriented, cross-platform development language (that happens to manipulate text pretty well). In spite of its rapid growth and widespread use, there are situations where Perl shows its UNIX roots. One such instance came up as I tried writing a forking HTTP server for a Windows NT application.

An HTTP server (a Web server) is an application that "listens" for connection requests from client processes (usually on other machines). Upon receiving a request, the server creates a new connection for the client, and then goes back to listening for other requests. This new connection is created in its own process on the server because the act of waiting for a connection is usually a "blocking" action during which no other processing can take place. As I'll show you later, there are some obstacles and detours when building such an application with Win32 Perl.

A lot of the pain in writing an HTTP server can be eased by using the libwww-perl library for Perl. For those of you who have used it before, Listing 1 may look a little odd. I'm actually using the new LWPng module, which supports many HTTP 1.1 features, including persistent connections (see the sidebar titled "



  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