Parse form data with a subroutine
Create a form
  1. Create a new Web page with this code:

    <html>
    <head>
    <title>Dream Car</title>
    </head>

    <body>

    <form method="post" action="http://www.yourwebsite.com/cgi-bin/perlscripts/dreamcar.pl">

    <h2>What’s my dream car?</h2>

    Make: <input type="text" name="make"><br>

    Model: <input type="text" name="model"><br>

    <input type="submit" value="Submit">

    </form>

    </body>
    </html>
  2. Save the page as dreamcar.html in the PERLSCRIPTS folder.

Want ad-free tutorials like these for classroom use? Get them at Visilearn.com.