in reply to Populating a form with data from a DB

If you want to use the CGI for this, you have two options:
1. Set the value of the parameter using
$q->param("invest_fname", "Joe");

or
2. Use -default and -override when you print the control:
$q->textfield( -name=>"invest_lname", -default=>"Soap", -override=>1 );
Sometimes I show pages containing several forms, so I prefer the latter approach.
(No code was tested in the writing of this answer.)