#!/usr/local/bin/perl # Dilip Barman, http://www.cs.unc.edu/Courses/wwwp-f97/members/barman # Sep 20 1997 # # dbProcessChoice.pl.cgi: As part of my perl programming project, described # at www.cs.unc.edu/Courses/wwwp-f97/members/barman/perlProjectProposal.html, # this perl cgi-bin script is called from the HTML form perlDatabase.html # to process the input. Using POST, these input variables are set in # STDIN: genre and whatToDo (set to either Enquire or AddRecord). # genre indicates the musical genre of interest (e.g., "Jazz - contemporary" # or "Rock"), whatToDo = Enquire means we are to return a list of music # in that genre, and whatToDo = AddRecord means we are to add a record. # We start off by including a nice library file by Steven Brenner which does # lots of things for us require "/afs/cs.unc.edu/project/courses/190-25f97/programs/perl/lib/cgi-lib.pl"; # * * * P R O C E S S U S E R I N P U T * * * # Get user input &ReadParse(*input); # Store input as attrib-value keys in variable input # print &PrintVariables(%input); # I'd rather format the printing myself: # while ( ($key,$value) = each(%input) ) # { print "\tThe value of the variable $key is $value\n"; } # To get a particular value, just look at $input{"xxx"} where xxx is the parmname $genre = $input{"genre"}; $whatToDo = $input{"whatToDo"}; # Print input values as a definition list # print "\n