Password Field Demo: Alternate Form
#!/usr/bin/perl -w

use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);

print header, start_html("Password Demo"), h1("Password Fields!");
print start_form(),
      p("Password:"),
      password_field(-name => "password", -rows  =>  1), 
      submit(-name => "Submit"),
      end_form;

if (param("password") && param("password") !~ /^(whassup|foobar|duh|heyman)$/)
{
    print p("You are not one of the good guys!!");
}
elsif (param("password") =~ /^(whassup|foobar|duh|heyman)$/)
{
    print p("You are on the good guy list!!");
}

print end_html;