CNS DOCWEB Home
CNS Home Page
CNS Publications Page
Search All CNS Docs

DOCWEB Logo

The CNS FAQ File

Is there a Default array_name in perl for Text Brought in by Forms on the Web?

CNS Document ID: Q1121
Last Updated: 07/15/2005

Is there a Default array_name in perl for Text Brought in by Forms on the Web?

Q:

Is there a default array_name for text that is brought in with a form (on the World Wide Web)? I am using perl on NERSP. Thanks. (TY)

A:

The method by which forms-input data is sent to a CGI script depends on whether the original HTML document specified delivery via the "POST" or "GET" method.

For POST--the newer, preferred method--the data is sent as additional input that your CGI program must read (from stdin); for the older GET method, the data is passed as additional arguments after a "?" at the end of the URL. The forms-input data is not automatically copied from either place into variables/arrays.

To get the data into variables/arrays, you can use any of several widely-available "CGI parsing" utilities/packages, or write the code yourself (not recommended because there are lots of potential security problems to watch for).

For perl programming, the simplest way to access the data is to include the following statement at the beginning of your Perl program:

use CGI qw(:standard);          # standard CGI functions

This will cause the Perl CGI routines which are already installed on NERSP to be callable from your program.

For information on using the Perl CGI routines, please see The Perl CGI Programming FAQ.

Your Comments are Welcome

We welcome your comments and suggestions on this and all CNS documentation. Please send your comments to:


CNS Information Services

2124 NE Waldo Rd, Suite 2100
Gainesville Florida  32609-8922
(352) 392.2061

UF Computing & Networking Services
2124 NE Waldo Rd, Suite 2100
Gainesville, Florida 32609-8922

Phone: (352) 392.2061
E-mail: editor@cns.ufl.edu

CNS DOCWEB Home
CNS Home Page
CNS Publications Page
Search All CNS Docs