• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 238
  • Last Modified:

query_string

hi experts,
i don't know how to get the query_string
using CGI.pm (oo type)

/cgi-bin/show.cgi?hello

use CGI;
$qs = new CGI;
$any = $qs->param????

how about /cgi-bin/show.cgi?action=add&name=stanley&email=abc@xxx.com
??
please help
0
mwhuen
Asked:
mwhuen
  • 5
  • 4
1 Solution
 
ozoCommented:
($keywords) = $qs->param;
$any = $qs->param($keywords);
$query = $qs->query_string;
$action = $qs->param('action');
$name = $qs->param('name');
$email = $qs->param('email);
0
 
stanleyhuenCommented:
thanks, but ozo can you explain more details to me,
what is meant by
($keywords) = $qs->param;
$any = $qs->param($keywords);

$query = $qs->query_string;
??
0
 
ozoCommented:
$any = $qs->param($keywords); #gets 'hello'
$query = $qs->query_string; #gets 'action=add&name=stanley&email=abc%40xxx.com'
see
perldoc CGI
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
mwhuenAuthor Commented:
why the
()
in
($keywords)=$qs->param;
so important?
if i omit it, it can't show the result.
0
 
ozoCommented:
the () causes $qs->param to be evaluated in list context instead of scalar context
0
 
mwhuenAuthor Commented:
Adjusted points from 5 to 20
0
 
mwhuenAuthor Commented:
sorry,
i am really new in programming,
what is list content and what is scalar context?
0
 
ozoCommented:
see
perldoc perldata
0
 
mwhuenAuthor Commented:
besides run perldoc in unix shell,
where i can read perldoc?
i prefer web page perl doc
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now