#!/tik1opt1/bin/perl
# This script filters an error files.
# All *errors* are written to stderr.
# All *warnings* are written to stdout.

#bibclean, bibparse and bibxmparse prefixes all errors with "??" and all
#warnings with "%%".

select STDERR;
print "<meta http-equiv=\"expires\" content=\"0\"><html><body bgcolor=\"ffffff\">\n";
select STDOUT;
print "<meta http-equiv=\"expires\" content=\"0\"><html><body bgcolor=\"ffffff\">\n";

#Reading the input file
$text = "";
LINE:
while (<>){


#Printing error messages to stderr
if(/^\?\?(\.*)/){
  select STDERR;
  print "<p>$_</p>";
  select STDOUT;
}
elsif(/^\%\%\.*/){
  print "<p>$_</p>";

}
}
select STDERR;
print "</html></body>";
select STDOUT;
print "</html></body>";
