jonc has asked for the wisdom of the Perl Monks concerning the following question:
Hello and thanks for your time,
I have a Perl script that is called when a user selects some "radio" buttons and enters a searchword in text. When the output is returned, I would like to provide the user some hyperlinks that will allow them to redo the search with different radio buttons pressed (without having to go back and do it manually). The same searchword (inputted 'query') is to be used.
Example Perl script:
my $search_key = param('query'); my $c_verb = param('verb_only'); my $c_enabling = param('enabling'); m +y $c_subject = param('subject'); my $c_object = param('object'); my $c_prep = param('prep'); my $c_adj += param('adjective'); my $c_modnoun = param('modnoun'); my $category_id; my @all_matches; ## RESULTS OF SEARCH if ($c_verb eq 'on') { if ($c_enabling eq 'on') {$category_id = 'xcomp';} elsif ($c_subject eq 'on') {$category_id = 'subj';} elsif ($c_object eq 'on') {$category_id = 'obj';} elsif ($c_prep eq 'on') {$category_id = 'prep';}
Say, the first time, $c_enabling was 'on'. I would like a hyperlink to a search where $c_subject is 'on' but $searchkey is the same.
I've read the CGI module on CPAN (url() or self_url), and a bit about POST and GET, but it is all new to me.
Thanks again, and let me know if this is unclear
Also, this has been extended(I'm sorry, I didn't know this was discouraged, I thought starting fresh would be better for a second opinion) at: http://stackoverflow.com/questions/6418292/how-do-i-substitute-unseen-name-value-pairs-from-radio-buttons-in-my-cgi-script
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl-CGI refresh with different param(s)??
by 7stud (Deacon) on Jun 20, 2011 at 20:23 UTC | |
by jonc (Beadle) on Jun 20, 2011 at 21:03 UTC | |
by 7stud (Deacon) on Jun 20, 2011 at 21:20 UTC | |
by jonc (Beadle) on Jun 20, 2011 at 21:29 UTC | |
by 7stud (Deacon) on Jun 20, 2011 at 21:47 UTC | |
by jonc (Beadle) on Jun 21, 2011 at 18:59 UTC | |
|
Re: Perl-CGI refresh with different param(s)??
by Your Mother (Archbishop) on Jun 20, 2011 at 20:31 UTC | |
|
Re: Perl-CGI refresh with different param(s)??
by 7stud (Deacon) on Jun 20, 2011 at 20:39 UTC | |
by Your Mother (Archbishop) on Jun 20, 2011 at 21:09 UTC |