Don't understand your question...
If you mean quote this source code in your HTML, you can write
<!--index.html-->
some header lines....
<code>
you Perl source script...
</ code> <-- no space between / and code
Also, Perl cannot embed to run in HTML (not the PHP style). You will embed HTML in Perl, and Perl prints the output.
If you try to perform the interaction like your console script does in the web way. You will need some study on Perl CGI(google CGI programming with perl). You will need to write <form> to create your input area, and use CGI; to retrieve the data, prints the output