in reply to Test::MockObject and imported functions

You might consider Test::Resub. That would look something like this:
my $handle = Test::Resub->new({ name => 'Foo::bar', code => sub { "mocked out behavior" }, }); # now do something that calls Foo::bar