Please read I know what I mean. Why don't you?
Then read Short, Self-Contained, Correct Example.

That said, if you retrieve xxx.cgi?action=one&reaction=two, the following

#!/usr/bin/perl use CGI; my $query = CGI->new; my $action = $query->param('action'); my $reaction = $query->param('reaction'); print $query->header, $query->start_html, "<h1>Result</h1>\n", "Action: ", $action || "no action", "<br>", "Reaction: ", $reaction || "no reaction", $query->end_html;

will - if the webserver is correctly configured, if xxx.cgi has the correct permissions etc - serve a page reading:

Result

Action: one
Reaction: two

Now let me comment the snippets you posted.

my GetLink = 'one&reaction=two'; query string xxx.cgi?action=' + GetLink;

doesn't compile. Running that yields:

No such class GetLink at - line 1, near "my GetLink" syntax error at - line 1, near "my GetLink =" Can't find string terminator "'" anywhere before EOF at - line 2.

Then,

my $query = new CGI; my $action = lc ($query->param('action')); ....... elsif ($action eq "one"){ my ($string1, $string1 ) = @_; my ($string2, $string2 ) = @_; warn("string2 = '$string2'");

declaring a variable twice as in my ($string1,$string1) makes no sense at all. The special array @_ should only be used inside a subroutine and contains its arguments, if any. See perlvar and perlsub. Actually, don't see, read those pages.

Lastly,

elsif ($action eq "one"){ my $query = CGI->new(); my $string2 = $query->param('reaction'); warn("string2 = '$string2'");

here you are masking the outer $query with a new CGI object inside the elsif block. Why?

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

In reply to Re: .cgi?action params by shmem
in thread .cgi?action params by tultalk

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.