#!/usr/bin/perl -w

#This is used for generating the html file according to the appropriate
#  template.  It is called BY "generatehtml.pl"

#It is called with two arguments:  the first is the id number and the
# second is the name of the template file.
 
($idnum, $file) = @ARGV;

open (INFILE, "+<$file") || die "Could not open file $file \n";

$idnumhtml = $idnum . ".html";
$output = $idnumhtml;
open (OUTFILE, ">$output") || die "Could not open file $output \n";

@lines = <INFILE>;
foreach $line (@lines)
{
  $line =~ s/id#/$idnum/;
  print OUTFILE $line;
}

close(INFILE);
close(OUTFILE);
