% %p = ('option1' => 'Option 1',
% 'option2' => 'Option 2',
% 'option3' => 'Option 3'
% );
<select name="killer_feature" id="killer_feature" class="select">
% foreach (keys %p) {
% my $selected = param('killer_feature') && param('killer_feature') eq $_ ? 'selected="selected"' : '';
% if (!param('killer_feature') && $_ eq 'option2') { $selected = 'selected="selected"' }
<option value=" <%=$_%>" <%= $selected %>>
<%= $p{$_} %>
</option>
% }
</select>
the above code breaks the app by returning 'Internal server error', but if I smiply edit the very first line to % my %p
(I tried it because some other controls have this format) it works, I wonder whats the difference between the two.
Its a perl app built on Mojolicious web framework.
Many thanks!