#!/usr/local/bin/perl # Dilip Barman, http://www.cs.unc.edu/Courses/wwwp-f97/members/barman # Sep 20-21 1997 # # dbRetrieve2.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 perlDatabase2.html # to retrieve existing records. It doesn't need to look at any input # and just builds a table of record values. # # Sep 22: It wasn't quite working but it was because I was trying to open # the database with its full name, not just the name up to the extension. # Now it seems to work fine! Now I'm going to add delete capability so # a record can be deleted. If I wanted, I could add update capability # so that a selected record would have its fields loaded into an Add Record # form, but I don't think I'll implement that. require "/afs/cs.unc.edu/project/courses/190-25f97/programs/perl/lib/cgi-lib.pl"; # GLOBAL VARIABLES $FALSE = 0; $TRUE = 1; # $DBFILENAME = "../musicDatabase/musicDB2"; $DBFILENAME = "/afs/cs.unc.edu/project/courses/190-25f97/members/barman/musicDatabase/musicDB2"; $ROACCESS = "0555"; # Read-Only open: RWX, so U=101, G=101, O=101 $RWACCESS = "0777"; # Read-Write open: 111 111 111 # Remember to set AFS directory permissions so system:anyuser (a web # client, for example) has write privilege to this directory -- # fs setat ../musicDatabase system:anyuser write $RECDELIMSTART = "\*\$\["; # delimit record entries: *$[ ... ]$* $RECDELIMEND = "\]\$\*"; # * * * T O P L E V E L H T M L S T U F F * * * print &PrintHeader; print "
"; print "\nThe database file, \"$DBFILENAME\", could not be found."; print "\nAre you sure it already has data in it? Drop"; print "\nDilip a note"; print "\nif you continue to have problems."; } # * * * W R A P U P H T M L * * * # Give option to return to try again or return home print "\n