in reply to Defining Lable for a field

I think you want

use CGI; my $q = CGI->new(); my %labels = ('black' => 'Black', 'brown' => 'Brown', 'red' => 'Red', 'yellow' => 'Yellow'); print $q->popup_menu( -name => 'Summary', -values => ['black','brown','red','yellow'], -default => 'red', -labels => \%labels ); # alternatively, without named params print $q->popup_menu( 'Summary', ['black','brown','red','yellow'], 'red', \%labels );

Replies are listed 'Best First'.
Re^2: Defining Lable for a field
by mld (Acolyte) on Apr 21, 2009 at 13:57 UTC

    No i wanted to assign lable for the controls

      Which controls?

      The above snippet creates the following output, which looks just fine to me:

      <select name="Summary" > <option value="black">Black</option> <option value="brown">Brown</option> <option selected="selected" value="red">Red</option> <option value="yellow">Yellow</option> </select>