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.
In reply to Re: Selectively coloring a menu's item members
by GrandFather
in thread Selectively coloring a menu's item members
by hacker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |