#!/usr/bin/perl -wT
use strict;
use CGI qw(:standard);
 use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
# To prevent security problems comment out CGI::Carp once this software ready. 
use LWP::Simple 'get';

print header;

my $URL = 'http://web.plattsburgh.edu/academics/compsci/faculty/index.php';
my $content = get($URL);
if ($content =~ m#(<table.*</table>)#s) {
   my $title = "Computer Science Faculty and Staff";
   print start_html( -title => $title, -style => {-src => '../../styles.css'});
   print h1($title);
   print "\n";
   print '<div class="chapter" id="faculty">';
   $content = $1;
   $content =~ s#<p>|</p>##sg;
   $content =~ s#(<a\shref="http://web.*?Learn.*?</a>)#<span class="noprint">$1</span>#sg;
   $content =~ s#(href="http[^>]*)>#$1 target="_blank">#sg;
   print $content;
   print '</div>';
   print '<div style="page-break-after:always;"></div>';
   print end_html();
} else {
   print $content;
}

