in reply to Dynamically marking a HTML select option as selected

Quick and dirty way: Just use a regexp to add in the 'selected' string if your default value exists. You may want to do some extra error checking too, like making sure that your default value is a valid option.
my $parameter_value = "option2"; # Your default value from the DB my $parameter_select = qq( <select name="parameter"> <option value="option1">Option 1 <option value="option2">Option 2 </select> ); # your select statement string if ($parameter_value) { $parameter_select =~ s/value="$paremeter_value"/value="$paremeter_va +lue" selected/; }