Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: retrieve dynamic form data

by philcrow (Priest)
on Nov 22, 2005 at 21:17 UTC ( [id://510909]=note: print w/replies, xml ) Need Help??


in reply to retrieve dynamic form data

There are lots of ways to do this. Usually your helper (like CGI.pm) will provide the parameters as a hash if you ask nicely. The details depend on what helper you use. In CGI you could say:
use CGI ’:cgi-lib’; $params = Vars;
This returns a hash ref. (mod_perl, which I use, has a similar scheme.)

Then you can simply delete the submit key from that hash (unless it's read only, then make a copy first). Finally, loop through the keys of the hash.

Phil

Replies are listed 'Best First'.
Re^2: retrieve dynamic form data
by kutsu (Priest) on Nov 22, 2005 at 22:44 UTC

    actually it returns a hash not hash ref so: %params = Vars; #or using OO method $cgi = new CGI; %params = $cgi->Vars;

    "Cogito cogito ergo cogito sum - I think that I think, therefore I think that I am." Ambrose Bierce

Re^2: retrieve dynamic form data
by Anonymous Monk on Nov 22, 2005 at 22:20 UTC
    I tried this but it failed under strict. I used my $var = Vars(); to see if that worked, and it didn't bring values back into a hash %var.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-03-29 06:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found