On Fri, 19 Oct 2001, Pereira, Adrian non Unisys wrote:

> This is fairly easy to do.  Script one can set the information in
> environment variables and script two can pick them up as follows:
>
> script1.pl
>
> $ENV{VAR1}='data element1';
> $ENV(VAR2) = 'data element2';
> system('/somepath/script2.pl');
>
> script2.pl
>
> $x1 = $ENV{VAR1);
> $x2 = $ENV(VAR2);
>
> $x1 and $x2 now contains information from the first script

I know this is off topic for this list, but...

I would not recommend making system calls or using operating system
environment variables like that on CGI scripts -- it just smacks of
security holes.  I would recommend either combining the scripts into a
single script (heck it's all Perl, why do you need 2 separate scripts to
process data from the same form?), or use session variables or similar
kind of persistance (i.e., a database) to get data from script to script.
The OP said MySQL was being used (and this is a DBI list!) -- then the
first script should validate the data, get it into the database, and the
second script should pick up some kind of id from the first script (via a
session, cookie, URL path, whatever) and retrieve the data itself.

-- Brett
                                          http://www.chapelperilous.net/
------------------------------------------------------------------------
This login session: $13.99

Reply via email to