sub do_this (&$$;@) { my $code = shift; my $method = shift; my $obj = shift; $obj->$method( $code, @_ ); } do_this {$_ += 1} do_it => $o, 'fred';