#!/usr/local/bin/perl ######################################################################### # search1: Search for ice cream orders ######################################################################### use CGI "param"; @searchFlavor = param('ice'); print "Content-type: text/html \n"; print "\n"; open (ORDERFILE, "< ../../data/order.file") || print "Cannot open file - $!"; print " Search for orders

Result for search:

"; while($rec = ) { chomp($rec); ($fname,$address,$flavor) = split(/:/,$rec); $address =~ s/__/
/g; if ($flavor eq $searchFlavor[0] or $flavor eq $searchFlavor[1] or $flavor eq $searchFlavor[2]) { print "
"; } } print "
NameAddressIce Cream Flavor
$fname $address $flavor
"; exit(0);