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!

Nevermind. I solved it.

How did you solve this buddy?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.