Please send questions to st10@humboldt.edu .
#!/usr/bin/perl -w

#######################################################
# lect10_05.pl
#
# will this save the info from the form on lect10_05.html,
#    now with the help of CGI.pm?
# (and will fatal errors be passed on to browser,
#     and errors to the lect10_05_sent_info file?)
#
# by Sharon Tuttle 
#
# last modified: 11-02-04
#######################################################

use CGI qw(:standard);

#1
use CGI::Carp qw(fatalsToBrowser warningsToBrowser carpout);

warningsToBrowser(1);  # activate warnings

#2 
# putting this in BEGIN block now, because carpout() call
#    is supposed to be in such a block to catch compiler
#    errors and write them to HTML INFO
#
# open HTML_INFO, ">> lect10_05_sent_info"
#    or die "Cannot open lect10_05_sent_info: $!";

BEGIN
{
   open HTML_INFO, ">> lect10_05_sent_info"
      or die "Cannot open lect10_05_sent_info: $!";
   carpout(HTML_INFO);
}

# remember: function param() returns a list containing the names
#    of all the parameters from the form

print HTML_INFO "----------------------------------------------\n";
print HTML_INFO "\nHere are fields and their values:\n";
foreach $parameter (param)
{
    print HTML_INFO "   $parameter => ", param($parameter), "\n";
}

# just to try to tell different "calls" printouts apart;
print HTML_INFO "\n";
print HTML_INFO "END **********************************************\n";

close HTML_INFO;

# try to send back a confirmation page

print header, "\n";

print start_html(-title=>'Confirmation'), "\n";
print "<h1>Confirmation<\h1>\n";

print "<hr>\n";
print "Information transferred?<br>";

print "name given was: ", param('desired_label'), "\n";

print end_html, "\n";

# end of lect10_05.pl