|
|
|
Who is this For?
This is for those learning to use the CGI module in Perl. What you Need to have by now Checking if you have the CGI module What does the CGI module do? The CGI module allows you to generate HTML pages without really coding the HTML statement. You do this by calling CGI functions. I find this convenient because you do not need to fully know the HTML syntax. Aside from this, the CGI module performs housekeeping functions internally so you do not need to worry about things like cleaning up the QUERY_STRING or input string, printing out the header and termination records, etc. Let us start If you do not use the CGI module, you will have to do housekeeping stuff for your input ($ENV{QUERY_STRING} and from <STDIN>). With the CGI module, this is done automatically for you. In fact, the parameters passed to your script are broken up automatically for you. You access the parameters using the param function. To find the parameters passed to your script, you call the param function without any parameter. This returns a list of parameters passed to your script. To find the value of a given parameter, you call the param function with the name of the parameter. $value = $c->param('NAME'); # get the value of the NAME parameter. Generating other Tags $c->b('This line is in bold'); The result is: Go To Page: 1 2
The copyright of the article CGI Programming (Part 4) in Perl is owned by . Permission to republish CGI Programming (Part 4) in print or online must be granted by the author in writing.
|
|
|
|
|
|
|
|