sub test_foo { override_with_stub_fn('module::bar',\&stub_for_bar); # test code for module::foo goes here }