in reply to subroutine help

You could probably just require the other cgi script. This will run the other cgi script, then return to the main cgi.

It looks like there is probably a better way to do what you want. gjb's idea looks like a good way to go.