good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: If statement not workingby cheekuperl (Monk) |
on Aug 24, 2012 at 13:59 UTC ( [id://989546]=note: print w/replies, xml ) | Need Help?? |
If you have a hash like:
Wouldn't that reduce your if-else series to this: Also, if new colors are added, you'd only need to add an entry in the hash.
In Section
Seekers of Perl Wisdom
|
|