One of the things that gets passed is the results of the form. The other is information after the ? in the path above(?filename=$Answerfile). It gets taken care of by the following code at the beginning of the script:

my $Answerfile = param('filename'); #This is how the Answerfile path is passed

Do you know how I can pass both of these things (the path and the results) to this script? They seem to conflict with each other. FYI, the reason this script calls itself is because it implements frames (it is a online quiz). One subroutine does the frame HTML, another makes the question/form window, and the last one makes results frame. Also, as you may have guessed by now, I'm using CGI.pm.

For those of you who want to see my entire script, here it is (keep in mind, I'm new at this): Thanks in advance for any help you guys can provide. Dave

There are a few problems with the code posted here. I mean you are definitely off to a good start using CGI.pm but the methods you are using are a little flawed. If you want to import the :standard set of functions you do not have to make a reference to CGI.pm to use it. This is not the recommended way to use the module sense you could inadvertently redefine one or more functions provided by CGI.pm. So you would do this use CGI; $query = new CGI;From there you would reference all the functions from $query. OK now for making a frameset to print like you want it to. You would either do a switch or a few if elsif calls at the top of your code. $query->param() can be used to get the query string (the stuff after the ? in the url). Here is what your frameset would look like <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>

Now at the top of your cgi you would test $query->param('action') to see which subroutine to call. If this is left you would print the left frame. If this was right you would print the right frame. If there were no parameters eg.<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>

if( not $query->param) {</pre><HR></BLOCKQUOTE> you would call the frame set subroutine. Now for when the form is submitted. I noticed you put a query string on the form action. This is not recommended. Use a hidden field instead. Like this: <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>

<input type=hidden name=action value=submit></pre><HR></BLOCKQUOTE> So at this point you would have 4 things to test at the top of your script. It would look something like this<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>

if (not $query->param) { &print_frameset } elsif ($q->param('action') eq 'left') { &print_query } elsif ($q->param('action') eq 'right') { &print_right_frame } elsif ($q->param('action') eq 'submit') { &print_response } else { die "Action not understood!" }</pre><HR></BLOCKQUOTE> I added the print_right_frame there because you will need some default frame page for that frame. Anyway that should do it. If you need a more detailed explanation on this or if there is something you need me to clarify let me know.

Thank you Scott for your help. I'm afraid I do need some clarification.

First of all, I don't understand how $Answerfile will be passed into the script. I do not want $Answerfile defined in the script because I want to be able to create my text answerfile and then make the online quiz by making a URL with a query string like this: http://scriptURL/scriptname.pl?filename=path/quiz12.txt

The URL above is how I have been planning to use the script. Then, inside the script I have this to define the $Answerfile:

my $Answerfile = param('filename');

I want to be able to open and use $Answerfile in both frames. How can I pass both filename and action into my frames?

The other part I don't understand is the part about a hidden field for the form. I don't know where it would go. Could you show me what you mean by modifying the following form block?:

The one thing that is really holding me up on this program is when I click on the submit button on the form. Those parameters get passed to the result frame, which is good. But I'm also passing the filename query string because I need to be able to look at $Answerfile in the results frame. That query string seems to conflict with the answers I submitted from the forum. Maybe you addressed this issue with the hidden field item, but I don't understand it yet.

In the meantime, I have started to make the other changes you suggested. I really appreciate all of your help.

I am sory I misunderstood. It will still be basicaly the same process though. You will pass the original variable along with hidden fields. I would modify what you said to show you this but I have never used the built in functions of CGI.pm to make html. Here is what it would look like if I did it.

$query->startform(-action=>"$script_name/results?filename=$Answerfile", -TARGET=>"results");</pre><HR></BLOCKQUOTE> For the URL calles in the frameset you would use something like this. <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>