in reply to Printing the result of calling an instance method

You have to concatenate the strings with the result of the method.

Try this:

print "<TD>" . $obj->attr1() . "</TD>\n";