Note: this web page is from 1996/1997. Pipeline and HFPM have gone through their life cycle and are now deprecated.
I came up with an idea the other day involving modularizing CGI-scripts, which I call the CGI Filter/Pipe interface, and have implemented for Unix using Perl version 5. I think this idea will improve life for the Web community by providing extra functionality to CGI-scripts.
This idea is further described in an article in the July 1996 issue of WEBsmith magazine.
Hello, thanks for stopping by. This page is about an idea that I have to increase the potential modularity of CGI scripts, so that instead of having one monolithic CGI script, a number of smaller, more easy to maintain, modules and a driving program can be used in sequence instead.
My idea is to have a CGI script (call it "pipeline") take input in the usual manner (GET or POST method), build an internal representation of the fields, then call a specified sequence of routines (in separate files/modules). These routines can do some processing, possibly modify fields and environmental variables, possibly output to stdout or to a file, and then return control to "pipeline" with the modifications.
An example should help illustrate this. Say a user or organization has an HTML for users to fill out. The following actions take place on the submission of the form:
More possible script actions are mentioned elsewhere.
This idea is similar to using UNIX pipes, with the scripts corresponding to filters. The main differences are the fact that the pipes are completely buffered, and it isn't complete programs being executed.
Anther good thing about this is that it benefits portability. For example, one of the main reasons Getcomments hasn't been ported to platforms other than UNIX is that it sends mail using UNIX-specific mail programs, although most of the rest of the perl code is fairly OS-independent. If Getcomments gets divided into separate parts, including one to send mail, then there could be a UNIX, Mac, and Windows version of the mail code.
What do you think of this idea in general? Give your opinion or look at what other people have said.
Some modules have been written already and are included in the HTML Form Processing Modules (HFPM). Here are some other module ideas that myself and others have thought of that would be good candidates for a filter (modular) approach to processing:
The initial implementation, Pipeline, has been done in Perl version 5 to run on Unix. Implementations for other routines and languages are welcome.
Let me know if your willing to do this.
I think this approach is fairly efficient since the I/O is only done once. The users can add as many things to the pipeline as they think are prudent for their situation.
17 January 1997