I'd use an array mapped to a hash to check existance of user - easier maintenancea-zA-Z0-9_ == \w
If you're loading CGI, you might as well use it for output:my %sysuser = map { $_ => 1 } qw(administrator accounts support postma +ster webmaster spam-admin technical billing sales purchase buy misus +e assistance mail virus-admin manager usenet hostmaster); if (defined $sysuser{$username}) {
etc.$w->p('Please Accept The Terms And Conditions.'); print $w->header. $message;
From a style view, (personally), I'd use @error to store errors:
then check withmy @errors=(); ... push @errors, 'Password Must Be Between 6-30 Chars With No Symbols.';
Note, most people use $q(uery) or $cgi for the CGI object you might want to do the same, especially when you want to read up CGI tutorials here. It might help :)if (@errors) { print $w->header. join '', map { $q->p($_) } @errors; exit(0); } # you only need one cgi object $w->redirect();
Note - above is untested for exact syntax, but that's the general idea. And yes, use SSL!
But overall, I think you've done a pretty good job if you're new to Perl :)
.02
cLive ;-)
In reply to Re: CGI script review
by cLive ;-)
in thread CGI script review
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |