in reply to if else condition not assigning value when using my

just do ONE declaration in the surrounding scope!

my $which_radio_button = param('P1P2_bugs'); my $rec_type; my $y_label; # #Decide the rec_type based on the Radio button selection if ( $which_radio_button eq 'P1' ) { $rec_type = '3'; $y_label = 'Open P1 Bugs'; } elsif ( $which_radio_button eq 'P2' ) { $rec_type = '4'; $y_label = 'Open P2 Bugs'; } elsif ( $which_radio_button eq 'P1-P2' ) { $rec_type = '2'; $y_label = 'Open P1-P2 Bugs'; } elsif ( $which_radio_button eq 'Daily-Snapshot' ) { $rec_type = '1'; $y_label = 'Daily-Snapshot'; }

should do!

Cheers Rolf

Replies are listed 'Best First'.
Re^2: if else condition not assigning value when using my
by rakheek (Sexton) on Apr 08, 2010 at 23:54 UTC
    Thank you Monk. It worked. Thank you all who replied. Regards, Rakhee