use threads::shared; my $obj = bless {}, 'foo'; sub foo::callback { warn "I've been called ".++($_[0]->{count})." times\n"; } share($obj); # only needed in a threaded environment my $thread = threads->create('start_thread', sub { $obj->callback(@_) } ); $thread->join; print "count = ", $obj->{count}, "\n"; # prints 3 sub start_thread { my $cb = shift; for (1..3) { $cb->() } }