Is it giving any kind of error or is it just not showing. Is this the exact code you are trying to use?
$DOB = " <TD class="$color"> LINK HERE </TD></TR>\n"
This string looks wrong to me for 2 reasons.
1. the space between the " and <TD doesn't seem like it should be there.
2. the $DOB = statement in the then part seems to be using that varible incorrectly. I'm not sure exactly how it should be, but right now I read it as:
If $DOB is greater than or equal to 23 years, then $DOB equals " <TD class="$color"> LINK HERE </TD></TR>\n",
else $DOB equals $DOB = " <TD class="$color"> NO LINKE HERE </TD></TR>\n"
That seems like you're just overwriting your varible with data that can't really be used.
I could be way off here, and I probally am, but looking at it logically, that is what I see.