O'Reilly logo

Sams Teach Yourself CGI in 24 Hours, Second Edition by Rafe Colburn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Decoding Form Data via CGI.pm

The most common usage of CGI.pm is to decode form data. In fact, in many CGI programs, that’s all it’s used for. As soon as you import the CGI.pm module, all the input from the form is automatically translated and made accessible through the param method.

In most cases, the translation from form field to Perl variable is obvious. A group of radio buttons called favorite_color is accessible through param('favorite_color'). A text input field called name is accessible through param('name'). There are three special cases that merit individual discussion when it comes to translating form input into a Perl data structure. These three cases are image input fields for which names are specified, select lists that allow ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required