Perl source code is executable and the source should be in cgi-bin so the source cannot be seen, only executed by the web server. The HTML the Perl prints is sent to the browser so it is always visible as the source of the displayed document.
Comment on Re: How to get the controls in an application?
In Usage of perl scripting in Testing, you ask about testing. Some of what you want to do can be accomplished with some testing frameworks. I think that there is something like mechanize for Win32, maybe selenium, or others.