b1rd has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I'm newbie in cgi. I have following problem. I have one cgi script where is:

print td([$hash_ref->{name}, a({-href=>'https://xxx.xy/cgi-bin/test.cgi'},$hash_ref->{ip}]),Tr   etc

I would like to call test.cgi in new page, when I click on IP address. I want to display in this new page for example the IP address which was clicked.

So, my problem is, that I don't know how to pass informations from one script to other to show informations in the new page.

many thanks

p.s. sorry for my english

janitored by ybiC: Balanced <code> tags around snippet, minor formattting cleanup

Replies are listed 'Best First'.
Re: problem with CGI
by Jaap (Curate) on Sep 30, 2003 at 09:23 UTC
    Passing information to a script goes like this:

    link: http://xxx.com/cgi-bin/test.cgi?key1=value1&key2=value2

    Then the script can read it using the CGI.pm module:
    #!/usr/bin/perl -w use strict; use CGI; my $cgi = new CGI; print $cgi->param('key1'); ### prints: value1 print $cgi->param('key2'); ### prints: value2
      thank you,

      could I use as value1 perl variable e.g. $test?
      because this variable stores value of IP address which I want to display. if no how could I do this?

      thanks

        b1rd you could easily pass $test, if you want everyone to see it like this:

        print "<a href=\'http://www.foobar.com?${test}\'>\n";

        but I would recommend you read Ovid's course and esp. Part 4 which talks about encription.

        Update: Changed & to ?

        "Pain is weakness leaving the body, I find myself in pain everyday" -me