CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: General Discussions: General Questions: Re: [sash99] how to send multiple arguments to perl in cgi: Edit Log



FishMonger
Veteran / Moderator

Feb 7, 2017, 7:21 AM


Views: 4219
Re: [sash99] how to send multiple arguments to perl in cgi

In a cgi environment args are passed as key/value pairs. Multiple pairs are separated by the & key.

Submitting these args to the script can be done with either a GET request or a POST request and would be retrieved/parsed differently. So accessing them via the @ARGV array would not be the correct method.

CGI is very outdated, but if you want to use it, you should use the CGI module. It has a param() method which is able to retrieve the args from either a GET or POST request.
https://metacpan.org/pod/distribution/CGI/lib/CGI.pod

Why did you comment out the use strict; statement? You should have that in every script.


(This post was edited by FishMonger on Feb 7, 2017, 7:22 AM)


Edit Log:
Post edited by FishMonger (Veteran) on Feb 7, 2017, 7:22 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives