in reply to CGI ... newbie
Your problem is this line:
print $html . "\n" ; [download]
Should be
return $html . "\n"; [download]
Just look at the example in CGI::Ajax more closely.