#!/usr/bin/perl -wT
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use strict;

print header;
print "<html><head><title>Daniel Abadi's Publications in Bibtex Format</title></head><body>\n";
open(FH,"/fs/wwwusers/abadi/pubs/abadirefs.bib") or &dienice("Can't open users file: $!");
while(<FH>) {               #loop as long as not EOF
    my $a = $_;                   #loop variable -- contains current line
    my @b = split(' ', $a);
    if ($b[0] eq "\@inproceedings{osprey,") {
        last;
    }

    if ($b[1] eq "=") {
	if (($b[0] ne "abstract") && ($b[0] ne "url_Paper") && ($b[0] ne "pdfKB") && ($b[0] ne "publicationtype") && ($b[0] ne "award") && ($b[0] ne "url_Slides") && ($b[0] ne "iis1527118")&& ($b[0] ne "iis1920613") && ($b[0] ne "iis1718581") && ($b[0] ne "displayCategory") && ($b[0] ne "nsfclue") && ($b[0] ne "iis0845643") && ($b[0] ne "iis1249722") && ($b[0] ne "note") &&  ($b[0] ne "venue"))  {
	    print $a, "<br>\n";
	}
    }
    else {
	print $a, "<br>\n";
    }
}
close(FH);
print "</body></html>\n";

sub dienice {
    my($errmsg) = @_;
    print "<h2>Error</h2>\n";
    print "<p>$errmsg</p>\n";
    print end_html;
    exit;
}
