in reply to PERL and CGI

I'm not 100% sure of your question, partly due to the somewhat confusing formatting.

When you say "outputs a result to the same form in the same HTML page", do you mean an AJAX-like setup, where the page doesn't reload, or do you mean a more traditional CGI setup where the user hits submit and then the page reloads with updates? The two answers are quite different.