A few comments here that might help you improve the code, maintainability-wise.
I'd use CGI for parsing the input, even if you don't like the code generation functions it provides (you appear to be working with some old docs, or is it an old version of Perl?)
# to duplicate cgi-lib.pl and ReadParse (not that you need to -- you c
+ould use more native CGI.pm methods)
use CGI qw(param);
my %in = map {$_ => param($_) } param;
Instead of that gaggle of print statements, you might check out using "here documents", which work like:
print <<END_OF_HTML;
<html>
<head>
<title>Hi!</title>
</head>
<body>
<h1>Javascript is $in{jstest}</h1>
<p>Isn't that neat?
</body>
</html>
END_OF_HTML
I find that sort of thing easier to maintain and less visually messy (no escaping quotes!)
Oh, and I *strongly* recommend use strict (and strict.pm, for that matter). Also, since this is a CGI, you should use the -T switch on your #! line.
I like your use of the JS form submission, that's a good way around the problem with the cookie solution I suggested!
Philosophy can be made out of anything. Or less -- Jerry A. Fodor |