Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: CGI: List all params

by Thilosophy (Curate)
on Dec 12, 2007 at 11:31 UTC ( #656594=note: print w/ replies, xml ) Need Help??


in reply to CGI: List all params

If you are using CGI.pm, you can say

my @names = $query->param;
to get the names of all the parameters (and then proceed to fetch the values one by one).


Comment on Re: CGI: List all params
Download Code
Re^2: CGI: List all params
by Anonymous Monk on Mar 01, 2011 at 07:07 UTC
    Could you explain how we can "proceed to fetch the values one by one"? All I can do right now is just get the list of the variables...but I can't actually get their values. Sorry to reply to such an old post. Thank you in advance!
      but I can't actually get their values. Sorry to reply to such an old post. Thank you in advance!

      That is because you skipped the requisite reading step. CGI. Basically, you give param an argument, it returns values.

      foreach $name ( @names ) { if ( $name =~ /\_/ ) { next; } else { print "

      ".$name."\t=\t".$query->param($name) . "

      \n"; } some thing like this you can do

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://656594]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2014-08-29 11:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (280 votes), past polls