in reply to How to exit subroutine and go to Beginning of CGI Script?

My first comment is that the way you are asking this question leaves a ton of room for interpretation.

If your "subroutne" is in a seperate .pl file how are you calling it? For sake of discussion I will assume you are doing something like:

In that case if I want to start my script over again with no regard to "state" or values of variables then within foo() I would simply

Otherwise it gets slightly trickier. Check out the CGI.pm documentation and look at the redirect method. Yould do something like:


Peter L. Berghold -- Unix Professional
Peter at Berghold dot Net
   Dog trainer, dog agility exhibitor, brewer of fine Belgian style ales. Happiness is a warm, tired, contented dog curled up at your side and a good Belgian ale in your chalice.