#!/usr/local/bin/perl
$sname = ($ENV{'REMOTE_ADDR'});
use XML::Simple;
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
$ua->agent("MyApp/0.1 ");
# Create a request
my $req = HTTP::Request->new(GET => 'http://anderbr.duc.auburn.edu/gwextranet/scp.dll/newlist?user=ceacadm,cealumn,ceathle,cecarer,ceconfs,cecultr,cegenrl,cespkrs,cestdnt,cewrksp&template=raw2');
$req->content_type('text/html');
$req->content('match=www&errors=0');
# Pass request to the user agent and get a response back
my $res = $ua->request($req);
# If being run from the web prime the browser
if ($sname ne "") {
   print "Content-Type: text/html\n\n";
}
# Check the outcome of the response
if ($res->is_success) {
    open (DBASEFILE, ">/tmp/temp_xml");
    print DBASEFILE $res->content;
    close (DBASEFILE);
    my $res_xml = XMLin('/tmp/temp_xml', forcearray=>1);
    print XMLout($res_xml);
} else {
    print "Bad luck this time\n";
}

 
