> Hi Dan, > > I don't think that is actually what he is asking for.Unless I > misunderstand, he is referring to a pass-through program. Of
That's why I asked what he meant. The absolut simpleest would be: #!/usr/bin/perl -w use strict; use CGI qw(header); use File::Slurp; pritn header(); print read_file("./index.html"); Pretty pointless unless you did something with the file: my $file = read_file("./index.html"); $file =~ s/Joemama/Monkey/g; print $file; Now what I assumed he probably meant was: print header(); if(whatever) { process formand output html results ) else { print formhtml } Whatever. Dan > course, a pure passthrough program would be pointless--it > would be quicker to serve the page up directly through a http > GET. OTOH, if you have some simple insertion magic to do on > a template page, this is a very goo strategy, and one I use: > > open (WEATHERPAGE, "Current_Vantage_Pro.htm") || die > ("can't open source file"); > my $CurrentLine = ""; > while (!(($CurrentLine = <WEATHERPAGE>) =~ /head/i)) {;} > # the head section is sent elsewhere, as is the CGI header > while (!(($CurrentLine = <WEATHERPAGE>) =~ /\/table/i)) { > print "$CurrentLine"; > } > print "$CurrentLine"; > if (my $Test = GetConditions ($contents)) { > InsertWarning ($contents); > } > while ($CurrentLine = <WEATHERPAGE>) { > print "$CurrentLine"; > } > close WEATHERPAGE; > } > > Of course this presumes that either: > > The source file has the CGI Content-type header, or that the > program has already sent it. Once the proper header is sent, > it is perfectly easy to pass through a local file. > > As to style, this was one of my ealry scripts. I now use > choo_choo_train rather than CamelBack for identifiers other > than class names. May have to do some "Replace All" magic on > my work from this period.. > > Joseph > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]