I would say it would be best to have just one perl program to make it easier to save the state of the variables across the form; you could have a function that would find the next question by a call like this:
ask_question(@answers_so_far). The
@answers_so_far variable would just be an array of the current answers, in any format suitable for your program(a suggestion, though I don't know the input, questions, etc., would be for the element to be like this "1:a" for question one, answer a, to make an easy split, though you could have parallel arrays, or even a hash for something similar, TIMTOWTDI). You asked, aslo:
if so how do I go about saving all the variables
Well, in the one-script example, you could just have a global array(or whatever you are storing the answers in), and other variables global as mandated by the problem. However, if you mean that you want to save them for each user, consider using cookies, or a variety of other methods(described in O'Rielly's CGI/PERL book, and across countless nodes, I suspect, on this site).
I hope I've answered the question sufficiently, if not just ask again.
UPDATE: I forgot to mention(though as sifmole said) check out some of the modules on CPAN, and read CGI.pm's docs for form generation tips, etc.