print "Content-type: text/html\n\n"; # Setup the header for the browser my $name = param("name") || ''; # Allow only numbers, letters and _ if ($name && $name !~ m/^[0-9A-Za-z_]+$/i) { print 'Error: Bad input Format'; exit; # Stop script }