Processing Live Data
By Randal L. Schwartz
In previous columns, I've discussed the wonderful CGI.pm module, which provides easy access to client (browser) information interaction, and demonstrated many uses for the powerful LWP library, which allows programs to connect to servers as Web clients. But some applications, or "agents," can utilize both libraries at once, to provide a different view of live data presented by another server. An application could, for example, perform a user-input based search on several Web search engines and combine the result into a summary page, or query all the online catalog stores to find the best price for a particular item.
Being on the road a lot (teaching Perl), I have a hard time keeping up with my favorite comic strip, Dilbert. Luckily, United Media (Dilbert's syndicator) has a Web site (www.unitedmedia.com/comics/dilbert/) with about a month's worth of back strips. To get to them, however, you have to start from a top-level page, then select each individual back issue from a calendar. It dawned on me that I could build a CGI program that would do all the hard work for me, creating a single Web page with all the GIFs at once and at the same time showcasing an interesting use of both the CGI and LWP libraries.
Kick Off
The program I wrote appears in
|