The popup_menu method wants an array of values (which will be passed back to you by the browser), and optionally an associative array that maps those values to labels (which will be what the user sees). Your associations are reversed, however. The contents of the values array should be keys in the labels hash, but you have your labels as keys instead. So, I think what you're shooting for here is:
%menu_labels = ('one'=>'eenie',
'two'=>'meenie',
'three'=>'minie');
@menu_values = ('one', 'two', 'three');
print $CGI->popup_menu(-name=>'menu_name',
-values=>\@menu_values,
-labels=>\%menu_labels);
...unless you mean for the user to see "one, two, three". In that case:
%menu_labels = ( eenie => 'one',
meenie => 'two',
minie => 'three', );
@menu_values = qw( eenie meenie minie );
print $CGI->popup_menu(-name => 'menu_name',
-values => \@menu_values,
-labels => \%menu_labels);
About your bracket problem, have a look at Writeup Formatting Tips (specifically, put <code>...</code> tags around your code). |