#!/usr/local/bin/perl

die "No file specified" unless ($file = @ARGV[0]);

$src = "$file.src";
$tgt = "$file.html";

open(OUT,">$tgt") || die "Can't write to $tgt";

open(HEAD,"header.html") || die "Can't read header.html";
while(<HEAD>) { print OUT; }
close(HEAD);

open(IN,$src) || die "Can't read from $src";
while(<IN>) { print OUT; }
close(IN);

open(FOOT,"footer.html") || die "Can't read footer.html";
while(<FOOT>) { print OUT; }
close(FOOT);

close(OUT);

system("ls -lt $file.*");

exit 0;