Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Selectively coloring a menu's item members

by GrandFather (Saint)
on Sep 01, 2007 at 00:01 UTC ( [id://636449]=note: print w/replies, xml ) Need Help??


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.


DWIM is Perl's answer to Gödel

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://636449]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2024-03-28 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found