#!/usr/bin/perl #limits size of upload $CGI::POST_MAX=1024 * 100; use File::Copy; use CGI qw/:standard/; use strict; use warnings; # output content header print "Content-type: text/html\n\n"; # get filename args my $cgi = new CGI or die "new CGI: $!\n"; my $csvfile = $cgi->param('inputfile'); # must match form name my $caption = $cgi->param('caption'); # table caption # start HTML print <

Your HTML Table

EOD $\ = "\n"; # set output record separator print ''; print ''; while (<$csvfile>) { chomp; # strip record separator my @Fld = split(/,/, $_); my $X = 0; print ''; while ($X <= $#Fld) { if ($X == 0) { print "\t '; } else { print "\t '; } ++$X; } print ''; } print <

Use the view source function on your browser to download a copy of the HTML code. EOD

' . $caption . '
" . $Fld[$X] . '" . $Fld[$X] . '