How can I read the URL parameter in a Perl CGI program?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For GET requests, CGI parses the specified parameters and makes them available via the
param()method.For POST requests,
param()will return the parameters from the postdata, but any parameters specified via a query string in the URL itself are still available from theurl_param()method. (This is can be helpful when a POST request is larger than$CGI::POST_MAX; in that case, CGI just discards the postdata, but you can arrange to have query string parameters that identify what kind of request it was to provide a good error message.)For ISINDEX style requests, the keywords requested are available via the
keywords()method, as well as viaparam()in a faux “keywords” parameter.Update: in case you meant something other than the parameters by “URL Parameter”, the
url()method provides all or parts of the requested URL; see OBTAINING THE SCRIPT’S URL.