Solved

query_string

Posted on 2000-04-08
10
228 Views
Last Modified: 2013-12-25
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
Comment
Question by:mwhuen
  • 5
  • 4
10 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 20 total points
Comment Utility
($keywords) = $qs->param;
$any = $qs->param($keywords);
$query = $qs->query_string;
$action = $qs->param('action');
$name = $qs->param('name');
$email = $qs->param('email);
0
 

Expert Comment

by:stanleyhuen
Comment Utility
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
 
LVL 84

Expert Comment

by:ozo
Comment Utility
$any = $qs->param($keywords); #gets 'hello'
$query = $qs->query_string; #gets 'action=add&name=stanley&email=abc%40xxx.com'
see
perldoc CGI
0
 

Author Comment

by:mwhuen
Comment Utility
why the
()
in
($keywords)=$qs->param;
so important?
if i omit it, it can't show the result.
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
the () causes $qs->param to be evaluated in list context instead of scalar context
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:mwhuen
Comment Utility
Adjusted points from 5 to 20
0
 

Author Comment

by:mwhuen
Comment Utility
sorry,
i am really new in programming,
what is list content and what is scalar context?
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
see
perldoc perldata
0
 

Author Comment

by:mwhuen
Comment Utility
besides run perldoc in unix shell,
where i can read perldoc?
i prefer web page perl doc
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now