#!/usr/local/bin/perl
#
# echo.cgi - echo back all CGI arguments
# written by Lawrie Brown / 21 Aug 2000

# use new Perl5 CGI module, sending errors to browser
use CGI;
use CGI::Carp qw(fatalsToBrowser);

# create a new CGI object to handle this request
$q = new CGI;

# display standard HTML header stuff
print $q->header,
      $q->start_html('Echo CGI'),
      $q->h1('Echo CGI');

# get a list of all parameters (fields) passed to us
@names = $q->param;

# now display a DL with params and values
print "<HR>";
print "<DL>";

# loop over all the param names (sorted)
#   displaying each name and associated value
foreach $n (sort @names) {
    print "<DT><B>$n</B>";
    print "<DD>", $q->param("$n");
}

print "</DL>";
print "<HR>";

# and finish up with the HTML trailers
print $q->end_html;

# all done, go away!!!
