Keep It Simple, Stupid | |
PerlMonks |
Hashes, Arrays, Comparing Values to Elementsby Trihedralguy (Pilgrim) |
on Nov 30, 2008 at 03:50 UTC ( [id://726871]=perlquestion: print w/replies, xml ) | Need Help?? |
Trihedralguy has asked for the wisdom of the Perl Monks concerning the following question:
Hello monks! I have a problem. First I've talked to a few monks in the chat tonight, and they explained a little, but I think there was a little confusion. I need help! Basically what I have is a list of two elements in a database, like so: Key = ElementID and Value = ColorCode With these I want to build a "grid" of colors, using DIV's. However currently I'm using style="background-color:#$color_code" and I think that is just too much "stuff" to pack up and send to the user interface. So I want to simplify everything down into id=b$elementid (If that makes sense..) However, this is the part I keep getting confused on...I want to check my list of elements to see if its already been used, and if it has, redefined it. So when I build my CSS file I will have something like this: .b1 {background-color: #fff...b2...b3...b4 and so on...However if one of the colors are the same...Dont use it, but redefined that element to use the other color. (Confusing I know!) Here is a sample of some code I've been working on, it doesnt check anything yet, because I cant figure out what I need to do? Please let me know if you see anything that pops out that would make this so much easier. Thank you!
Back to
Seekers of Perl Wisdom
|
|