in reply to Doing a "Print" to a predetermined location in another file

In the spirit of TMTOWTDI, you could write your stuff in to another file and require it. Though, more out of curiosity's sake, what do you want to put in to your CGI script? Having an external process modify a live CGI could be considered a breach of security, but I'm no expert in such things...

thor

Replies are listed 'Best First'.
Re: Re: Doing a "Print" to a predetermined location in another file
by Donnie (Acolyte) on Oct 12, 2002 at 17:43 UTC
    Dear Thor, Thank you for your response. To answer your question: I have a script that can make certain modifications to a webpage, but the file name has to be "hard coded" into the script before it is run. What I am trying to do is make the script run on any webpage of the users choice, by using another script to select the choice to be made by the user, then plugging it into the main script before it is run. (Am I making sense here?) The user selects the page to be modified in the first script (Got that working just fine) and then plugs the resulting filename to the actual modifying script before it is run as: $filename = "webpagex.html". Thanks for your help. I have some things now to work with and will plod along to see where they lead. With best regards, Donnie
      Though it may require a shifting of gears mentally, I would suggest reading this in from an input box on the webpage, and then have your script called with that as a passed in parameter. Modifiying the code on the fly is dangerous, and creates a possible race condition if two users go for it at the same time. With a passed in parameter, each user gets their own "copy" of the program to do whatever they want to do with.

      thor