[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Free databaseprogramm for MAC ?



Thanks for buying Apple/G4/ASIP (I used to work there!!)

I wondered about database usage until I got going on perl and cgi
programming. If you don't need extensive relational database technology,
why not use simple text file/flat file read and writes? That saves
having to have FileMaker running on your server to handle data requests.

If you can get formp.cgi from the book Drag & Drop CGI Programming, (I
think they have a website where the source is available, but my book is
at work) it handles whatever data fields you define and writes the data
out to a text file. You can then write a simple cgi to read that data
back in to format into HTML for display, etc.

Sample:

sub show_results
{

#  format of file (at the moment) is:
#  user name, address, city, state, zip, note, timestamp
#  $basedir/$initdata ==  directory path and file name

 print "<br><br>\n";
 print "<table border=1>\n";
 print "<caption><b>Address List</b></caption>\n";

 open(THEDATA,"$basedir/$initdata") ||
  print "File session object failed to open $basedir/$initdata to read
session\n\n";

 while (<THEDATA>) {
  print "<tr>\n";

#        special $_ reads one line (record) from the datafile
  @components = split (/,/, $_);
  foreach $components(@components) {
   print "<td>$components</td>";
  }
  print "</tr>\n";

 }
 print "</table>\n";

}



# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org