my $handle = Test::Resub->new({ name => 'Foo::bar', code => sub { "mocked out behavior" }, }); # now do something that calls Foo::bar