[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 237
  • 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
Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

 
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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