Philip Pawley wrote:
I am calling 2 scripts separately using server-side includes. I want to reuse the variables from the first script in the second.

I am very much aware that I need to do more reading. Where do I look for the answers to this particular question?

You will need to look to saving state in Perl. Because two includes are independently run programs you will have to store the variables to some 'solid' state until the second include, and then you will have to test to make sure that it is still there, etc. when you get to the second state. You are also going to run into the problem of unique names, aka you are going to have to find something unique about the first session that the second session can determine to know what state file to read, which is going to be tricky but could possibly be done.

Two places to start are with Storable and FreezeThaw.
http://search.cpan.org/author/AMS/Storable-2.06/Storable.pm
http://search.cpan.org/author/ILYAZ/FreezeThaw-0.43/FreezeThaw.pm

You may also want to look into Apache::Session, as I believe it might work since both includes are in the same page, then theoretically it should be within the same Apache session (assuming you are using Apache) but I haven't used it before.

http://search.cpan.org/author/JBAKER/Apache-Session-1.54/Session.pm

In general I would just handle this with a single CGI script that reads the HTML and drops in the content where I needed it to, but there a number of reasons why you may not have this luxury......

HTH,

http://danconia.org


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to