The browser is waiting for an HTML page as a result of the HTML page request it sent to the HTML server.
Your script is supposed to always return a valid HTML page to the browser, hopefully containing valid information but if necessary containing general information about the type of error detected and indicating what the user should do.
The page should not contain Perl related data dumps, variable names, etc. since this could potentially give an evil visitor a hint of how to deliberately break your script.
Everything went worng, just as foreseen.