in reply to Pass 'posted' data to a 'chained' script

The "right solution" is to write both scripts as functions in a library, and then make your CGI just require (or use) that library and call the appropriate function.

Now your problem goes from how to execute a script and create its environment etc to how to have one function call another.

If you don't wish to take this solution, then your best bet really is to make a local http request, have the data be returned to the first script, and have it echo it along to the webserver. This is definitely not a great approach, which is why I'm recommending the library approach above.

  • Comment on Re: Pass 'posted' data to a 'chained' script

Replies are listed 'Best First'.
Re^2: Pass 'posted' data to a 'chained' script
by nedals (Deacon) on Feb 08, 2005 at 08:14 UTC

    The website, where this is to be used, has around 100 scripts, each independant of the other and many driven by a database. The site is organised such that each user gets a different combination of scripts. I have used the 'library' approach whenever practically feasable.

    What I'm trying to do here is to provide, at login, a different starting page for different groups of users. (6+ differerent pages that do not lend themselves to a 'library' approach )

      It should always be possible to take the library approach. If you're having trouble getting it to work, CGI::Application may help.

      Hmm ... perhaps you are shooting for the BigBallOfMud methodology?

        My initial reaction, after a very brief visit to that link, was that you were being sarcastic and unhelpful. So --
        But I went back for a second visit, and a little more in-depth reading.
        Didn't solve the problem but it did get me thinking..... ( ++ on a couple of your earlier posts. )