#!/usr/bin/perl -w
use strict;
use CGI;
my $q = new CGI;
my $subbut = $q->param("submitbut");
my @inventory = qw(books paper pencils erasers);
print $q->header;
print $q->start_html();
my %qty=(); my %inv_prices=(); my %inv_weights=();
if ($subbut eq 'Submit') {
foreach (@inventory) {
my $qty = $q->param("quantity$_");
$qty{$_} = $qty;
}
print "
| $_ | "; print "$qty{$_} |