sub getInvest { my $investID = shift || return {}; # grab row from database with fethrow_hashref() return \%invest; } sub defaultNewInvest { my $q = shift; my $fillIn = getInvest($q->param('investID')); # ... $q->td( ["Title:", $q->textfield(-name=>"invest_title", -size=>40, -value=>$fillIn->{'invest_title'} )]) ]); }