in reply to Selectively coloring a menu's item members
General rule: declare variables in the smallest scope possible. In this case:
#my $style = ''; # Removed global foreach my $menu_item (@menu_options) { my $style = '';
avoids your problem which is due to using a global (to the loop) variable instead of a temporary variable.
|
|---|