0

I can get variables from an html page into my perl cgi script just fine, but I want to process these variables (also works), and pass them to another cgi script. I'm not sure how though.
I've tried to set up a new <form> inside of my perl script to act as a pseudo-html page to pass into the next script, but to no avail.


Here is a sample that illustrates what I'm trying to do:

#!/usr/bin/perl

use CGI ':standard';

$q=$ENV{QUERY_STRING};

if ($q =~ /x=(\d+)/) {$x=$1} 
if ($q =~ /y=(\d+)/) {$y=$1}

$z=$x * $y;

print <<EOT;
Content-type: text/html\n\n

The product of $x and $y is $z <p>


EOT


print <<EOT;
<p><p>
This is where I'm trying to pass back $z to another cgi script.

<form action="http://localhost/cgi-bin/test2.cgi">
<input name="z">
<input type="submit" value="submit">
</form>

EOT

exit;

Thanks!

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by PaulieWauly
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.