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


In reply to Perl-CGI refresh with different param(s)?? by jonc

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.