The lack of code tags that rjt pointed out also munges up the formatting of the replies. It looks like the empty print statements in what he posted contain table related tags, like:
print "content-type: text/html \n\n";
# SET UP THE TABLE
print "<table border='1'>";
print "<th>Test</th><th>Value</th><th>Expected Value</th><th>Result</t
print "$array<a href="?node=1">1</a>\n\n";
#print "VALUE IS $b\n\n";
It would make it easier to sort out the replies if you can go back and wrap your code in code tags.