print $cgi->textfield(As you can see, the first three attributes are pulled from the the general form attributes section - remember that those form attributes can be used in any of the form field types. The first new one we'll look at is -size. This translates to it's HTML equivalent size="55" which sets the actual character width of the form field itself. This is purely a visual setting and will not change how many characters the field uses.
-name => 'first_name',
-id => 'first_name',
-value => 'Bob Smith',
-size => 55,
-maxlength => 128 );
-maxlength however, sets a cap on the number of characters allowed in a specific field. In the above example, the HTML equivalent is maxlength="128", which will disallow a form value of more than 128 characters. One thing to remember about this, is that it only sets the maxlength on the interface itself. This could be bypassed by directly submitting a POST to the processing script. Do not use maxlength as a replacement for proper input validation on the server side.
Here is what the above example produces in plain HTML:
<input type="text" name="first_name" value="Bob Smith" size="55" maxlength="128" id="first_name" />

