foreach $val @params { if ($val =~ /^question(\d+)/) { $questions[$1] = $q->param($val); } }