#!/usr/local/bin/perl ############################################################################ # order1: Take orders for ice cream shop ############################################################################ use CGI "param"; $fname = param('fullname'); $addr = param('addr'); @choice = param('ice'); print "Content-type: text/html \n"; print "\n"; open (ORDERFILE, ">> ../../data/order.file") || print "Cannot open file - $!"; flock (ORDERFILE, 2); # get exclusive control $addr2 = $addr; $addr2 =~ s/\r\n/__/g; # substitute newlines with __ $rec = join(":",($fname,$addr2,$choice[0]) ); print ORDERFILE "$rec\n"; flock (ORDERFILE, 8); # release exclusive control close(ORDERFILE); print "
$fname
$addr
$choice[0] "; exit(0);