
FishMonger
Veteran
/ Moderator
Feb 7, 2017, 7:21 AM
Post #2 of 3
(2808 views)
|
Re: [sash99] how to send multiple arguments to perl in cgi
[In reply to]
|
Can't Post
|
|
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)
|