Parse form data
  1. Create a new script with this code:

    #!/usr/bin/perl
    print "Content-type: text/html\n\n";

    &getFormData;

    print "<h2>Here’s my dream car:</h2>”;

    print "Make: $request{'make'}”;
    print "<br>\n";
    print "Model: $request{'model'}”;

    # Subroutine below this line.

    sub getFormData {

    read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
    @pairs = split(/&/, $buffer);
    foreach $pair (@pairs) {
    ($name, $value) = split(/=/, $pair);
    $value =~ tr/+/ /;
    $value =~ s/%([a-fA-F0-9][a-fA-F0-
    9])/pack("C", hex($1))/eg;
    $value =~ s/\n/ /g;
    $request{$name} = $value;
    }
    }