in reply to Printing the result of calling an instance method
Try this:
print "<TD>" . $obj->attr1() . "</TD>\n"; [download]