#!/usr/bin/perl

# Name:   webify.pl
# Author: John F. Hagan
# Date:   01/99 
#
# Purpose: to take Harry Lincoln's TITLES SCRIPT file and separate each	
#          record into its respective RISM.  Lines are italicized properly 
#          first.
#

$input     = "/local/www/faculty/lincoln/titles.script";
$output    = "/local/www/faculty/lincoln/firstlines.html";

open(TITLES, "$input");
open(OUTPUT,">>$output");

print OUTPUT <<TOPOFPAGE;
<html>
<head>
<title>The Latin Motet: Indexes to Printed Collections, 1500-1600</title>
</head>
<body bgcolor="#FFFFFF">
<center>
<h1>The Latin Motet: Indexes to Printed Collections, 1500-1600</h1>
<h2>Index to First Lines</h2>
</center>
<pre>
TOPOFPAGE

while (<TITLES>) {
   s/\(\+/<\/I>\(/;  #substitute 1st occurrence of + to </I>
   s/\+/<I>/;    #substitute 2nd occurrence of + to <I>
   s/\)\(\+/<\/I>\)\(/;  #substitute 3rd occurrence of + to </I>
   
   if (/\((\w+)\/(\w+)\)$/) {
      print(OUTPUT "<I>");  #we need to start each record in italics mode
      print(OUTPUT);
      print(OUTPUT "<BR>"); #end each record with a break
      }
   }

print OUTPUT <<ENDOFPAGE;
</pre>
<p>
Information compiled by 
<a href="mailto:bg0056\@bingvmb.cc.binghamton.edu">Harry B. Lincoln</a><br>
Professor Emeritus<br>
Department of Music<br>
Binghamton University<br>
</body>
</html>
ENDOFPAGE
