use HTML::FormFill; print HTML::FormFill->fill(html => $html, fields => $hashref, target => 'form_name', selects => {select1 => $AoH_ref, select2 => $Aoh_ref});