sub myFunc { $foo = shift; $foo++ $foo; } #### $obj -> addFunc( \&myFunc );