This program is part of the Comparative Programming :: Echo set of examples.
This example could be a one liner in Perl, but we’ve stretched it to three lines to make sure it’s well formed. Besides a directive at the top of the file pointing to the Perl interpreter, and a single module ‘use’ statement, the body of our program is a single line joining all of our input arguments (provided automatically in @ARGV) with a space as the delimeter.
Program Source: echo.pl
From the command line:
perl echo.pl Hello World
Using the web (specifically browsers) as an application development platform has faced a great number of hurdles, and after many successes and failures of implementation and technology only a few stumbling blocks remain before web delivered software becomes usable (in a traditional application sense), and a sturdy replacement for client side desktop applications.
One of these hurdles is interactivity. The problem lies in the need for web pages to refresh to show changes in data. The act of contacting the server, recreating interface logic and data logic, processing input, maintaining interaction state, and sending data back is time consuming on a processing and transport layer. The longer it takes to process, the more the flow of work is broken for the user. Various technologies try to address this problem of content and interaction. Flash and Shockwave come immediately to mind, with Java Applets and ActiveX trailing behind.
While these plugin based solutions have matured to the point of usability for the average user (and the average computer), for many reasons they can be sub-optimal solutions. Most applications written in these tools can’t interact with the user and browser as a traditional web page can. The ability to copy, paste, and print are lost, as well as the interface mechanics we’re used too with a standard webpage.
Why bring this up? I’ve whipped up a proof-of-concept RSS News Reader based on this technique. WebRSS can download and parse basic RSS2.0 news feeds, allowing RSS browsing from a web interface. While not a highly technical application, it does demonstrate the interaction possibilities opened up by XMLHttpRequest.
I’ve begun work on a number of RSS related snippits of code for various projects, and in doing so have played with a few ways to speed up RSS production, as well as interesting applications.
For RSS creation (at least from a perl backend) I would highly recommend the XML::RSS module. It supports a variety of RSS formats, and certainly eases the time it takes to whip up a quick feed.
But on to the interesting applications. If your RSS Aggregator (Try NetNewsWire if you’re on a Mac) supports images, try out Google Image Feed. Just enter a few search terms, copy the resulting RSS link into your news reader, and you’ve got a RSS Channel of images, taken from the Google Images search engine. Nothing terribly new here, but a fun experiment with RSS and Images.