in reply to how do I redirect to a previous page in my CGI script

At the appropriate point in your CGI have a print qq(<meta HTTP-EQUIV="REFRESH" URL="someurl" CONTENT="0"/>);
That is how you would do it if you aren't using CGI.pm which you should be actually. Using CGI.pm you would do this:
print $query->redirect(-uri=>'http://somewhere.else/in/movie/land', -nph=>1);
I just thought you might like to see both ways to get a better idea of what you are working with. Bottom line is that you should use CGI.pm.