#!/usr/local/bin/perl # # table.pl # version 961201 # copyright 1996 by bo larsson # all rights reserved # # this CGI program generates html on-the-fly. Give it a text file that has # tab-delimited fields and return-delimited records, and it will output a # suitable table. # # bugs or feedback to bliss@seagull.net # for information on how to use, visit http://www.seagull.net/bliss/ $the_file = "./table.txt"; print "Content-type: text/html\n\n"; print ""; print "Table Manners"; print "Table Manners
"; if (open(THE_FILE, "$the_file")) { # begin the table print ""; while () { # begin one table row print ""; @fields = split(/\t/,$_); foreach $field (@fields) { # display one data cell for the table row print ""; } # end of one table row print ""; } close(THE_FILE); # end of the table print "
$field
"; print "

"; } else { print "unable to open the file $the_file.\n"; } print "";