#!/usr/bin/perl #Written by Jen Chen #Copyrighted by Jen Chen use CGI (":standard"); $myOrderId = param("getOrderId"); open(ORDERS,"Orders.csv") || warn "Can not open the file specified!"; print "Content-type: text/html \n\n"; print "Testing shell script \n"; print " \n"; print "

Hello Students in CS 345 class!

\n"; print ""; $colHeader = 1; foreach $record (){ @array = split(/,/, $record); if($colHeader < 2){ #Print the column header. print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; $colHeader = $colHeader + 1; } elsif($colHeader > 1 && $myOrderId == $array[0]) { print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; $colHeader = $colHeader + 1; break; #Since there is only one matched record then once it is found, quit. } #End of IF-statement } #end of FOR-loop print "
$array[0]$array[1]$array[2]$array[3]$array[4]$array[5]$array[6]$array[7]
$array[0]$array[1]$array[2]$array[3]$array[4]$array[5]$array[6]$array[7]
"; print " \n"; print " \n";