Here's the source code for a Perl CGI textfield example (a Perl form example). The Perl code below shows how you can display an HTML form with a textfield using the Perl CGI.pm module.
The first time this script is called it displays a textfield in a form. After you submit the form, this script displays the text that you entered in the textfield.
Here's the source code for this CGI.pm "Perl form" textfield example script: