1. You're supposed to just escape single quotes, what you do could create problems:
Code:
unless($fullInfo=~m(qw!INSERT DELETE TABLE SELECT USER PASSWORD UPDATE UNION!)){
Those are just some VERY basic SQL keywords, but there's plenty more I could use to cause damage; DROP, TRUNCATE, GRANT, REVOKE, CREATE, etc..
2. k.
3. Because there's no good reason to use Perl other than "I felt like it"; it's slower when used as a CGI module than PHP and less popular.
4. There's no security-related reason to do so; just convert tags to its HTML entities and escape single quotes and you've taken care of XSS and SQL injection.
5. Your provided page isn't compliant with any sort of standard (As pointed out already, XHTML or otherwise; no DTD is specified).
Code:
sub writeit($x,$y,$z){
open (ACCOUNTS,">accounts.txt");#appending#
print ACCOUNTS "\n","$user\n","$password\n","$email\n";
close(ACCOUNTS);
print $q->header("text/html"), $q->start_html("SUCCESS!"),$q->h1("SUCCESS!"),$q->end_html();
die "WIN!";
}
6. What's the point in using a file list to handle registration? Flooding with file IO requests would be easy since you don't have any CAPTCHA either, for one. For two, now the administrator must process this file list when adding users to the database, which you could do directly using Perl.
You don't even touch the database and you call this a registration script? lmao, why even check for SQL injection attempts?