in reply to URL linking within script
Try checking out CGI::Application. It's a framework for doing what you're implementing here (multi-page CGI applications (thus the name)), and it automates several of the tasks you may have to do eventually.
In Section
Seekers of Perl Wisdom