#!C:/perl/bin/perl.exe
use CGI::Carp qw(fatalsToBrowser);
use CGI;
$query = new CGI;
#--------------------------------------------
# Read in CGI data
#--------------------------------------------
$v01= $query->param('v01');
$v02= $query->param('v02');
$v03= $query->param('v03');
$pass= $query->param('pass');
#--------------------------------------------
# Check to see if this is the first pass through
#--------------------------------------------
if($pass < 1){
$pass=1;
}
#--------------------------------------------
# Basic Formatting and Style
#--------------------------------------------
print $query->header;
print $query->start_html(-title=>'page title');
#------------------------
# pass = 4
#------------------------
if($pass == 4){
# get date and time
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year = 1900 + $year;
$mon= $mon+1;
$hour = $hour - 1;
$date1= "$mon/$mday/$year";
$date2= "$hour:$min:$sec";
# write data to text file
open(INFO, ">>$ENV{'DOCUMENT_ROOT'}/data/tehdata.txt");
print INFO "$pin,$task,$date1,$date2,$v01,$v02,$v03,$v04,endline\n";
close (INFO);
print "Your data have been saved. Thank you for your time.
";
} # end pass = 4
#------------------------
# pass = 3
#------------------------
if($pass == 3){
print "