in reply to Dynamically marking a HTML select option as selected

How about
$html .= qq{<select name="my_parameter">\n}; for my $option ( ['option1', 'Option 1'], ['option2', 'Option 2'], ['option3', 'Apple pie'] ){ if ($option->[0] eq $existing_value){ $html .= qq{<option value="$option->[0]" selected>$option->[1]</opti +on>\n}; }else{ $html .= qq{<option value="$option->[0]">$option->[1]</option>\n}; } } $html .= "</select>\n";
The inside could be rewritten as:
$html .= qq{<option value="$option->[0]"} . ($option->[0] eq $existing_value ? ' selected' : '') . qq{>$option->[1]</option>\n};
And you should think about using entities, 'cause an $existing_value with a " in it isn't going to make you happy...

2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$