Your code here did not generate that output. It was hard to read without <code> tags, so I reformatted it for you:
print "content-type: text/html \n\n";
# SET UP THE TABLE
print "$array<a href="?node=1">1</a>\n\n"; # <== FIXME
#print "VALUE IS $b\n\n";
Your code here does not compile. You need to escape the double quotes in your print "$array... line.
Beyond that, however, why in the world are you trying to append the output of /usr/bin/who to /root/abcd.txt? More to the point, please let us know exactly what your CGI program is supposed to do, and perhaps then we can get to the root of the problem (no pun intended... or maybe it was...).